<?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>vdelayxq</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="vdelayx.html" title="vdelayx" /> <link rel="next" href="vdelayxs.html" title="vdelayxs" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">vdelayxq</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="vdelayx.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="vdelayxs.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="vdelayxq"></a> <div class="titlepage"></div> <a id="IndexVdelayxq" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">vdelayxq</span> </h2> <p>vdelayxq — A 4-channel variable delay opcode with high quality interpolation. </p> </div> <div class="refsect1"> <a id="idm281472873829256"></a> <h2>Description</h2> <p> A 4-channel variable delay opcode with high quality interpolation. </p> </div> <div class="refsect1"> <a id="idm281472873761080"></a> <h2>Syntax</h2> <pre class="synopsis">aout1, aout2, aout3, aout4 <span class="command"><strong>vdelayxq</strong></span> ain1, ain2, ain3, ain4, adl, imd, iws [, ist]</pre> </div> <div class="refsect1"> <a id="idm281472873758888"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>imd</em></span> -- max. delay time (seconds) </p> <p> <span class="emphasis"><em>iws</em></span> -- interpolation window size (see below) </p> <p> <span class="emphasis"><em>ist</em></span> (optional) -- skip initialization if not zero </p> </div> <div class="refsect1"> <a id="idm281472873755608"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>aout1, aout2, aout3, aout4</em></span> -- output audio signals. </p> <p> <span class="emphasis"><em>ain1, ain2, ain3, ain4</em></span> -- input audio signals. </p> <p> <span class="emphasis"><em>adl</em></span> -- delay time in seconds </p> <p> This opcode uses high quality (and slow) interpolation, that is much more accurate than the currently available linear and cubic interpolation. The <span class="emphasis"><em>iws</em></span> parameter sets the number of input samples used for calculating one output sample (allowed values are any integer multiply of 4 in the range 4 - 1024); higher values mean better quality and slower speed. </p> <p> The multichannel opcodes (eg. <span class="emphasis"><em>vdelayxq</em></span>) allow delaying 2 or 4 variables at once (stereo or quad signals); this is much more efficient than using separate opcodes for each channel. </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <table border="0" summary="Note: Notes"> <tr> <td rowspan="2" align="center" valign="top" width="25"> <img alt="[Note]" src="images/note.png" /> </td> <th align="left">Notes</th> </tr> <tr> <td align="left" valign="top"> <p> </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p>Delay time is measured in seconds (unlike in vdelay and vdelay3), and must be a-rate.</p> </li> <li class="listitem"> <p>The minimum allowed delay is iws/2 samples.</p> </li> <li class="listitem"> <p>Using the same variables as input and output is allowed in these opcodes.</p> </li> <li class="listitem"> <p>In vdelayxw*, changing the delay time has some effects on output volume: </p> <div class="literallayout"> <p>a = 1 / (1 + dt)</p> </div> <p> where a is the output gain, and dt is the change of delay time per seconds.</p> </li> <li class="listitem"> <p>These opcodes are best used in the double-precision version of Csound.</p> </li> </ul> </div> <p> </p> </td> </tr> </table> </div> </div> <div class="refsect1"> <a id="idm281472873744568"></a> <h2>Examples</h2> <p> Here is an example of the vdelayxq opcode. It uses the file <a class="ulink" href="examples/vdelayxq.csd" target="_top"><em class="citetitle">vdelayxq.csd</em></a>. </p> <div class="example"> <a id="idm281472873742712"></a> <p class="title"> <strong>Example 1070. Example of the vdelayxq opcode.</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="idm281472694023512"></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 vdelayxq.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">4</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> i<span class="n">ms</span> <span class="o">=</span> <span class="mf">.5</span> <span class="c1">;maximum delay time in seconds</span> i<span class="n">ws</span> <span class="o">=</span> <span class="mi">1024</span> <span class="c1">;window size</span> a<span class="n">dl</span> <span class="o">=</span> <span class="mf">.5</span> a<span class="n">out1</span> <span class="nb">diskin2</span> <span class="s">"beats.wav"</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">1</span> <span class="c1">;loop beats.wav</span> a<span class="n">out2</span> <span class="nb">diskin2</span> <span class="s">"fox.wav"</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">1</span> <span class="c1">;loop fox.wav</span> a<span class="n">out3</span> <span class="nb">diskin2</span> <span class="s">"Church.wav"</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">1</span> <span class="c1">;loop Church.wav</span> a<span class="n">out4</span> <span class="nb">diskin2</span> <span class="s">"flute.aiff"</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">1</span> <span class="c1">;loop flute.aiff</span> a<span class="n">2</span> <span class="nb">poscil</span> <span class="mf">.1</span><span class="p">,</span> <span class="mf">.5</span><span class="p">,</span> <span class="mi">1</span> <span class="c1">;make an LFO, 1 cycle per 2 seconds</span> a<span class="n">dl</span> <span class="o">=</span> a<span class="n">2</span> <span class="o">+</span> i<span class="n">ms</span><span class="o">/</span><span class="mi">2</span> <span class="c1">;offset the LFO so that it is positive</span> a<span class="n">out1</span><span class="p">,</span> a<span class="n">out2</span><span class="p">,</span> a<span class="n">out3</span><span class="p">,</span> a<span class="n">out4</span> <span class="nb">vdelayxq</span> a<span class="n">out1</span><span class="p">,</span> a<span class="n">out2</span><span class="p">,</span> a<span class="n">out3</span><span class="p">,</span> a<span class="n">out4</span><span class="p">,</span> a<span class="n">dl</span><span class="p">,</span> i<span class="n">ms</span><span class="p">,</span> i<span class="n">ws</span><span class="c1">; Use the LFO to control delay time</span> <span class="nb">outq</span> a<span class="n">out1</span><span class="p">,</span> a<span class="n">out2</span><span class="p">,</span> a<span class="n">out3</span><span class="p">,</span> a<span class="n">out4</span> <span class="kd">endin</span> <span class="nt"></CsInstruments></span> <span class="nt"><CsScore></span> <span class="nb">f</span><span class="mi">1</span> <span class="mi">0</span> <span class="mi">8192</span> <span class="mi">10</span> <span class="mi">1</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">10</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" /> Two important points here. First, the delay time must be always positive. And second, even though the delay time can be controlled in k-rate, it is not advised to do so, since sudden time changes will create clicks. </p> </div> <div class="refsect1"> <a id="idm281472873738184"></a> <h2>See Also</h2> <p> <a class="link" href="vdelayx.html" title="vdelayx"><em class="citetitle">vdelayx</em></a>, <a class="link" href="vdelayxs.html" title="vdelayxs"><em class="citetitle">vdelayxs</em></a>, <a class="link" href="vdelayxw.html" title="vdelayxw"><em class="citetitle">vdelayxw</em></a>, <a class="link" href="vdelayxwq.html" title="vdelayxwq"><em class="citetitle">vdelayxwq</em></a>, <a class="link" href="vdelayxws.html" title="vdelayxws"><em class="citetitle">vdelayxws</em></a> </p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="vdelayx.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="vdelayxs.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">vdelayx </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> vdelayxs</td> </tr> </table> </div> </body> </html>