SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Representation of an instrument
in an SF2 file.
More...
#include <Instrument.hpp>
Inherits SF2::Render::WithZones< InstrumentZone, Entity::Instrument >.
Public Types | |
using | InstrumentZoneCollection = WithZoneCollection |
![]() | |
using | ZoneType = InstrumentZone |
using | EntityType = Entity::Instrument |
using | WithZoneCollection = ZoneCollection< ZoneType > |
Public Member Functions | |
Instrument (const IO::File &file, const Entity::Instrument &config) | |
Construct new Instrument from SF2 entities. More... | |
InstrumentZoneCollection::Matches | filter (int key, int velocity) const |
Locate the instrument zones that apply to the given key/velocity values. More... | |
![]() | |
bool | hasGlobalZone () const |
const ZoneType * | globalZone () const |
const WithZoneCollection & | zones () const |
const EntityType & | configuration () const |
Additional Inherited Members | |
![]() | |
WithZones (size_t zoneCount, const EntityType &configuration) | |
![]() | |
WithZoneCollection | zones_ |
const EntityType & | configuration_ |
Representation of an instrument
in an SF2 file.
An instrument is made up of one or more zones, where a zone is defined as a collection of generators and modulators that apply for a particular MIDI key value and/or velocity. All instrument zone generators except the very first must end with generator index #53 sampleID
which indicates which SampleBuffer
to use to render audio. If the first zone of an instrument does not end with a sampleID
generator, then it is considered to be the one and only global
zone, with its generators/modulators applied to all other zones unless a zone has its own definition.
|
inline |
Construct new Instrument from SF2 entities.
file | the SF2 file that was loaded |
config | the SF2 file entity that defines the instrument |
References SF2::Render::ZoneCollection< Kind >::add(), SF2::Entity::Instrument::firstZoneIndex(), SF2::IO::File::instrumentZones(), SF2::Entity::Instrument::zoneCount(), and SF2::Render::WithZones< InstrumentZone, Entity::Instrument >::zones_.
|
inline |
Locate the instrument zones that apply to the given key/velocity values.
key | the MIDI key number |
velocity | the MIDI velocity value |
References SF2::Render::ZoneCollection< Kind >::filter(), and SF2::Render::WithZones< InstrumentZone, Entity::Instrument >::zones_.