<?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>flooper2</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <link rel="stylesheet" type="text/css" href="syntax-highlighting.css" /> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /> <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="flooper.html" title="flooper" /> <link rel="next" href="floor.html" title="floor" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">flooper2</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="flooper.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="floor.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="flooper2"></a> <div class="titlepage"></div> <a id="Indexflooper2" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">flooper2</span> </h2> <p>flooper2 — Function-table-based crossfading looper. </p> </div> <div class="refsect1"> <a id="idm281472935279288"></a> <h2>Description</h2> <p> This opcode implements a crossfading looper with variable loop parameters and three looping modes, optionally using a table for its crossfade shape. It accepts non-power-of-two tables for its source sounds, such as deferred-allocation GEN01 tables, with one or two channels. </p> </div> <div class="refsect1"> <a id="idm281472935277800"></a> <h2>Syntax</h2> <pre class="synopsis">asig1[,asig2] <span class="command"><strong>flooper2</strong></span> kamp, kpitch, kloopstart, kloopend, kcrossfade, ifn \ [, istart, imode, ifenv, iskip]</pre> </div> <div class="refsect1"> <a id="idm281472935206216"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>ifn </em></span> -- sound source function table number, generally created using GEN01 </p> <p> <span class="emphasis"><em>istart </em></span> -- playback start pos in seconds </p> <p> <span class="emphasis"><em>imode </em></span> -- loop modes: 0 forward, 1 backward, 2 back-and-forth [def: 0] </p> <p> <span class="emphasis"><em>ifenv </em></span> -- if non-zero, crossfade envelope shape table number. The default, 0, sets the crossfade to linear. </p> <p> <span class="emphasis"><em>iskip </em></span> -- if 1, the opcode initialisation is skipped, for tied notes, performance continues from the position in the loop where the previous note stopped. The default, 0, does not skip initialisation </p> </div> <div class="refsect1"> <a id="idm281472935201128"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>asig1[, asig2]</em></span> -- output sig (mono or stereo). </p> <p> <span class="emphasis"><em>kamp</em></span> -- amplitude control </p> <p> <span class="emphasis"><em>kpitch</em></span> -- pitch control (transposition ratio); negative values are not allowed. </p> <p> <span class="emphasis"><em>kloopstart</em></span> -- loop start point (secs). Note that although k-rate, loop parameters such as this are only updated once per loop cycle. </p> <p> <span class="emphasis"><em>kloopend</em></span> -- loop end point (secs), updated once per loop cycle. </p> <p> <span class="emphasis"><em>kcrossfade </em></span> -- crossfade length (secs), updated once per loop cycle and limited to loop length.</p> <p> Mode 1 for <span class="emphasis"><em>imode </em></span> will only loop backwards from the end point to the start point. </p> </div> <div class="refsect1"> <a id="idm281472935194120"></a> <h2>Examples</h2> <p> </p> <div class="example"> <a id="idm281472935193192"></a> <p class="title"> <strong>Example 296. </strong> </p> <div class="example-contents"> <pre class="programlisting"> aout <span class="opc">flooper2</span> 16000, 1, 1, 5, 0.05, 1 <span class="comment">; loop starts at 1 sec, for 4 secs, 0.05 crossfade</span> <span class="opc">out</span> aout</pre> </div> </div> <p><br class="example-break" /> </p> <p> The example above shows the basic operation of <span class="emphasis"><em>flooper2</em></span>. Pitch can be controlled at the k-rate, as well as amplitude and loop parameters. The example assumes table 1 to contain at least 5.05 seconds of audio (4 secs loop duration, starting 1 sec into the table, using 0.05 secs after the loop end for the crossfade). Looping is in mode 0 (normal forward loop). </p> <p> Here is another example of the flooper2 opcode. It uses the file <a class="ulink" href="examples/flooper2.csd" target="_top"><em class="citetitle">flooper2.csd</em></a> and <a class="ulink" href="examples/fox.wav" target="_top"><em class="citetitle">fox.wav</em></a>. </p> <div class="example"> <a id="idm281472935186680"></a> <p class="title"> <strong>Example 297. </strong> </p> <div class="example-contents"> <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p> <div class="refsect1"> <a id="idm281472767862568"></a> <pre class="programlisting"> <span class="nt"><CsoundSynthesizer></span> <span class="nt"><CsOptions></span> <span class="c1">; Select audio/midi flags here according to platform</span> -odac <span class="c1">;;;realtime audio out</span> <span class="c1">;-iadc ;;;uncomment -iadc if realtime audio input is needed too</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o flooper2.wav -W ;;; for file output any platform</span> <span class="nt"></CsOptions></span> <span class="nt"><CsInstruments></span> <span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span> <span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">32</span> <span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">2</span> <span class="vg">0dbfs</span> <span class="o">=</span> <span class="mi">1</span> <span class="kd">instr</span> <span class="nf">1</span> <span class="c1">; looping back and forth, 0.05 crossfade </span> k<span class="n">st</span> <span class="nb">line</span> <span class="mf">.2</span><span class="p">,</span> <span class="nb">p3</span><span class="p">,</span> <span class="mi">2</span> <span class="c1">;vary loopstartpoint</span> a<span class="n">out</span> <span class="nb">flooper2</span> <span class="mf">.8</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> k<span class="n">st</span><span class="p">,</span> <span class="mf">0.05</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span> <span class="nb">outs</span> a<span class="n">out</span><span class="p">,</span> a<span class="n">out</span> <span class="kd">endin</span> <span class="nt"></CsInstruments></span> <span class="nt"><CsScore></span> <span class="c1">; Its table size is deferred,</span> <span class="c1">; and format taken from the soundfile header</span> <span class="nb">f</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">1</span> <span class="s">"fox.wav"</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">12</span> <span class="nb">e</span> <span class="nt"></CsScore></span> <span class="nt"></CsoundSynthesizer></span> </pre> </div> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1"> <a id="idm281472935182824"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Victor Lazzarini</td> </tr> <tr> <td>July 2006 </td> </tr> </table> <p> </p> <p>New plugin in version 5</p> <p>July 2006.</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="flooper.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="floor.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">flooper </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> floor</td> </tr> </table> </div> </body> </html>