<?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>deltapxw</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="deltapx.html" title="deltapx" /> <link rel="next" href="denorm.html" title="denorm" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">deltapxw</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="deltapx.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="denorm.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="deltapxw"></a> <div class="titlepage"></div> <a id="IndexDeltapxw" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">deltapxw</span> </h2> <p>deltapxw — Mixes the input signal to a delay line. </p> </div> <div class="refsect1"> <a id="idm281472941909736"></a> <h2>Description</h2> <p> <span class="emphasis"><em>deltapxw</em></span> mixes the input signal to a delay line. This opcode can be mixed with reading units (<a class="link" href="deltap.html" title="deltap"><em class="citetitle">deltap</em></a>, <a class="link" href="deltapn.html" title="deltapn"><em class="citetitle">deltapn</em></a>, <a class="link" href="deltapi.html" title="deltapi"><em class="citetitle">deltapi</em></a>, <a class="link" href="deltap3.html" title="deltap3"><em class="citetitle">deltap3</em></a>, and <a class="link" href="deltapx.html" title="deltapx"><em class="citetitle">deltapx</em></a>) in any order; the actual delay time is the difference of the read and write time. This opcode can read from and write to a <a class="link" href="delayr.html" title="delayr"><em class="citetitle">delayr</em></a>/<a class="link" href="delayw.html" title="delayw"><em class="citetitle">delayw</em></a> delay line with interpolation. </p> </div> <div class="refsect1"> <a id="idm281472941860376"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>deltapxw</strong></span> ain, adel, iwsize</pre> </div> <div class="refsect1"> <a id="idm281472941858328"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>iwsize</em></span> -- interpolation window size in samples. Allowed values are integer multiplies of 4 in the range 4 to 1024. <span class="emphasis"><em>iwsize</em></span> = 4 uses cubic interpolation. Increasing <span class="emphasis"><em>iwsize</em></span> improves sound quality at the expense of CPU usage, and minimum delay time. </p> </div> <div class="refsect1"> <a id="idm281472941855608"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>ain</em></span> -- Input signal. </p> <p> <span class="emphasis"><em>adel</em></span> -- Delay time in seconds. </p> <p> </p> <div class="informalexample"> <pre class="programlisting"> a1 <span class="opc">delayr</span> idlr <span class="opc">deltapxw</span> a2, adl1, iws1 a3 <span class="opc">deltapx</span> adl2, iws2 <span class="opc">deltapxw</span> a4, adl3, iws3 <span class="opc">delayw</span> a5</pre> </div> <p> </p> <p> Minimum and maximum delay times: </p> <div class="informalexample"> <pre class="programlisting"> idlr >= 1/kr Delay line length adl1 >= (iws1/2)/sr Write before read adl1 <= idlr - (1 + iws1/2)/sr (allows shorter delays) adl2 >= 1/kr + (iws2/2)/sr Read time adl2 <= idlr - (1 + iws2/2)/sr adl2 >= adl1 + (iws1 + iws2) / (2*sr) adl2 >= 1/kr + adl3 + (iws2 + iws3) / (2*sr) adl3 >= (iws3/2)/sr Write after read adl3 <= idlr - (1 + iws3/2)/sr (allows feedback) </pre> </div> <p> </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <table border="0" summary="Note: Note"> <tr> <td rowspan="2" align="center" valign="top" width="25"> <img alt="[Note]" src="images/note.png" /> </td> <th align="left">Note</th> </tr> <tr> <td align="left" valign="top"> <p> Window sizes for opcodes other than <span class="emphasis"><em>deltapx</em></span> are: <span class="emphasis"><em>deltap</em></span>, <span class="emphasis"><em>deltapn</em></span>: 1, <span class="emphasis"><em>deltapi</em></span>: 2 (linear), <span class="emphasis"><em>deltap3</em></span>: 4 (cubic) </p> </td> </tr> </table> </div> </div> <div class="refsect1"> <a id="idm281472941842232"></a> <h2>Examples</h2> <p> Here is an example of the deltapxw opcode. It uses the file <a class="ulink" href="examples/deltapxw.csd" target="_top"><em class="citetitle">deltapxw.csd</em></a>. </p> <div class="example"> <a id="idm281472941840456"></a> <p class="title"> <strong>Example 207. Example of the deltapxw 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="idm281472774763432"></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">;;;RT audio out</span> <span class="c1">;-iadc ;;;uncomment -iadc if RT audio input is needed too</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o deltapxw.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> a<span class="n">1</span> <span class="nb">phasor</span> <span class="mi">300</span> a<span class="n">1</span> <span class="o">=</span> a<span class="n">1</span> <span class="o">-</span> <span class="mf">0.5</span> a<span class="n">_</span> <span class="nb">delayr</span> <span class="mi">1</span> a<span class="n">del</span> <span class="nb">phasor</span> <span class="mi">4</span> a<span class="n">del</span> <span class="o">=</span> <span class="nb">sin</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="mf">3.14159265</span> <span class="o">*</span> a<span class="n">del</span><span class="p">)</span> <span class="o">*</span> <span class="mf">0.01</span> <span class="o">+</span> <span class="mf">0.2</span> <span class="nb">deltapxw</span> a<span class="n">1</span><span class="p">,</span> a<span class="n">del</span><span class="p">,</span> <span class="mi">32</span> a<span class="n">del</span> <span class="nb">phasor</span> <span class="mi">2</span> a<span class="n">del</span> <span class="o">=</span> <span class="nb">sin</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="mf">3.14159265</span> <span class="o">*</span> a<span class="n">del</span><span class="p">)</span> <span class="o">*</span> <span class="mf">0.01</span> <span class="o">+</span> <span class="mf">0.2</span> <span class="nb">deltapxw</span> a<span class="n">1</span><span class="p">,</span> a<span class="n">del</span><span class="p">,</span> <span class="mi">32</span> a<span class="n">del</span> <span class="o">=</span> <span class="mf">0.3</span> a<span class="n">2</span> <span class="nb">deltapx</span> a<span class="n">del</span><span class="p">,</span> <span class="mi">32</span> a<span class="n">1</span> <span class="o">=</span> <span class="mi">0</span> <span class="nb">delayw</span> a<span class="n">1</span> <span class="nb">outs</span> a<span class="n">2</span><span class="o">*</span><span class="mf">.7</span><span class="p">,</span> a<span class="n">2</span><span class="o">*</span><span class="mf">.7</span> <span class="kd">endin</span> <span class="nt"></CsInstruments></span> <span class="nt"><CsScore></span> <span class="nb">i</span><span class="mi">1</span> <span class="mi">0</span> <span class="mi">5</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="idm281472941836168"></a> <h2>See Also</h2> <p> <a class="link" href="deltapx.html" title="deltapx"><em class="citetitle">deltapx</em></a> </p> </div> <div class="refsect1"> <a id="idm281472941834120"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Istvan Varga</td> </tr> <tr> <td>August 2001</td> </tr> </table> <p> </p> <p>New in version 4.13</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="deltapx.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="denorm.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">deltapx </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> denorm</td> </tr> </table> </div> </body> </html>