![]() |
![]() |
![]() |
libInstPatch Reference Manual | ![]() |
---|---|---|---|---|
IpatchSF2Preset; IpatchSF2PresetClass; IpatchSF2Preset* ipatch_sf2_preset_new (void); #define ipatch_sf2_preset_get_zones (preset) IpatchSF2Preset* ipatch_sf2_preset_first (IpatchIter *iter); IpatchSF2Preset* ipatch_sf2_preset_next (IpatchIter *iter); void ipatch_sf2_preset_new_zone (IpatchSF2Preset *preset, IpatchSF2Inst *inst); gboolean ipatch_sf2_preset_has_global_zone (IpatchSF2Preset *preset); void ipatch_sf2_preset_set_name (IpatchSF2Preset *preset, const char *name); char* ipatch_sf2_preset_get_name (IpatchSF2Preset *preset); void ipatch_sf2_preset_set_midi_locale (IpatchSF2Preset *preset, int bank, int program); void ipatch_sf2_preset_get_midi_locale (IpatchSF2Preset *preset, int *bank, int *program); int ipatch_sf2_preset_compare (const IpatchSF2Preset *p1, const IpatchSF2Preset *p2);
"bank" gint : Read / Write "genre" guint : Read / Write "library" guint : Read / Write "morphology" guint : Read / Write "name" gchararray : Read / Write "percussion" gboolean : Read / Write "program" gint : Read / Write
The SoundFont preset object is a container for IpatchSF2PZone objects. The amounts of generators (IpatchSF2Gen) in each zone offset the generators of the instruments (IpatchSF2Inst) they contain.
IpatchSF2Preset* ipatch_sf2_preset_new (void);
Create a new SoundFont preset object.
Returns : | New SoundFont preset with a reference count of 1. Caller owns the reference and removing it will destroy the item, unless another reference is added (if its parented for example). |
IpatchSF2Preset* ipatch_sf2_preset_first (IpatchIter *iter);
Gets the first item in a preset iterator. A convenience wrapper for
ipatch_iter_first()
.
iter : |
Patch item iterator containing IpatchSF2Preset items |
Returns : | The first preset in iter or NULL if empty.
|
IpatchSF2Preset* ipatch_sf2_preset_next (IpatchIter *iter);
Gets the next item in a preset iterator. A convenience wrapper for
ipatch_iter_next()
.
iter : |
Patch item iterator containing IpatchSF2Preset items |
Returns : | The next preset in iter or NULL if at the end of the list.
|
void ipatch_sf2_preset_new_zone (IpatchSF2Preset *preset, IpatchSF2Inst *inst);
A convenience function for quickly creating a new preset zone, adding it
to preset
and setting the zone's referenced instrument to inst
.
preset : |
SoundFont preset |
inst : |
Referenced instrument for new zone or NULL to create a global zone
|
gboolean ipatch_sf2_preset_has_global_zone (IpatchSF2Preset *preset);
Check if a preset has a global zone (zone without a referenced instrument).
void ipatch_sf2_preset_set_name (IpatchSF2Preset *preset, const char *name);
Sets the name of a SoundFont preset.
preset : |
Preset to set name of |
name : |
Value to set name to |
char* ipatch_sf2_preset_get_name (IpatchSF2Preset *preset);
Gets the name of a SoundFont preset.
preset : |
Preset to get name of |
Returns : | Name of preset or NULL if not set. String value should be freed
when finished with it.
|
void ipatch_sf2_preset_set_midi_locale (IpatchSF2Preset *preset, int bank, int program);
Sets the MIDI locale of a preset (bank and program numbers).
preset : |
Preset to set MIDI locale of |
bank : |
MIDI bank number to assign to preset |
program : |
MIDI program number to assign to preset |
void ipatch_sf2_preset_get_midi_locale (IpatchSF2Preset *preset, int *bank, int *program);
Gets the MIDI locale of a SoundFont preset (bank and program numbers).
int ipatch_sf2_preset_compare (const IpatchSF2Preset *p1, const IpatchSF2Preset *p2);
Preset comparison function for sorting. Compare two presets by their MIDI bank:program numbers. Note that this function is compatible with GCompareFunc and can therefore be used with g_list_sort, etc.
p1 : |
First preset in comparison |
p2 : |
Second preset in comparison |
Returns : | Comparison result that is less than, equal to, or greater than zero
if p1 is found, respectively, to be less than, to match, or be greater
than p2 .
|
bank
" property"bank" gint : Read / Write
MIDI bank number
Allowed values: [0,128]
Default value: 0
percussion
" property"percussion" gboolean : Read / Write
Percussion preset?.
Default value: FALSE
program
" property"program" gint : Read / Write
MIDI program number.
Allowed values: [0,127]
Default value: 0