The phdr sub-chunk lists all presets in the file. It is always a multiple of 38 bytes and holds a minimum of two records: one for each preset and one terminal record (spec 7.2). A preset is “a keyboard full of sound”: typically the samples and articulation data of one MIDI preset number (spec 2.1).
The record
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0 | 20 | achPresetName | CHAR[20] | The name of the preset in ASCII, unused terminal characters zero. Names are case sensitive |
| 20 | 2 | wPreset | WORD | The MIDI preset number |
| 22 | 2 | wBank | WORD | The MIDI bank number |
| 24 | 2 | wPresetBagNdx | WORD | The index of the preset’s first zone in the pbag sub-chunk |
| 26 | 4 | dwLibrary | DWORD | Reserved for a preset library management function |
| 30 | 4 | dwGenre | DWORD | Reserved for a preset library management function |
| 34 | 4 | dwMorphology | DWORD | Reserved for a preset library management function |
(Spec 4.4 and 7.2.)
Rules
- Names. A unique name should be given to each preset. A bank read with identical names must not have presets discarded: they are preserved as read or, preferably, renamed.
- Bank and preset. The presets are not ordered. They should have a unique pair of
wPresetandwBank; if two have the same pair, the first in the chunk is the active preset and the others are kept so they can be renumbered later. The General MIDI percussion bank is conventionally bank 128. A value other than 0 to 127 (or 128 for the bank) makes the preset unplayable, but it is kept. - The bag index.
wPresetBagNdxincreases monotonically with the preset headers, because the zones are in the same order. The size ofpbagin bytes is four times the terminal preset’swPresetBagNdxplus four. If the indexes are not monotonic or the terminal’s index does not match the size ofpbag, the file is structurally defective and should be rejected at load time. Every preset except the terminal must have at least one zone; a preset with none is ignored. - Reserved fields.
dwLibrary,dwGenreanddwMorphologyare preserved as read and created as zero. - The terminal record. It is never accessed and exists only to give a terminal bag index, from which the number of zones of the last preset follows. All its other values are conventionally zero, and its name may optionally be “EOP”, end of presets.
- Rejection. If the sub-chunk is missing, has fewer than two records, or is not a multiple of 38 bytes, the file is rejected as structurally unsound.
(Spec 7.2.)
In the explorer
The tables of the SoundFont tab list each preset with its name, bank, program, zone count, instruments and key span; the Show button opens its zones, generators and modulators (see hierarchy). The explorer reports a table that is too short or not a whole number of records, bag indexes that go down or end differently from the size of pbag, a preset with no zones, names that are duplicated or have bytes after the zero, a preset number above 127, a bank above 128, two presets with the same bank and preset (the first is active), and non-zero reserved fields.
Source: SoundFont Technical Specification 2.04, sections 2.1, 4.4 and 7.2.