<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="sfpreset">
  <refmeta>
    <refentrytitle>sfpreset</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>sfpreset</refname>
    <refpurpose>
      Assigns an existing preset of a SoundFont2 (SF2) sample file to an index number.
      <indexterm id="IndexSfpreset"><primary>sfpreset</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Assigns an existing preset of a previously loaded SoundFont2 (SF2) sample file to an index number. These opcodes allow management the sample-structure of SF2 files. 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 can be found in the <link linkend="MiscSf2"><citetitle>SoundFont2 File Format Appendix</citetitle></link>.
    </para>

    <para>
      <emphasis>sfpreset</emphasis> should be placed in the header section of a Csound orchestra.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ir <command>sfpreset</command> iprog, ibank, ifilhandle, ipreindex</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ir</emphasis> -- output to be used by other SF2 opcodes. For <emphasis>sfpreset</emphasis>, <emphasis>ir</emphasis> is <emphasis>ipreindex</emphasis>.
    </para>

    <para>
      <emphasis>iprog</emphasis> -- program number of a bank of presets in a SF2 file
    </para>

    <para>
      <emphasis>ibank</emphasis> -- number of a specific bank of a SF2 file
    </para>

    <para>
      <emphasis>ifilhandle</emphasis> -- unique number generated by <emphasis>sfload</emphasis> opcode to be used as an identifier for a SF2 file. Several SF2 files can be loaded and activated at the same time.
    </para>

    <para>
      <emphasis>ipreindex</emphasis> -- preset index
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>sfpreset</emphasis> assigns an existing preset of a previously loaded SF2 file to an index number, to be used later with the opcodes <emphasis>sfplay</emphasis> and <emphasis>sfplaym</emphasis>. The user must previously know the program and the bank numbers of the preset in order to fill the corresponding arguments. Any number of <emphasis>sfpreset</emphasis> instances can be placed in the header section of an orchestra, each one assigning a different preset belonging to the same (or different) SF2 file to different index numbers.
    </para>

    <para>
      These opcodes only support the sample structure of SF2 files. The modulator structure of the SoundFont2 format is not supported in Csound. Any modulation or processing to the sample data is left to the Csound user, bypassing all restrictions forced by the SF2 standard.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="sfilist"><citetitle>sfilist</citetitle></link>,
      <link linkend="sfinstr"><citetitle>sfinstr</citetitle></link>,
      <link linkend="sfinstrm"><citetitle>sfinstrm</citetitle></link>,
      <link linkend="sfload"><citetitle>sfload</citetitle></link>,
      <link linkend="sfpassign"><citetitle>sfpassign</citetitle></link>,
      <link linkend="sfplay"><citetitle>sfplay</citetitle></link>,
      <link linkend="sfplaym"><citetitle>sfplaym</citetitle></link>,
      <link linkend="sfplist"><citetitle>sfplist</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>May 2000</member>
      </simplelist>
    </para>

    <para>New in Csound Version 4.07</para>
  </refsect1>
</refentry>
