Skip to content

MIDI Implementation

spessasus edited this page Jul 17, 2024 · 19 revisions

MIDI Implementation

This describes what messages SpessaSynth can receive.

Supported MIDI Messages

Message Supported? Notes
Note On ✔️
Note Off ✔️ Does not support note off velocity (Per SF2 specification)
Note Aftertouch ✔️ 50 cents of vibrato ⚠️NOT STANDARD!⚠️
Controller Change ✔️ See below
Program Change ✔️ GM, GM2, GS, XG
Channel Pressure ✔️ 50 cents of vibrato
Pitch Wheel ✔️ Controlled by pitch Wheel range
System exclusive ✔️ See below
Time Code Not Applicable
Song Position Not Applicable
Song Select Not Applicable
Tune Request Not Applicable
MIDI Clock Not Applicable
MIDI Start Not Applicable
MIDI Continue Not Applicable
MIDI Stop Not Applicable
Active Sense Not Applicable
System Reset ✔️ Can only be received via MIDI ports as 0xFF in MIDI files means a meta message

Default Supported Controllers

Below is the list of controllers supported by default.

Note

Theoretically all controllers are supported as it depends on the SoundFont's modulators. These are the controllers that are supported by default/have default modulators.

CC Controller name Value Explanation Default value
0 Bank Select The bank number (0 - 127) Changes the bank number that is used in programChange. Note that it doesn't change the preset on its own. 0
7 Main Volume The volume (0 - 127) 0 is silent, 127 is normal volume Changes the channel's volume. 127
64 Sustain Pedal 0 - 63 is off 64 - 127 is on Holds the noteOff messages until the pedal is off, then stops them all at once. 0
10 Pan 0 is left, 64 is middle, 127 is right Controls the channel's stereo balance 64
123 or 120 All Notes Off or All Sound Off Not Applicable Stops all the notes. Equivalent to MIDI "panic". N.A.
11 Expression controller The expression (0 - 127) 0 is silent, 127 is normal volume Works exactly like Main Volume, but it's independent. 127
1 Modulation Wheel The modulation depth (0 - 127) mapped to max 50 cents of detune Controls the vibrato for the given patch. 0
91 Effects 1 Depth (reverb) The reverb depth (0 - 127) Controls the reverb effect send for the given channel. 0
92 Effects 2 Depth (tremolo) The tremolo depth (0 - 127) mapped to 25dB of loudness variation ⚠️NOT STANDARD!⚠️ Controls the tremolo (trembling) effect for the given patch. 0
93 Effects 3 Depth (chorus) The chorus depth (0 - 127) Controls the chorus effect for the given channel. 0
72 Release Time The release time (0- 127) 64 is normal, 0 is the fastest, 127 is the slowest ⚠️NOT STANDARD!⚠️ Controls the release time for the given patch. 64
74 Brightness The brightness (0 - 127) 0 is muffled, 64 is no additional filter, 127 is most clear ⚠️NOT STANDARD!⚠️ Controls the brightness (lowpass frequency) of the given patch. 64
121 Reset All Controllers Not Applicable Resets all controllers to their default values. N.A.
101 Registered Parameter Number MSB Parameter number (0 - 127) Selects a Registered Parameter's Coarse to the given value. Here are the currently supported values.. none
100 Registered Parameter Number LSB Parameter number (0 - 127) Selects a Registered Parameter's Fine to the given value. Here are the currently supported values.. none
99 Non-Registered Parameter Number MSB Parameter number (0 - 127) Selects a Non-Registered Parameter's Coarse to the given value. Here are the currently supported values.. none
98 Non-Registered Parameter Number LSB Parameter number (0 - 127) Selects a Non-Registered Parameter's Fine to the given value. Here are the currently supported values.. none
6 Data Entry MSB Data entry value (0 - 127) This is sets the selected RP or NRP to the given value. Note that the RPN and NRPN controlles only select the parameter, while this controller actually sets the values. none
38 Data Entry LSB Data entry value (0 - 127) This is sets the selected RP or NRP to the given value. Note that the RPN and NRPN controlles only select the parameter, while this controller actually sets the values. none
32 Bank Select LSB The bank number (0 - 127) Changes the bank number that is used in programChange. Note that it doesn't change the preset on its own. (Used only in XG Mode) 0
33 - 64 excluding 38 Controller LSB values The lower nibble of the value (0 - 127) Allows precise control of values such as volume, expression, pan. Extends the precision from 0 - 127 to 0 - 16384 (!) 0

Supported Registered Parameters

Below is the list of currently implemented Registered-Parameters.

RPN MSB RPN LSB Name Explanation Default
0 0 Pitch Wheel range The range in semitones of the synth.pitchWheel() method. 2 semitones
0 2 Channel Coarse Tuning The channel's tuning in semitones No tuning (0 semitones)
0 3 Channel Fine Tuning The channel's tuning, like a pitch bend message (precise tuning in 2 semitones) No tuning (0 cents)
0 5 Channel Modulation Depth The channel's modulation (vibrato) depth. Note that this doesn't set the cents directly, but rather scales the soundfont modulator value (for example if set to twice the MIDI default value, the modulator controlling vibrato depth will be multiplied by 2) default sf2 depth (50 cents)
127 127 Reset parameters Resets all parameters N.A.

Supported Non Registered Parameters

Below is the list of currently implemented Non-Registered-Parameters. Note that all these are not standard.

NRPN MSB NRPN LSB Name Explanation Default
1 8 Vibrato rate Controls the vibrato rate. The calculation to hertz is as follows: hz = (value / 64) * 8 0 (disabled)
1 9 Vibrato depth Controls the vibrato depth. Depth ratio is as calculated as follows: depth = value / 2 0 (disabled)
1 10 Vibrato delay Controls the vibrato delay. Calculation to seconds is as follows: (64 / value) / 2 0 (disabled)
1 A TVF Filter Cutoff Controls the filter cutoff using the CC 74 (brightness) 64 (no change)
1D N/A Drum Reverb Adjusts the reverb controller if the channel is drum chanel 40 (default reverb)
1E N/A Chorus Reverb Adjusts the chorus controller if the channel is drum chanel 0 (default chorus)

Supported System Exclusives

Below is the list of currently implemented System Exclusive messages.

Name Description
GM on Turns the GM mode on. Ignores all the Bank Select controllers.
GM2 on Turns the GM2 mode on.
GS reset Turns on the Roland GS mode.
XG reset Turns on the Yamaha XG mode. Changes the bank selection system to XG.
Roland GS Use for drums part Can turn the desired channel into a drum channel.
Roland Master Volume Controls the overall synth's volume.
MIDI Master Volume Controls the overall synth's volume.
Roland GS Master Pan Controls the synth's stereo output.
Roland GS Master Volume Controls the overall synth's volume.
Roland SC-88 Display Text The text that SC-88 MIDIs display on the device. Added to parsedMidi.copyright