A zone is an object (a preset or an instrument) with its articulation data, defined to play over certain key numbers and velocities. Two sub-chunks list the zones, pbag for presets and ibag for instruments. Each is always a multiple of four bytes long and holds one record for each zone plus one for a terminal zone (spec 7.3 and 7.7). “Bag” is the specification’s word for a list of zones (spec 2.1).
The record
| Offset | Size | pbag field | ibag field | Meaning |
|---|---|---|---|---|
| 0 | 2 | wGenNdx | wInstGenNdx | The index of the zone’s first generator in pgen or igen |
| 2 | 2 | wModNdx | wInstModNdx | The index of the zone’s first modulator in pmod or imod |
(Spec 4.4, 7.3 and 7.7.)
Finding the zones of an object
The first zone of a preset is at the preset’s wPresetBagNdx in pbag; the number of zones is the next preset’s wPresetBagNdx minus this one’s. The same holds for an instrument’s wInstBagNdx in ibag. The generators and modulators of a zone run from its indexes up to the next zone’s: a difference of zero in the modulator index means the zone has no modulators (spec 7.3, 7.4, 7.7, 7.8).
The indexes increase monotonically with the zones, because the generator and modulator lists are in the same order. The size of the modulator table in bytes is ten times the terminal zone’s modulator index plus ten, and the size of the generator table is four times the terminal zone’s generator index plus four. If an index is not monotonic or does not match the size of the table, the file is structurally defective and should be rejected at load time (spec 7.3, 7.7).
Global zones and ignored zones
- If a preset has more than one zone, its first zone may be a global zone: one whose last generator is not an instrument generator (for an instrument: not a sampleID generator). Its generators and modulators apply to all the other zones of the object (spec 2.1, 7.3, 7.7).
- Every generator list must contain at least one generator, with one exception: a global zone may hold modulators only. The modulator lists may hold zero or more modulators.
- A zone other than the first that does not end with an instrument generator (instrument zones: a sampleID generator) is ignored. A global zone with no modulators and no generators is also ignored.
- The pbag or ibag sub-chunk missing, or its size not a multiple of four, makes the file structurally unsound.
(Spec 7.3, 7.7.)
In the explorer
The zones of a preset or instrument are in the table that Show opens: zone number, whether it is a zone, a global zone or an ignored zone (with the reason), its key and velocity ranges, the instrument or sample it uses, and how many generators and modulators it has; for an instrument zone also the sample points it plays after the address-offset generators. The explorer reports bag indexes that go down and terminals that do not match the generator and modulator tables, and every ignored zone, global zone with nothing in it, and generator that follows the terminal generator.
Source: SoundFont Technical Specification 2.04, sections 2.1, 4.4, 7.3 and 7.7.