Skip to content

Modulator Class

spessasus edited this page Oct 17, 2024 · 7 revisions

Modulator Class

Represents a single Modulator.

Properties

All numbers

sourcePolarity

The primary source's polarity.

sourceDirection

The primary source's direction.

sourceUsesCC

If the primary source uses a MIDI controller.

sourceIndex

The index of the primary source.

sourceCurveType

The primary source's curve types.

secSrcPolarity

The secondary source's polarity.

secSrcDirection

The secondary source's direction.

secSrcUsesCC

If the secondary source uses a MIDI controller.

secSrcIndex

The index of the secondary source.

secSrcCurveType

The secondary source's curve types.

modulatorDestination

The destination of the modulator. -1 if linked as it's not supported.

transformType

The transform type to apply.

transformAmount

The amount of transform to apply.

Modulator sources

Below is the table of modulator sources if the usesCC flag is set to 0.

Index Name
0 No controller = 1
2 Note on velocity
3 Note on key number
10 Poly pressure
13 Channel pressure
14 Pitch Wheel
16 Pitch Wheel range
127 Link (UNSUPPORTED)

Modulator curve types

Below are the defined curve types of modulators:

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

Default Modulators

Below is the default modulator list for SpessaSynth.

Note: cB - centibels, 1/10 of a decibel

Source Secondary source Destination Transform amount Notes
Note On velocity Negative Unipolar Concave No controller Initial attenuation 960 cB SF2 Default
Modulation Wheel Positive Unipolar Linear No controller Vibrato LFO to pitch 50 cents SF2 Default
Volume Negative Unipolar Concave No controller Initial attenuation 960 cB SF2 Default
Channel Pressure Positive Unipolar Linear No controller Vibrato LFO to pitch 50 cents SF2 Default
Pitch Wheel Positive Bipolar Linear Pitch wheel range Positive Unipolar Linear Fine tune 12700 cents SF2 Default
Pan Positive Bipolar Linear No controller Pan 500 percent SF2 Default
Expression Negative Unipolar Concave No controller Initial attenuation 960 cB SF2 Default
Reverb depth Negative Unipolar Linear No controller Reverb effects send 1000 percent SF2 Default, amount increased
Chorus depth Negative Unipolar Linear No controller Chorus effects send 1000 percent SF2 Default, amount increased
Poly Pressure Positive Unipolar Linear No controller Vibrato LFO to pitch 50 cents ⚠️ NOT STANDARD ⚠️
CC 92 depth Positive Unipolar Linear No controller Mod LFO to volume 24 cB ⚠️ NOT STANDARD ⚠️
CC 72 Positive Bipolar Linear No controller Volume envelope release 1200 timecents ⚠️ NOT STANDARD ⚠️
CC 74 Positive Bipolar Linear No controller Initial filter Cutoff 6000 abs cents ⚠️ NOT STANDARD ⚠️
CC 71 Positive Bipolar Linear No controller Initial filter Reasonance 250 cB ⚠️ NOT STANDARD ⚠️

Reverb and Chorus modulators

SpessaSynth has custom behavior for these modulators, emulating BASSMIDI:

  • The modulators affected are all modulators that use Reverb depth Negative Unipolar Linear or Chorus depth Negative 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 initial transform amount is below 1000
  • If the transform is multiplied, it is capped at 1000

Reasoning

Amount of 200 (SF2 default) is too low for these modulators, according to Ian from Un4seen. I agree with him, 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:

  • soundfonts 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 to disable these modulators.
  • Some soundfonts assume a default reverb of 1000 and set some to 800 or similar. Using the default 200 will cause big imbalance between the custom and default modulators.