SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::Render::Voice::Setup Class Reference

A combination of preset zone and instrument zone (plus optional global zones for each) that pertains to a MIDI key/velocity pair. More...

#include <Setup.hpp>

Public Member Functions

 Setup (const PresetZone &presetZone, const PresetZone *presetGlobal, const InstrumentZone &instrumentZone, const InstrumentZone *instrumentGlobal, int key, int velocity)
 Construct a preset/instrument pair. More...
 
void apply (State &state) const
 Update a VoiceState with the various zone configurations. More...
 
const Sample::CanonicalBuffersampleBuffer () const
 
int key () const
 
int velocity () const
 

Detailed Description

A combination of preset zone and instrument zone (plus optional global zones for each) that pertains to a MIDI key/velocity pair.

One instance represents the configuration that should apply to the state of one voice for rendering samples.

Constructor & Destructor Documentation

◆ Setup()

SF2::Render::Voice::Setup::Setup ( const PresetZone presetZone,
const PresetZone presetGlobal,
const InstrumentZone instrumentZone,
const InstrumentZone instrumentGlobal,
int  key,
int  velocity 
)
inline

Construct a preset/instrument pair.

Parameters
presetZonethe PresetZone that matched a key/velocity search
presetGlobalthe global PresetZone to apply (optional – nullptr if no global)
instrumentZonethe InstrumentZone that matched a key/velocity search
instrumentGlobalthe global InstrumentZone to apply (optional – nullptr if no global)
keythe MIDI key that triggered the rendering
velocitythe MIDI velocity that triggered the rendering

Member Function Documentation

◆ apply()

void SF2::Render::Voice::Setup::apply ( State state) const
inline

Update a VoiceState with the various zone configurations.

Parameters
statethe VoiceState to update

References SF2::Render::InstrumentZone::apply(), and SF2::Render::PresetZone::refine().

Referenced by SF2::Render::Voice::State::State().

◆ key()

int SF2::Render::Voice::Setup::key ( ) const
inline
Returns
original MIDI key that triggered the voice

◆ sampleBuffer()

const Sample::CanonicalBuffer& SF2::Render::Voice::Setup::sampleBuffer ( ) const
inline
Returns
the buffer of audio samples to use for rendering

References SF2::Render::InstrumentZone::sampleBuffer().

◆ velocity()

int SF2::Render::Voice::Setup::velocity ( ) const
inline
Returns
original MIDI velocity that triggered the voice

The documentation for this class was generated from the following file: