The sdta list holds a single optional smpl sub-chunk with all the RAM-based sound data of the bank, and, since version 2.04, an optional sm24 sub-chunk. The smpl chunk is of arbitrary length and holds an even number of bytes (spec 6). The sample headers say where each sample lies inside it.
The smpl chunk
The chunk holds one or more samples as linearly coded, signed, little-endian 16-bit words. Each sample is followed by at least forty-six zero-valued sample data points, which guarantee that any reasonable upward pitch shift with any reasonable interpolator can loop on zero data at the end of the sound (spec 6.1). The chunk is optional: a bank whose samples are all in ROM has none.
| Offset in the data | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 × points | sample data points | SHORT values, −32,768 to 32,767, the samples one after another with at least 46 zero points after each |
The sm24 chunk
The chunk holds the least significant byte counterpart of each data point of smpl: for every two bytes of smpl there is one byte of sm24. The two are combined to give one pool of samples with up to 24 bits of resolution (spec 6.2). The 16-bit word of smpl is the upper 16 bits and the byte of sm24 the lower 8, so the 24-bit value is word × 256 + byte as a signed number (spec 4.2: the upper 16 bits in smpl, the lower 8 bits in sm24).
The chunk is ignored, and only the 16-bit samples are rendered, when (spec 6.2):
- the
smplchunk is not present; - the
ifilversion is less than 2.04; - its size is not exactly half the size of
smpl, plus one byte when half the size is odd (so that the chunk is aligned to 16 bits).
Looping rules
The loop points of a sample are in its sample header. They are “equivalent points”: two data points that are logically the same, spliced atop one another when the sound loops. The loop end point is never actually played; the loop start point follows the point just before the loop end (spec 6.3).
- The interpolation of wavetable synthesisers means that data around both loop points affects the sound, so both must be surrounded by continuous audio data. Even a sound that loops through its whole decay needs sample data points beyond the loop end, typically identical to the data at the start of the loop.
- A minimum of eight valid data points must be present before the loop start and after the loop end.
- The eight data points (four on each side) around the two equivalent loop points should be forced to be identical, so that every interpolation algorithm reproduces an artifact-free loop.
- A sample has a minimum length of 48 data points and a loop a minimum of 32 (spec 7.10).
In the explorer
The Samples tab opens the waveform of each sample: 16-bit from smpl, or 24-bit when sm24 is present and valid, played at the sample’s own rate, and the same sample with its header loop repeated for about four seconds. Clicking the waveform selects the smpl bytes of that data point and, for a 24-bit sample, its sm24 byte; a byte picked in either chunk moves the playhead to its frame. The explorer checks that each sample is followed by 46 zero points, that its loop and length meet the minimums above and that the sm24 chunk has the right size and version, and reports an sm24 chunk it ignores.
Source: SoundFont Technical Specification 2.04, sections 4.2, 6 (6.1 to 6.3) and 7.10.