spessasynth_core documentation
    Preparing search index...

    Modulator Information

    Modulators are an SF2 feature fully supported in spessasynth_core, allowing for real-time parameter manipulation with MIDI commands.

    Below is useful information regarding the implementation of modulators in spessasynth_core.

    Below is the table of modulator sources if the CC flag is not set. If it is set, the index is the MIDI controller number.

    Index Name Description
    0 No controller = 1 Always returns 1.
    2 Note on velocity The MIDI velocity the note was pressed with.
    3 Note on key number The MIDI key number received.
    10 Poly pressure The MIDI poly pressure message received for this note number.
    13 Channel pressure The MIDI channel pressure message received for this channel.
    14 Pitch Wheel The pitch wheel value, 14-bit.
    16 Pitch Wheel range The range of the pitch wheel, in semitones.
    127 Link (UNSUPPORTED) Other modulator. This feature is underspecified and not implemented, similarly to fluidsynth.

    Below are the defined curve types of modulators:

    • 0 Linear - normal linear scale
    • 1 Concave - exponential ramp
    • 2 Convex - logarithmic ramp
    • 3 Switch - 0.5 and below is 0 (or -1 for bipolar), above is 1

    Below is the default modulator list for SpessaSynth.

    Units used in the tables below:

    • cB - centibels, 1/10 of a decibel.
    • ‰ - 1/10 of a percent.

    These are the default modulators, as defined by the SF2.04 specification.

    - denotes source enumeration 0x0 (no controller linear unipolar positive).

    Source Source Transform Secondary source Destination Transform amount
    Note On Velocity Negative Unipolar Concave - Initial attenuation 960 cB
    CC 1 (Modulation Wheel) Positive Unipolar Linear - Vibrato LFO to pitch 50 cents
    CC 7 (Volume) Negative Unipolar Concave - Initial attenuation 960 cB
    Channel Pressure Positive Unipolar Linear - Vibrato LFO to pitch 50 cents
    Pitch Wheel Positive Bipolar Linear Pitch wheel range Positive Unipolar Linear Fine tune 12700 cents
    CC 10 (Pan) Positive Bipolar Linear - Pan 500 ‰
    CC 11 (Expression) Negative Unipolar Concave - Initial attenuation 960 cB
    CC 91 (Reverb Depth) Positive Unipolar Linear - Reverb effects send 200 ‰
    CC 93 (Chorus Depth) Positive Unipolar Linear - Chorus effects send 200 ‰

    SpessaSynth applies a few extra modulators for extended compatibility with various MIDI standards.

    Source Source Transform Secondary source Destination Transform amount
    CC 67 (Soft Pedal) Switch Unipolar Positive - Initial Filter Cutoff -1200 abs cents
    CC 71 (Filter Resonance) Positive Bipolar Linear - Initial Filter Resonance 250 cB
    CC 72 (Vol Env Release) Positive Bipolar Linear - Volume envelope release 3600 timecents
    CC 73 (Vol Env Attack) Positive Bipolar Convex - Volume envelope attack 6000 timecents
    CC 74 (Filter Cutoff) Positive Bipolar Linear - Initial Filter Cutoff 9600 abs cents
    CC 75 (Vol Env Decay) Positive Bipolar Linear - Volume envelope decay 3600 timecents

    SpessaSynth treats a specific modulator as a resonant modulator. That is:

    • Source 1: CC 71 Positive Bipolar Linear
    • Source 2: No controller Positive Unipolar Linear (0x0)
    • Destination: Initial Filter Resonance

    This modulator is coded to not affect the DSP gain like the SF2 specification requires. This is done because neither XG nor GS reacted that way to CC 71. Other than that, the filter is fully to the spec. All other modulators/generators affect the gain as the spec requires.

    This approach allows the soundfont engineer to overwrite or delete the modulator, while maintaining the same behavior.

    SpessaSynth has custom behavior for these modulators, emulating BASSMIDI:

    • The modulators affected are all modulators that use Reverb depth Positive Unipolar Linear or Chorus depth Positive Unipolar Linear as a primary source and No Controller as the secondary source and either reverbEffectsSend or chorusEffectsSend as the destination
    • The transform amount is multiplied by 5 if the initial transform amount is 1000 or below
    • If the transform is multiplied, it is capped at 1000.

    The amount of 200 (SF2 default) is too low for these modulators, according to Ian from Un4seen. I agree with this, and also set the default to 1000 (actually it's 200 multiplied by 5 which is 1000). But this poses a few problems without using the solution above:

    • Sound banks that assume default reverb of 200 will have almost inaudible effects. For example, a soundfont might want to slightly decrease the reverb, by setting it to 150, for example. It is way less than the default 1000, and the approach above will make it 150 * 5 = 750 which is still less than default, but more audible.
    • This approach still allows disabling these modulators.
    • Some soundfonts assume a default reverb of 1000 and set some to 800 or similar. Using default 200 will cause a big imbalance between the custom and default modulators.