These rules concern a synthesiser that plays a SoundFont, not the file. They are in the specification (sections 9.2 and 9.6) and are given here so that every part of it has a page; the explorer does not play MIDI.
MIDI functions
The response to some MIDI commands is defined by the MIDI specification, so it is not part of the SoundFont 2 specification, and these commands may not be used as sources of modulators. The expected responses are (spec 9.2):
| Controller | Name | Response |
|---|---|---|
| CC0 | Bank Select | The following program change selects the program in this bank instead of the default bank 0 |
| CC6 | Data Entry MSB | Its value goes to the RPN or the NRPN mechanism, depending on the Data Entry mode |
| CC32 | Bank Select LSB | May work with CC0 to give 16,384 possible banks of programs |
| CC38 | Data Entry LSB | Its value goes to the RPN or NRPN mechanism, depending on the mode |
| CC64 | Sustain | Active at 64 or more: notes in the key-on state stay there whatever key-offs arrive; the key-offs are stored and executed when sustain becomes inactive |
| CC66 | Soft | Active at 64 or more: all new key-ons are modulated to sound “soft”, typically through the initial attenuation and the filter cutoff |
| CC67 | Sostenuto | Active at 64 or more: notes currently in key-on stay there until it becomes inactive; other notes behave normally; they stay even if sustain is switched on and off |
| CC98 | NRPN LSB | Handled by the NRPN mechanism |
| CC99 | NRPN MSB | Puts the synthesiser in NRPN Data Entry mode and is handled by the NRPN mechanism |
| CC100 | RPN LSB | Handled by the RPN mechanism |
| CC101 | RPN MSB | Puts the synthesiser in RPN Data Entry mode and is handled by the RPN mechanism |
| CC120 | All Sound Off | With any data value, all notes in the key-on state skip their release phase and are shut off, whatever the sustain or sostenuto positions |
| CC121 | Reset All Controllers | As in the MIDI specification: typically resets the controllers to a power-on or default state |
| CC123 | All Notes Off | With any data value, all notes in the key-on state immediately enter their release phase, subject to sustain or sostenuto |
Specification 2.00b removed two items listed in 2.00a: MIDI key number to pitch (the “Scale Tune” generator, which is also a true modulator) and MIDI pitch bend (also a true modulator) (spec 9.2).
The standard NRPN implementation (2.01)
Modulators give real-time control, but they do not let a performer control every parameter without sound design. The standard NRPN (non-registered parameter number) implementation of 2.01 lets MIDI messages drive any generator. It is not compatible with the NRPN implementations of other SoundFont 2 products such as the Sound Blaster AWE32 (spec 9.6).
The message
An NRPN message is up to four continuous controller messages, order-dependent and following running status, so an LSB is used with the most recent MSB whichever message was sent last (spec 9.6.1):
- NRPN Select MSB: controller 99
- NRPN Select LSB: controller 98
- Data Entry LSB: controller 38
- Data Entry MSB: controller 6
Selecting a generator
The Select MSB value 120 says that the message is a SoundFont 2.01 NRPN message. A Select LSB below 100 is the generator number modulo 100, if and only if the most recent Select MSB was 120. Larger values let a generator number above 99 be selected (spec 9.6.2):
| Select LSB | Meaning |
|---|---|
| 0 to 99 | The generator value |
| 100 | A single multiple of 100 for generator value selection |
| 101 | A single multiple of 1,000 |
| 102 | A single multiple of 10,000 |
| 103 to 127 | Undefined, unused, ignored if encountered |
LSBs of 100 and above are for setup and are never used alone. To control initialFilterFc (8): MSB 120, LSB 8. For a generator numbered 100: MSB 120, LSB 100, LSB 0. For one numbered 250: MSB 120, LSB 100, LSB 100, LSB 50. Running status does not cover repeated values of 100 or more: after selecting 250, sending 51 selects 51, not 251. If the parameter is not recognised, is not a real-time one (such as overriding root key or key number) or cannot be controlled in real time without artifacts, the LSB selection is ignored but the MSB state, that this is a SoundFont NRPN, stays.
Data entry
Data entry values apply as SoundFont controllers only when the most recent NRPN MSB and LSB were a SoundFont 2.01 message and no RPN LSB/MSB pair was sent more recently (spec 9.6.3). The two controllers make one 14-bit value that is additive, exactly like a modulator, applied when the MSB message arrives, combined with the latest LSB. The zero offset is 0x2000, which means “add 0”. The value spans the useful range of the summary table in the same additive units; when that range is over 8192 units the range of the NRPN control is halved until it is 8192 units or fewer, and when it is less it is left unchanged, though a synthesiser may allow the control to exceed it.
The explorer’s Note tab can send these: its Events box takes lines such as 1.2 nrpn 8 9000 (generator 8, data 9000) at a time in seconds, with the scale above, and ignores the generators that are not real-time. FluidSynth’s own table of scales differs in places; the units page says where.
Source: SoundFont Technical Specification 2.04, sections 9.2 and 9.6 (9.6.1 to 9.6.3).