|
SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Represents a preset that knows how to emit sounds for MIDI events when it is active. More...
#include <Preset.hpp>
Inherits SF2::Render::WithZones< PresetZone, Entity::Preset >.
Public Types | |
| using | PresetZoneCollection = WithZoneCollection |
| using | Matches = std::vector< Voice::Setup > |
Public Types inherited from SF2::Render::WithZones< PresetZone, Entity::Preset > | |
| using | ZoneType = PresetZone |
| using | EntityType = Entity::Preset |
| using | WithZoneCollection = ZoneCollection< ZoneType > |
Public Member Functions | |
| Preset (const IO::File &file, const InstrumentCollection &instruments, const Entity::Preset &config) | |
| Construct new Preset from SF2 entities. More... | |
| Matches | find (int key, int velocity) const |
| Locate preset/instrument pairs for the given key/velocity values. More... | |
Public Member Functions inherited from SF2::Render::WithZones< PresetZone, Entity::Preset > | |
| bool | hasGlobalZone () const |
| const ZoneType * | globalZone () const |
| const WithZoneCollection & | zones () const |
| const EntityType & | configuration () const |
Additional Inherited Members | |
Protected Member Functions inherited from SF2::Render::WithZones< PresetZone, Entity::Preset > | |
| WithZones (size_t zoneCount, const EntityType &configuration) | |
Protected Attributes inherited from SF2::Render::WithZones< PresetZone, Entity::Preset > | |
| WithZoneCollection | zones_ |
| const EntityType & | configuration_ |
Represents a preset that knows how to emit sounds for MIDI events when it is active.
A preset is made up of a collection of zones, where each zone defines a MIDI key and velocity range that it applies to and an instrument that determines the sound to produce. Note that zones can overlap, so one MIDI event can cause multiple instruments to play, each which will require a Voice instance to render.
| using SF2::Render::Preset::Matches = std::vector<Voice::Setup> |
|
inline |
Construct new Preset from SF2 entities.
| file | the SF2 file that is loaded |
| instruments | the collection of instruments that apply to the preset |
| config | the SF2 preset definition |
References SF2::Render::ZoneCollection< Kind >::add(), SF2::Entity::Preset::firstZoneIndex(), SF2::IO::File::presetZones(), SF2::Entity::Preset::zoneCount(), and SF2::Render::WithZones< PresetZone, Entity::Preset >::zones_.
|
inline |
Locate preset/instrument pairs for the given key/velocity values.
| key | the MIDI key to filter with |
| velocity | the MIDI velocity to filter with |
References SF2::Render::ZoneCollection< Kind >::filter(), SF2::Render::WithZones< PresetZone, Entity::Preset >::globalZone(), and SF2::Render::WithZones< PresetZone, Entity::Preset >::zones_.