A generator is a single synthesiser parameter. “Generator” is the word used in the pgen and igen lists; “modulator destination” is the same thing in the pmod and imod lists, and modulator destinations are exclusively the value generators (spec 8.1.1). The enumeration SFGenerator is two bytes long and the specification defines the numbers 0 to 60 (spec 8.1.2). A generator number the file uses that is not defined here makes the generator ignored (spec 10.3).
Five kinds of generator
| Kind | Meaning | Generators |
|---|---|---|
| Index | The amount is an index into another data structure | instrument (41), sampleID (53) |
| Range | Defines a range of note-on parameters outside of which the zone is undefined | keyRange (43), velRange (44) |
| Substitution | Substitutes a value for a note-on parameter | keynum (46), velocity (47) |
| Sample | Directly affects a sample’s properties; undefined at the preset level | The eight address offset generators, sampleModes, overridingRootKey, exclusiveClass |
| Value | Directly changes a signal processing parameter: most generators | All the rest |
(Spec 8.1.1.) Of these, the generators that are valid only at the instrument level are marked in the table below: the eight address offsets, keynum, velocity, sampleModes, exclusiveClass and overridingRootKey. If one is found in a preset zone it is ignored (spec 8.5).
The enumerators with their ranges
Range and default are the “Min”, “Max” and “Default” columns of the summary table (spec 8.1.3). A range of “depends” is the table’s “*”: it depends on the start, loop and end points of the sample header. The unit names are defined on the units page.
| # | Name | Kind | Unit | Range | Default | Level | Meaning |
|---|---|---|---|---|---|---|---|
| 0 | startAddrsOffset | sample | sample data points | depends | 0 | instrument only | The offset beyond the sample header’s Start to the first data point to be played: with Start 7 and an offset of 2 the first point played is point 9 |
| 1 | endAddrsOffset | sample | sample data points | depends | 0 | instrument only | The offset beyond End to the last data point played: End 17 and −2 gives point 15 |
| 2 | startloopAddrsOffset | sample | sample data points | depends | 0 | instrument only | The offset beyond Startloop to the first data point repeated in the loop: 10 and −1 gives point 9 |
| 3 | endloopAddrsOffset | sample | sample data points | depends | 0 | instrument only | The offset beyond Endloop to the point considered equivalent to the Startloop point: 15 and 2 gives point 17 |
| 4 | startAddrsCoarseOffset | sample | 32768-point blocks | depends | 0 | instrument only | The offset in 32768-point increments beyond Start, added to startAddrsOffset: Start 5, offset 3, coarse 2 gives point 65544 |
| 5 | modLfoToPitch | value | cents | −12000 to 12000 | 0 | both | How far a full excursion of the modulation LFO changes pitch; positive raises it. 100 first rises a semitone, then falls one |
| 6 | vibLfoToPitch | value | cents | −12000 to 12000 | 0 | both | The same for the vibrato LFO |
| 7 | modEnvToPitch | value | cents | −12000 to 12000 | 0 | both | How far the modulation envelope changes pitch at its peak: 100 raises it a semitone |
| 8 | initialFilterFc | value | cents (absolute) | 1500 to 13500 | 13500 | both | The cutoff and resonant frequency of the lowpass filter, a second-order resonant pole pair. Above 20 kHz with a Q of zero the filter does not affect the signal. 1500 cents is 20 Hz, 13500 is 20 kHz |
| 9 | initialFilterQ | value | centibels | 0 to 960 | 0 | both | The height above DC gain of the resonance at the cutoff. Zero or less is not resonant; the DC gain is reduced by half the value |
| 10 | modLfoToFilterFc | value | cents | −12000 to 12000 | 0 | both | How far the modulation LFO moves the filter cutoff: 1200 first rises an octave, then falls one |
| 11 | modEnvToFilterFc | value | cents | −12000 to 12000 | 0 | both | How far the modulation envelope moves the cutoff at its attack peak; positive raises it. The specification’s example: 1000 raises it one octave at the attack peak |
| 12 | endAddrsCoarseOffset | sample | 32768-point blocks | depends | 0 | instrument only | The offset in 32768-point increments beyond End, added to endAddrsOffset |
| 13 | modLfoToVolume | value | centibels | −960 to 960 | 0 | both | How far the modulation LFO changes volume; the change is in decibels, not linear amplitude |
| 14 | unused1 | unused | none | Unused, reserved: ignored if encountered | |||
| 15 | chorusEffectsSend | value | 0.1% | 0 to 1000 | 0 | both | How much of the note is sent to the chorus processor: 0% or less none, 100% or more full level; 250 is 25%. It does not change the dry part |
| 16 | reverbEffectsSend | value | 0.1% | 0 to 1000 | 0 | both | The same for the reverb processor |
| 17 | pan | value | 0.1% | −500 to 500 | 0 | both | Where the dry output sits between left and right: −50% or less entirely left, +50% or more entirely right, 0 centred; −250 is 75% left and 25% right |
| 18 | unused2 | unused | none | Unused, reserved: ignored if encountered | |||
| 19 | unused3 | unused | none | Unused, reserved: ignored if encountered | |||
| 20 | unused4 | unused | none | Unused, reserved: ignored if encountered | |||
| 21 | delayModLFO | value | timecents (absolute) | −12000 to 5000 | −12000 | both | The time from key on until the modulation LFO begins its upward ramp; 0 is one second, −32768 conventionally no delay; 10 ms is −7973 |
| 22 | freqModLFO | value | cents (absolute) | −16000 to 4500 | 0 | both | The frequency of the modulation LFO’s triangular period; 0 is 8.176 Hz; 10 mHz is −11610 |
| 23 | delayVibLFO | value | timecents (absolute) | −12000 to 5000 | −12000 | both | The same delay for the vibrato LFO |
| 24 | freqVibLFO | value | cents (absolute) | −16000 to 4500 | 0 | both | The frequency of the vibrato LFO, as for the modulation LFO |
| 25 | delayModEnv | value | timecents (absolute) | −12000 to 5000 | −12000 | both | The delay between key on and the start of the modulation envelope’s attack |
| 26 | attackModEnv | value | timecents (absolute) | −12000 to 8000 | −12000 | both | The time from the end of the delay to the envelope’s peak; the attack is convex. −32768 conventionally means instantaneous |
| 27 | holdModEnv | value | timecents (absolute) | −12000 to 5000 | −12000 | both | The time the envelope is held at its peak before the decay; −32768 conventionally no hold |
| 28 | decayModEnv | value | timecents (absolute) | −12000 to 8000 | −12000 | both | The time for a 100% change during the decay, a linear ramp toward the sustain level |
| 29 | sustainModEnv | value | −0.1% (decrease) | 0 to 1000 | 0 | both | The decrease in level to which the envelope ramps: 0 is full level (no decay phase), 1000 is nothing; below 0 is read as 0 and above 1000 as 1000; 40% of peak is 600 |
| 30 | releaseModEnv | value | timecents (absolute) | −12000 to 8000 | −12000 | both | The time for a 100% change during the release, a linear ramp to zero |
| 31 | keynumToModEnvHold | value | timecents per key | −1200 to 1200 | 0 | both | How much the hold time of the modulation envelope shortens with a higher key number; unchanged at key 60; 100 makes the hold track the keyboard, halving an octave up |
| 32 | keynumToModEnvDecay | value | timecents per key | −1200 to 1200 | 0 | both | The same for the decay time (the specification repeats the text for the hold time here) |
| 33 | delayVolEnv | value | timecents (absolute) | −12000 to 5000 | −12000 | both | The delay between key on and the start of the volume envelope’s attack |
| 34 | attackVolEnv | value | timecents (absolute) | −12000 to 8000 | −12000 | both | The attack time of the volume envelope; convex, so the result is linear in amplitude when applied to decibels |
| 35 | holdVolEnv | value | timecents (absolute) | −12000 to 5000 | −12000 | both | The time the volume envelope is held at its peak |
| 36 | decayVolEnv | value | timecents (absolute) | −12000 to 8000 | −12000 | both | The time for a 100% change during the decay: a linear ramp toward the sustain level, a constant dB change for each time unit |
| 37 | sustainVolEnv | value | centibels (attenuation) | 0 to 1440 | 0 | both | The decrease in level to which the volume envelope ramps during the decay: 0 is full level, 120 is 12 dB below peak; below 0 is read as 0, and 1000 conventionally means full attenuation |
| 38 | releaseVolEnv | value | timecents (absolute) | −12000 to 8000 | −12000 | both | The time for a release from full level, a linear ramp in decibels, until 100 dB of attenuation |
| 39 | keynumToVolEnvHold | value | timecents per key | −1200 to 1200 | 0 | both | How much the volume envelope’s hold time shortens with a higher key number; unchanged at key 60 |
| 40 | keynumToVolEnvDecay | value | timecents per key | −1200 to 1200 | 0 | both | The same for the decay time (the specification repeats the text for the hold time here) |
| 41 | instrument | index | index | 0 to terminal − 1 | preset only | The index into inst of the instrument used by the preset zone. The terminal generator of a preset zone: the last in every zone but the global zone. It should never exceed two less than the size of the instrument list | |
| 42 | reserved1 | unused | none | Unused, reserved: ignored if encountered | |||
| 43 | keyRange | range | MIDI key number | 0 to 127 | 0 to 127 (full keyboard) | both | The lowest and highest key for which the zone is active. Optional; when present it is the first generator of the zone |
| 44 | velRange | range | MIDI velocity | 0 to 127 | 0 to 127 (all velocities) | both | The lowest and highest velocity for which the zone is active. Optional; when present it is preceded only by keyRange |
| 45 | startloopAddrsCoarseOffset | sample | 32768-point blocks | depends | 0 | instrument only | The offset in 32768-point increments beyond Startloop, added to startloopAddrsOffset |
| 46 | keynum | substitution | MIDI key number | 0 to 127 | none (−1) | instrument only | Forces the MIDI key number to be read as the value given |
| 47 | velocity | substitution | MIDI velocity | 1 to 127 in the table, 0 to 127 in the text | none (−1) | instrument only | Forces the MIDI velocity to be read as the value given |
| 48 | initialAttenuation | value | centibels | 0 to 1440 | 0 | both | The attenuation below full scale: 0 none, 60 is 6 dB below full scale |
| 49 | reserved2 | unused | none | Unused, reserved: ignored if encountered | |||
| 50 | endloopAddrsCoarseOffset | sample | 32768-point blocks | depends | 0 | instrument only | The offset in 32768-point increments beyond Endloop, added to endloopAddrsOffset |
| 51 | coarseTune | value | semitones | −120 to 120 | 0 | both | A pitch offset in semitones; positive is higher: −4 is four semitones flat |
| 52 | fineTune | value | cents | −99 to 99 | 0 | both | A pitch offset in cents, additive with coarseTune |
| 53 | sampleID | index | index | 0 to terminal − 1 | instrument only | The index into shdr of the sample used by the instrument zone. The terminal generator of an instrument zone, last in every zone but the global zone; it should never exceed two less than the size of the sample list | |
| 54 | sampleModes | sample | bit flags | flags | 0 (no loop) | instrument only | Boolean flags for the sample of the zone. The two least significant bits: 0 no loop, 1 loops continuously, 2 unused and read as no loop, 3 loops for the duration of the key press, then plays the rest of the sample. Not in the global zone |
| 55 | reserved3 | unused | none | Unused, reserved: ignored if encountered | |||
| 56 | scaleTuning | value | cents per key | 0 to 1200 | 100 | both | How much the key number changes pitch: 0 none, 100 the usual tempered semitone scale |
| 57 | exclusiveClass | sample | class number | 1 to 127 | 0 (none) | instrument only | A note with a class other than 0 rapidly ends any sounding note of the same class, as a hi-hat does. Its scope is the entire preset |
| 58 | overridingRootKey | sample | MIDI key number | 0 to 127 | −1 (use the sample header) | instrument only | The key at which the sample plays at its header sample rate. Absent or −1: the header’s original key is used |
| 59 | unused5 | unused | none | Unused, reserved: ignored if encountered | |||
| 60 | endOper | unused | none | Unused, reserved: ignored if encountered; its unique name gives the end of the defined list |
(Spec 8.1.2 and 8.1.3.)
Where the specification contradicts itself
The explorer follows the structure definitions and the real banks, and the places below are where the text of the specification disagrees with itself or with them.
- Key and velocity ranges. The text of
keyRangeandvelRangesays the least significant byte holds the highest value and the most significant byte the lowest. The type definition names the first bytebyLoand the secondbyHi, and in little-endian that makesbyLothe least significant byte, so the text says the opposite. The explorer readsbyLoas the lowest, which is what the real bank VintageDreamsWaves-v2 does (its instrument “FM 1” has ranges 0–69, 70–81, 82–93, 94–105) and what TinySoundFont reads. - Units of the two coarse loop offsets. The summary table gives
startloopAddrsCoarseOffsetandendloopAddrsCoarseOffsetthe unit “smpls”, but their definitions count in 32768-point increments, like the other coarse offsets (their worked examples even refer to “startAddrsCoarseOffset” and “endAddrsCoarseOffset”). - Velocity. The summary table gives
velocitya minimum of 1 (a note-on velocity of zero is a note-off) and the definition says 0 to 127. - Decay with key number. The definitions of
keynumToModEnvDecayandkeynumToVolEnvDecayrepeat the text about the hold time. - Examples. The examples of
endAddrsCoarseOffset,startloopAddrsCoarseOffsetandendloopAddrsCoarseOffsetname the parameters of other generators (for instance “startAddrsOffset” and “startAddrsCoarseOffset” in the end example, “endAddrsCoarseOffset” in the endloop example); they plainly mean their own. - Modulation envelope example. The example of
modEnvToFilterFcsays 1000 rises one octave, where 1200 cents are an octave.
In the explorer
The Generators tab lists the 61 numbers with this information and counts how many preset and instrument zones use each. Every generator of a zone is decoded in the preset and instrument tables with its value in its unit: timecents become seconds, absolute cents of a frequency become hertz, centibels become decibels, 0.1% units become percent, key numbers get note names and sampleModes its loop meaning.
Source: SoundFont Technical Specification 2.04, sections 8.1.1 to 8.1.3 and 8.5. The numbers, names, units, ranges and defaults were compared with the specification text by scripts/sf2/check-tables.mjs.