<!-- Converted to DocBook/SGML by Kevin Conder -->
<appendix id="MiscSf2">
  <title>SoundFont2 File Format</title>

  <para>
    Beginning with Csound Version 4.07, <link linkend="sfload"><citetitle>Csound supports the SoundFont2 sample file format</citetitle></link>. SoundFont2 (or SF2) is a widespread standard which allows encoding banks of wavetable-based sounds into a binary file. In order to understand the usage of these opcodes, the user must have some knowledge of the SF2 format, so a brief description of this format follows.
  </para>

  <para>
    The SF2 format is made by generator and modulator objects. All current Csound opcodes regarding SF2 support the generator function only.
  </para>

  <para>
    There are several levels of generators having a hierarchical structure. The most basic kind of generator object is a sample. Samples may or may not be be looped, and are associated with a MIDI note number, called the base-key. When a sample is associated with a range of MIDI note numbers, a range of velocities, a transposition (coarse and fine tuning), a scale tuning, and a level scaling factor, the sample and its associations make up a <quote>split.</quote> A set of splits, together with a name, make up an <quote>instrument.</quote> When an instrument is associated with a key range, a velocity range, a level scaling factor, and a transposition, the instrument and its associations make up a <quote>layer.</quote> A set of layers, together with a name, makes up a <quote>preset.</quote> Presets are normally the final sound-generating structures ready for the user. They generate sound according to the settings of their lower-level components.
  </para>

  <para>
    Both sample data and structure data is embedded in the same SF2 binary file. A single SF2 file can contain up to a maximum of 128 banks of 128 preset programs, for a total of 16384 presets in one SF2 file. The maximum number of layers, instruments, splits, and samples is not defined, and probably is only limited by the computer's memory.
  </para>
</appendix>
