<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="flsetsnap">
  <refmeta>
    <refentrytitle>FLsetsnap</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>FLsetsnap</refname>
    <refpurpose>
      Stores the current status of all FLTK valuators into a snapshot location.
      <indexterm id="IndexFlsetsnap"><primary>FLsetsnap</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>FLsetsnap</emphasis> stores the current status of all valuators present in the orchestra into a snapshot location (in memory).
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>inumsnap, inumval <command>FLsetsnap</command> index [, ifn]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>inumsnap</emphasis> -- current number of snapshots.
    </para>

    <para>
      <emphasis>inumval</emphasis> -- number of valuators (whose value is stored in a snapshot) present in current orchestra.
    </para>

    <para>
      <emphasis>index</emphasis> -- a number referring unequivocally to a snapshot. Several snapshots can be stored in the same bank.
    </para>

    <para>
      <emphasis>ifn</emphasis> (optional) -- optional argument referring to an already allocated table, to store values of a snapshot.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      The <emphasis>FLsetsnap</emphasis> opcode stores current status of all valuators present in the orchestra into a snapshot location (in memory). Any number of snapshots can be stored in the current bank. Banks are structures that only exist in memory, there are no other reference to them other that they can be accessed by <emphasis>FLsetsnap</emphasis>, <link linkend="flsavesnap"><citetitle>FLsavesnap</citetitle></link>, <link linkend="flloadsnap"><citetitle>FLloadsnap</citetitle></link> and <link linkend="flgetsnap"><citetitle>FLgetsnap</citetitle></link> opcodes. Only a single bank can be present in memory.
    </para>

    <para>
      If the optional <emphasis>ifn</emphasis> argument refers to an already allocated and valid table, the snapshot will be stored in the table instead of in the bank. So that table can be accessed from other Csound opcodes.
    </para>

    <para>
      The <emphasis>index</emphasis> argument unequivocally refers to a determinate snapshot. If the value of <emphasis>index</emphasis> refers to a previously stored snapshot, all its old values will be replaced with current ones. If <emphasis>index</emphasis> refers to a snapshot that doesn't exist, a new snapshot will be created. If the <emphasis>index</emphasis> value is not adjacent with that of a previously created snapshot, some empty snapshots will be created. For example, if a location with <emphasis>index</emphasis> 0 contains the only and unique snapshot present in a bank and the user stores a new snapshot using <emphasis>index</emphasis> 5, all locations between 1 and 4 will automatically contain empty snapshots. Empty snapshots don't contain any data and are neutral.
    </para>

    <para>
      <emphasis>FLsetsnap</emphasis> outputs the current number of snapshots (the <emphasis>inumsnap</emphasis> argument) and the total number of values stored in each snapshot (<emphasis>inumval</emphasis>). <emphasis>inumval</emphasis> is equal to the number of valuators present in the orchestra.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="flgetsnap"><citetitle>FLgetsnap</citetitle></link>,
      <link linkend="flloadsnap"><citetitle>FLloadsnap</citetitle></link>,
      <link linkend="flrun"><citetitle>FLrun</citetitle></link>,
      <link linkend="flsavesnap"><citetitle>FLsavesnap</citetitle></link>,
      <link linkend="flupdate"><citetitle>FLupdate</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Author: &namegabriel;</para>
    <para>New in version 4.22</para>
  </refsect1>
</refentry>
