SoundFont modulator functions and constants. More...
Data Structures | |
struct | _fluid_mod_t |
Modulator structure. More... | |
Defines | |
#define | FLUID_NUM_MOD 64 |
Maximum number of modulators in a voice. | |
Enumerations | |
enum | fluid_mod_flags { FLUID_MOD_POSITIVE = 0, FLUID_MOD_NEGATIVE = 1, FLUID_MOD_UNIPOLAR = 0, FLUID_MOD_BIPOLAR = 2, FLUID_MOD_LINEAR = 0, FLUID_MOD_CONCAVE = 4, FLUID_MOD_CONVEX = 8, FLUID_MOD_SWITCH = 12, FLUID_MOD_GC = 0, FLUID_MOD_CC = 16 } |
Flags defining the polarity, mapping function and type of a modulator source. More... | |
enum | fluid_mod_src { FLUID_MOD_NONE = 0, FLUID_MOD_VELOCITY = 2, FLUID_MOD_KEY = 3, FLUID_MOD_KEYPRESSURE = 10, FLUID_MOD_CHANNELPRESSURE = 13, FLUID_MOD_PITCHWHEEL = 14, FLUID_MOD_PITCHWHEELSENS = 16 } |
General controller (if FLUID_MOD_GC in flags). More... | |
Functions | |
FLUIDSYNTH_API fluid_mod_t * | fluid_mod_new (void) |
Create a new uninitialized modulator structure. | |
FLUIDSYNTH_API void | fluid_mod_delete (fluid_mod_t *mod) |
Free a modulator structure. | |
FLUIDSYNTH_API void | fluid_mod_set_source1 (fluid_mod_t *mod, int src, int flags) |
Set a modulator's primary source controller and flags. | |
FLUIDSYNTH_API void | fluid_mod_set_source2 (fluid_mod_t *mod, int src, int flags) |
Set a modulator's secondary source controller and flags. | |
FLUIDSYNTH_API void | fluid_mod_set_dest (fluid_mod_t *mod, int dst) |
Set the destination effect of a modulator. | |
FLUIDSYNTH_API void | fluid_mod_set_amount (fluid_mod_t *mod, double amount) |
Set the scale amount of a modulator. | |
FLUIDSYNTH_API int | fluid_mod_get_source1 (fluid_mod_t *mod) |
Get the primary source value from a modulator. | |
FLUIDSYNTH_API int | fluid_mod_get_flags1 (fluid_mod_t *mod) |
Get primary source flags from a modulator. | |
FLUIDSYNTH_API int | fluid_mod_get_source2 (fluid_mod_t *mod) |
Get the secondary source value from a modulator. | |
FLUIDSYNTH_API int | fluid_mod_get_flags2 (fluid_mod_t *mod) |
Get secondary source flags from a modulator. | |
FLUIDSYNTH_API int | fluid_mod_get_dest (fluid_mod_t *mod) |
Get destination effect from a modulator. | |
FLUIDSYNTH_API double | fluid_mod_get_amount (fluid_mod_t *mod) |
Get the scale amount from a modulator. | |
FLUIDSYNTH_API int | fluid_mod_test_identity (fluid_mod_t *mod1, fluid_mod_t *mod2) |
Checks if two modulators are identical in sources, flags and destination. |
SoundFont modulator functions and constants.
enum fluid_mod_flags |
Flags defining the polarity, mapping function and type of a modulator source.
Compare with SoundFont 2.04 PDF section 8.2.
Note: Bit values do not correspond to the SoundFont spec! Also note that FLUID_MOD_GC and FLUID_MOD_CC are in the flags field instead of the source field.
FLUID_MOD_POSITIVE |
Mapping function is positive. |
FLUID_MOD_NEGATIVE |
Mapping function is negative. |
FLUID_MOD_UNIPOLAR |
Mapping function is unipolar. |
FLUID_MOD_BIPOLAR |
Mapping function is bipolar. |
FLUID_MOD_LINEAR |
Linear mapping function. |
FLUID_MOD_CONCAVE |
Concave mapping function. |
FLUID_MOD_CONVEX |
Convex mapping function. |
FLUID_MOD_SWITCH |
Switch (on/off) mapping function. |
FLUID_MOD_GC |
General controller source type (fluid_mod_src). |
FLUID_MOD_CC |
MIDI CC controller (source will be a MIDI CC number). |
enum fluid_mod_src |
General controller (if FLUID_MOD_GC in flags).
This corresponds to SoundFont 2.04 PDF section 8.2.1
FLUIDSYNTH_API fluid_mod_t* fluid_mod_new | ( | void | ) |
Create a new uninitialized modulator structure.
References FLUID_ERR, and fluid_mod_new().
Referenced by fluid_mod_new().
FLUIDSYNTH_API void fluid_mod_delete | ( | fluid_mod_t * | mod | ) |
Free a modulator structure.
mod | Modulator to free |
References fluid_mod_delete().
Referenced by fluid_mod_delete().
FLUIDSYNTH_API void fluid_mod_set_source1 | ( | fluid_mod_t * | mod, | |
int | src, | |||
int | flags | |||
) |
Set a modulator's primary source controller and flags.
mod | Modulator | |
src | Modulator source (fluid_mod_src or a MIDI controller number) | |
flags | Flags determining mapping function and whether the source controller is a general controller (FLUID_MOD_GC) or a MIDI CC controller (FLUID_MOD_CC), see fluid_mod_flags. |
References _fluid_mod_t::flags1, fluid_mod_set_source1(), and _fluid_mod_t::src1.
Referenced by fluid_mod_set_source1().
FLUIDSYNTH_API void fluid_mod_set_source2 | ( | fluid_mod_t * | mod, | |
int | src, | |||
int | flags | |||
) |
Set a modulator's secondary source controller and flags.
mod | Modulator | |
src | Modulator source (fluid_mod_src or a MIDI controller number) | |
flags | Flags determining mapping function and whether the source controller is a general controller (FLUID_MOD_GC) or a MIDI CC controller (FLUID_MOD_CC), see fluid_mod_flags. |
References _fluid_mod_t::flags2, fluid_mod_set_source2(), and _fluid_mod_t::src2.
Referenced by fluid_mod_set_source2().
FLUIDSYNTH_API void fluid_mod_set_dest | ( | fluid_mod_t * | mod, | |
int | dest | |||
) |
Set the destination effect of a modulator.
mod | Modulator | |
dest | Destination generator (fluid_gen_type) |
References _fluid_mod_t::dest, and fluid_mod_set_dest().
Referenced by fluid_mod_set_dest().
FLUIDSYNTH_API void fluid_mod_set_amount | ( | fluid_mod_t * | mod, | |
double | amount | |||
) |
Set the scale amount of a modulator.
mod | Modulator | |
amount | Scale amount to assign |
References _fluid_mod_t::amount, and fluid_mod_set_amount().
Referenced by fluid_mod_set_amount().
FLUIDSYNTH_API int fluid_mod_get_source1 | ( | fluid_mod_t * | mod | ) |
Get the primary source value from a modulator.
mod | Modulator |
References fluid_mod_get_source1(), and _fluid_mod_t::src1.
Referenced by fluid_mod_get_source1().
FLUIDSYNTH_API int fluid_mod_get_flags1 | ( | fluid_mod_t * | mod | ) |
Get primary source flags from a modulator.
mod | Modulator |
References _fluid_mod_t::flags1, and fluid_mod_get_flags1().
Referenced by fluid_mod_get_flags1().
FLUIDSYNTH_API int fluid_mod_get_source2 | ( | fluid_mod_t * | mod | ) |
Get the secondary source value from a modulator.
mod | Modulator |
References fluid_mod_get_source2(), and _fluid_mod_t::src2.
Referenced by fluid_mod_get_source2().
FLUIDSYNTH_API int fluid_mod_get_flags2 | ( | fluid_mod_t * | mod | ) |
Get secondary source flags from a modulator.
mod | Modulator |
References _fluid_mod_t::flags2, and fluid_mod_get_flags2().
Referenced by fluid_mod_get_flags2().
FLUIDSYNTH_API int fluid_mod_get_dest | ( | fluid_mod_t * | mod | ) |
Get destination effect from a modulator.
mod | Modulator |
References _fluid_mod_t::dest, and fluid_mod_get_dest().
Referenced by fluid_mod_get_dest().
FLUIDSYNTH_API double fluid_mod_get_amount | ( | fluid_mod_t * | mod | ) |
Get the scale amount from a modulator.
mod | Modulator |
References _fluid_mod_t::amount, and fluid_mod_get_amount().
Referenced by fluid_mod_get_amount().
FLUIDSYNTH_API int fluid_mod_test_identity | ( | fluid_mod_t * | mod1, | |
fluid_mod_t * | mod2 | |||
) |
Checks if two modulators are identical in sources, flags and destination.
mod1 | First modulator | |
mod2 | Second modulator |
SF2.01 section 9.5.1 page 69, 'bullet' 3 defines 'identical'.
References _fluid_mod_t::dest, _fluid_mod_t::flags1, _fluid_mod_t::flags2, fluid_mod_test_identity(), _fluid_mod_t::src1, and _fluid_mod_t::src2.
Referenced by fluid_mod_test_identity(), and fluid_voice_add_mod().