<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>sndload</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="sliderKawai.html" title="sliderKawai" /> <link rel="next" href="sndloop.html" title="sndloop" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">sndload</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="sliderKawai.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="sndloop.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="sndload"> <a id="sndload"></a> <div class="titlepage"></div> <a id="IndexSndload" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">sndload</span> </h2> <p>sndload — Loads a sound file into memory for use by <a class="link" href="loscilx.html" title="loscilx"><em class="citetitle">loscilx</em></a> </p> </div> <div class="refsect1" title="Description"> <a id="idp43960240"></a> <h2>Description</h2> <p> <span class="emphasis"><em>sndload</em></span> loads a sound file into memory for use by <a class="link" href="loscilx.html" title="loscilx"><em class="citetitle">loscilx</em></a>. </p> </div> <div class="refsect1" title="Syntax"> <a id="idp43970952"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>sndload</strong></span> Sfname[, ifmt[, ichns[, isr[, ibas[, iamp[, istrt \ [, ilpmod[, ilps[, ilpe]]]]]]]]]</pre> </div> <div class="refsect1" title="Initialization"> <a id="idp43972072"></a> <h2>Initialization</h2> <p><span class="emphasis"><em>Sfname</em></span> - file name as a string constant or variable, string p-field, or a number that is used either as an index to strings set with strset, or, if that is not available, a fine name in the format soundin.n is used. If the file name does not include a full path, the file is searched in the current directory first, then those specified by <a class="link" href="CommandEnvironment.html" title="Csound Environment Variables"><em class="citetitle">SSDIR</em></a> (if defined), and finally <a class="link" href="CommandEnvironment.html" title="Csound Environment Variables"><em class="citetitle">SFDIR</em></a>. If the same file was already loaded previously, it will not be read again, but the parameters ibas, iamp, istrt, ilpmod, ilps, and ilpe are still updated. </p> <p> <span class="emphasis"><em>ifmt </em></span>(optional, defaults to zero) - default sample format for raw (headerless) sound files; if the file has a header, this is ignored. Can be one of the following: </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>-1: do not allow headerless files (fail with an init error)</td> </tr> <tr> <td>0: use the same format as the one specified on the command line</td> </tr> <tr> <td>1: 8 bit signed integers</td> </tr> <tr> <td>2: a-law</td> </tr> <tr> <td>3: u-law</td> </tr> <tr> <td>4: 16 bit signed integers</td> </tr> <tr> <td>5: 32 bit signed integers</td> </tr> <tr> <td>6: 32 bit floats</td> </tr> <tr> <td>7: 8 bit unsigned integers</td> </tr> <tr> <td>8: 24 bit signed integers</td> </tr> <tr> <td>9: 64 bit floats</td> </tr> </table> <p> </p> <p> <span class="emphasis"><em>ichns</em></span> (optional, defaults to zero) - default number of channels for raw (headerless) sound files; if the file has a header, this is ignored. Zero or negative values are interpreted as 1 channel. </p> <p> <span class="emphasis"><em>isr</em></span> (optional, defaults to zero) - default sample rate for raw (headerless) sound files; if the file has a header, this is ignored. Zero or negative values are interpreted as the orchestra sample rate (sr). </p> <p> <span class="emphasis"><em>ibas</em></span> (optional, defaults to zero) - base frequency in Hz. If positive, overrides the value specified in the sound file header; otherwise, the value from the header is used if present, and 1.0 if the file does not include such information. </p> <p> <span class="emphasis"><em>iamp</em></span> (optional, defaults to zero) - amplitude scale. If non-zero, overrides the value specified in the sound file header (note: negative values are allowed, and will invert the sound output); otherwise, the value from the header is used if present, and 1.0 if the file does not include such information. </p> <p> <span class="emphasis"><em>istrt</em></span> (optional, defaults to -1) - starting position in sample frames, can be fractional. If non-negative, overrides the value specified in the sound file header; otherwise, the value from the header is used if present, and 0 if the file does not include such information. Note: even if this parameter is specified, the whole file is still read into memory. </p> <p> <span class="emphasis"><em>ilpmod</em></span> (optional, defaults to -1) - loop mode, can be one of the following: </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>any negative value: use the loop information specified in the sound file header, ignoring ilps and ilpe</td> </tr> <tr> <td>0: no looping (ilps and ilpe are ignored)</td> </tr> <tr> <td>1: forward looping (wrap around loop end if it is crossed in forward direction, and wrap around loop start if it is crossed in backward direction)</td> </tr> <tr> <td>2: backward looping (change direction at loop end if it is crossed in forward direction, and wrap around loop start if it is crossed in backward direction)</td> </tr> <tr> <td>3: forward-backward looping (change direction at both loop points if they are crossed as described above)</td> </tr> </table> <p> </p> <p> <span class="emphasis"><em>ilps</em></span> (optional, defaults to 0) - loop start in sample frames (fractional values are allowed), or loop end if ilps is greater than ilpe. Ignored unless ilpmod is set to 1, 2, or 3. If the loop points are equal, the whole sample is looped. </p> <p> <span class="emphasis"><em>ilpe</em></span> (optional, defaults to 0) - loop end in sample frames (fractional values are allowed), or loop start if ilps is greater than ilpe. Ignored unless ilpmod is set to 1, 2, or 3. If the loop points are equal, the whole sample is looped. </p> </div> <div class="refsect1" title="Credits"> <a id="idp44020264"></a> <h2>Credits</h2> <p>Written by Istvan Varga.</p> <p>2006</p> <p>New in Csound 5.03</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="sliderKawai.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="sndloop.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">sliderKawai </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> sndloop</td> </tr> </table> </div> </body> </html>