The pmod sub-chunk lists the modulators of every preset zone and imod those of every instrument zone. Each is always a multiple of ten bytes long and holds zero or more modulators plus a terminal record (spec 7.4, 7.8). A modulator routes a real-time source, such as a MIDI controller, to a generator; the modulators page explains the sources, transforms and default modulators. Modulators were added in specification 2.01: in 2.00 these sub-chunks always consist of ten zero bytes.
The record
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0 | 2 | sfModSrcOper | SFModulator | The source of data for the modulator |
| 2 | 2 | sfModDestOper | SFGenerator | The destination: a generator, or (top bit set) a link to the source of another modulator |
| 4 | 2 | modAmount | SHORT | The signed degree to which the source modulates the destination; zero means no fixed amount |
| 6 | 2 | sfModAmtSrcOper | SFModulator | A second source that controls the degree to which the first modulates the destination |
| 8 | 2 | sfModTransOper | SFTransform | A transform applied to the source before it reaches the destination |
The record is sfModList in pmod and sfInstModList in imod; each enumeration is two bytes long (spec 4.4, 7.4, 7.8).
Rules
- A zone’s
wModNdxpoints to its first modulator; their number is the next zone’s index minus this one’s (a difference of zero: none). - Unknown values. An unknown or undefined source, destination, amount source or transform makes the modulator ignored. A modulator whose source is “link” with no other modulator linked to it is ignored; one whose amount source is “link” is ignored.
- Links. A destination with the top bit set is not a generator: the other 15 bits are the index of the modulator whose source receives this one’s output, relative to the first modulator of the zone. A link to an index beyond the number of modulators of the zone is ignored; modulators that are part of a circular link are ignored.
- Uniqueness. A modulator is defined by its source, destination and amount source. Within a zone these must be unique: if a later modulator has the same three, the first is ignored.
- Absolute and relative. Modulators in
imodare absolute: one replaces a default modulator, but its effect on its generator is additive. Modulators inpmodare additively relative to those ofimod: one can increase or decrease the amount of an instrument modulator. - The terminal record is conventionally all zero and is always ignored.
- If the sub-chunk is missing or its size is not a multiple of ten bytes, the file should be rejected as structurally unsound.
(Spec 7.4, 7.8.)
In the explorer
Each modulator appears in the Modulators table of its preset or instrument and in the Modulators tab, with its source decoded into controller, curve, direction and polarity, its destination (a generator name or a link), its amount, amount source and transform, and a status: used, or ignored with the reason (an unknown source or transform, an illegal MIDI controller, a link past the list, a circle of links, a link source with nothing linked to it, a link as amount source, a destination that is not a value generator, or a later modulator that replaces it).
Source: SoundFont Technical Specification 2.04, sections 4.4, 7.4, 7.8 and 9.5.4.