<?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>vcomb</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="vco2init.html" title="vco2init" /> <link rel="next" href="vcopy.html" title="vcopy" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">vcomb</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="vco2init.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="vcopy.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="vcomb"> <a id="vcomb"></a> <div class="titlepage"></div> <a id="IndexVcomb" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">vcomb</span> </h2> <p>vcomb — Variably reverberates an input signal with a <span class="quote">“<span class="quote">colored</span>”</span> frequency response. </p> </div> <div class="refsect1" title="Description"> <a id="idp51113088"></a> <h2>Description</h2> <p> Variably reverberates an input signal with a <span class="quote">“<span class="quote">colored</span>”</span> frequency response. </p> </div> <div class="refsect1" title="Syntax"> <a id="idp51147888"></a> <h2>Syntax</h2> <pre class="synopsis">ares <span class="command"><strong>vcomb</strong></span> asig, krvt, xlpt, imaxlpt [, iskip] [, insmps]</pre> </div> <div class="refsect1" title="Initialization"> <a id="idp51149000"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>imaxlpt</em></span> -- maximum loop time for <span class="emphasis"><em>klpt</em></span> </p> <p> <span class="emphasis"><em>iskip</em></span> (optional, default=0) -- initial disposition of delay-loop data space (cf. <a class="link" href="reson.html" title="reson"><em class="citetitle">reson</em></a>). The default value is 0. </p> <p> <span class="emphasis"><em>insmps</em></span> (optional, default=0) -- delay amount, as a number of samples. </p> </div> <div class="refsect1" title="Performance"> <a id="idp51151520"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>krvt</em></span> -- the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude). </p> <p> <span class="emphasis"><em>xlpt</em></span> -- variable loop time in seconds, same as <span class="emphasis"><em>ilpt</em></span> in <span class="emphasis"><em>comb</em></span>. Loop time can be as large as <span class="emphasis"><em>imaxlpt</em></span>. </p> <p> This filter reiterates input with an echo density determined by loop time <span class="emphasis"><em>xlpt</em></span>. The attenuation rate is independent and is determined by <span class="emphasis"><em>krvt</em></span>, the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude). Output will appear only after <span class="emphasis"><em>ilpt</em></span> seconds. </p> </div> <div class="refsect1" title="Examples"> <a id="idp51154768"></a> <h2>Examples</h2> <p> Here is an example of the vcomb opcode. It uses the file <a class="ulink" href="examples/vcomb.csd" target="_top"><em class="citetitle">vcomb.csd</em></a>. </p> <div class="example"> <a id="idp51155736"></a> <p class="title"> <strong>Example 933. Example of the vcomb 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> <pre class="programlisting"> <span class="csdtag"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></span> <span class="comment">; Select audio/midi flags here according to platform</span> <span class="comment">; Audio out Audio in</span> -odac -iadc -M0 <span class="comment">;;;RT audio I/O with MIDI in</span> <span class="csdtag"></CsOptions></span> <span class="csdtag"><CsInstruments></span> <span class="comment">; Example by Jonathan Murphy and Charles Gran 2007</span> <span class="ohdr">sr</span> <span class="op">=</span> 44100 <span class="ohdr">ksmps</span> <span class="op">=</span> 10 <span class="ohdr">nchnls</span> <span class="op">=</span> 2 <span class="comment">; new, and important. Make sure that midi note events are only</span> <span class="comment">; received by instruments that actually need them.</span> <span class="comment">; turn default midi routing off</span> <span class="ohdr">massign</span> 0, 0 <span class="comment">; route note events on channel 1 to instr 1</span> <span class="ohdr">massign</span> 1, 1 <span class="comment">; Define your midi controllers</span> <span class="omacro">#define</span> C1 #21# <span class="omacro">#define</span> C2 #22# <span class="omacro">#define</span> C3 #23# <span class="comment">; Initialize MIDI controllers</span> <span class="opc">initc7</span> 1, $C1, 0.5 <span class="comment">;delay send</span> <span class="opc">initc7</span> 1, $C2, 0.5 <span class="comment">;delay: time to zero</span> <span class="opc">initc7</span> 1, $C3, 0.5 <span class="comment">;delay: rate </span> gaosc <span class="opc">init</span> 0 <span class="comment">; Define an opcode to "smooth" the MIDI controller signal</span> <span class="oblock">opcode</span> smooth, k, <span class="opc">k</span> kin <span class="opc">xin</span> kport <span class="opc">linseg</span> 0, 0.0001, 0.01, 1, 0.01 kin <span class="opc">portk</span> kin, kport <span class="opc">xout</span> kin <span class="oblock">endop</span> <span class="oblock">instr</span> 1 <span class="comment">; Generate a sine wave at the frequency of the MIDI note that triggered the intrument</span> ifqc <span class="opc">cpsmidi</span> iamp <span class="opc">ampmidi</span> 10000 aenv <span class="opc">linenr</span> iamp, .01, .1, .01 <span class="comment">;envelope</span> a1 <span class="opc">oscil</span> aenv, ifqc, 1 <span class="comment">; All sound goes to the global variable gaosc</span> gaosc <span class="op">=</span> gaosc <span class="op">+</span> a1 <span class="oblock">endin</span> <span class="oblock">instr</span> 198 <span class="comment">; ECHO</span> kcmbsnd <span class="opc">ctrl7</span> 1, $C1, 0, 1 <span class="comment">;delay send</span> ktime <span class="opc">ctrl7</span> 1, $C2, 0.01, 6 <span class="comment">;time loop fades out</span> kloop <span class="opc">ctrl7</span> 1, $C3, 0.01, 1 <span class="comment">;loop speed</span> <span class="comment">; Receive MIDI controller values and then smooth them</span> kcmbsnd smooth kcmbsnd ktime smooth ktime kloop smooth kloop imaxlpt <span class="op">=</span> 1 <span class="comment">;max loop time</span> <span class="comment">; Create a variable reverberation (delay) of the gaosc signal</span> acomb <span class="opc">vcomb</span> gaosc, ktime, kloop, imaxlpt, 1 aout <span class="op">=</span> (acomb <span class="op">*</span> kcmbsnd) <span class="op">+</span> gaosc <span class="op">*</span> (1 <span class="op">-</span> kcmbsnd) <span class="opc">outs</span> aout, aout gaosc <span class="op">=</span> 0 <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">f</span>1 0 16384 10 1 <span class="stamnt">i</span>198 0 10000 <span class="stamnt">e</span> <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1" title="See Also"> <a id="idp51158008"></a> <h2>See Also</h2> <p> <a class="link" href="alpass.html" title="alpass"><em class="citetitle">alpass</em></a>, <a class="link" href="comb.html" title="comb"><em class="citetitle">comb</em></a>, <a class="link" href="reverb.html" title="reverb"><em class="citetitle">reverb</em></a>, <a class="link" href="valpass.html" title="valpass"><em class="citetitle">valpass</em></a> </p> </div> <div class="refsect1" title="Credits"> <a id="idp51160464"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: William <span class="quote">“<span class="quote">Pete</span>”</span> Moss</td> </tr> <tr> <td>University of Texas at Austin</td> </tr> <tr> <td>Austin, Texas USA</td> </tr> <tr> <td>January 2002</td> </tr> </table> <p> </p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="vco2init.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="vcopy.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">vco2init </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> vcopy</td> </tr> </table> </div> </body> </html>