<?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>vlinseg</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="vlimit.html" title="vlimit" /> <link rel="next" href="vlowres.html" title="vlowres" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">vlinseg</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="vlimit.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="vlowres.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="vlinseg"> <a id="vlinseg"></a> <div class="titlepage"></div> <a id="IndexVlinseg" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">vlinseg</span> </h2> <p>vlinseg — Vectorial envelope generator </p> </div> <div class="refsect1" title="Description"> <a id="idp52080696"></a> <h2>Description</h2> <p> Generate linear vectorial segments </p> </div> <div class="refsect1" title="Syntax"> <a id="idp52081344"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>vlinseg</strong></span> ifnout, ielements, ifn1, idur1, ifn2 [, idur2, ifn3 [...]]</pre> </div> <div class="refsect1" title="Initialization"> <a id="idp52120704"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>ifnout</em></span> - number of table hosting output vectorial signal </p> <p> <span class="emphasis"><em>ifn1</em></span> - starting vector </p> <p> <span class="emphasis"><em>ifn2,ifn3,etc.</em></span> - vector after <span class="emphasis"><em>idurx</em></span> seconds </p> <p> <span class="emphasis"><em>idur1</em></span> - duration in seconds of first segment. </p> <p> <span class="emphasis"><em>idur2, idur3, etc. </em></span> - duration in seconds of subsequent segments. </p> <p> <span class="emphasis"><em>ielements</em></span> - number of elements of vectors. </p> </div> <div class="refsect1" title="Performance"> <a id="idp52124040"></a> <h2>Performance</h2> <p> These opcodes are similar to <span class="emphasis"><em>linseg</em></span> and <span class="emphasis"><em>expseg</em></span>, but operate with vectorial signals instead of with scalar signals. </p> <p> Output is a vectorial control signal hosted by <span class="emphasis"><em>ifnout</em></span> (that must be previously allocated), while each break-point of the envelope is actually a vector of values. All break-points must contain the same number of elements (<span class="emphasis"><em>ielements</em></span>). </p> <p> All these operators are designed to be used together with other opcodes that operate with vectorial signals such as <span class="emphasis"><em>bmscan</em></span>, <span class="emphasis"><em>vcella</em></span>, <span class="emphasis"><em>adsynt</em></span>, <span class="emphasis"><em>adsynt2</em></span>, etc. </p> </div> <div class="refsect1" title="Example"> <a id="idp52127224"></a> <h2>Example</h2> <p> Here is an example of the vlinseg opcode. It uses the files <a class="ulink" href="examples/vlinseg.csd" target="_top"><em class="citetitle">vlinseg.csd</em></a>. </p> <div class="example"> <a id="idp52128200"></a> <p class="title"> <strong>Example 954. Example of the vlinseg opcode.</strong> </p> <div class="example-contents"> <pre class="programlisting"> <span class="csdtag"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></span> -odac -B441 -b441 <span class="csdtag"></CsOptions></span> <span class="csdtag"><CsInstruments></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 gilen <span class="opc">init</span> 32 gitable1 <span class="ohdr">ftgen</span> 0, 0, gilen, 10, 1 gitable2 <span class="ohdr">ftgen</span> 0, 0, gilen, 10, 1 gitable3 <span class="ohdr">ftgen</span> 0, 0, gilen, <span class="op">-</span>7, 30, gilen, 35 gitable4 <span class="ohdr">ftgen</span> 0, 0, gilen, <span class="op">-</span>7, 400, gilen, 450 gitable5 <span class="ohdr">ftgen</span> 0, 0, gilen, <span class="op">-</span>7, 5000, gilen, 5500 <span class="oblock">instr</span> 1 <span class="opc">vcopy</span> gitable2, gitable1, gilen <span class="opc">turnoff</span> <span class="oblock">endin</span> <span class="oblock">instr</span> 2 <span class="opc">vlinseg</span> gitable2, 16, gitable3, 2, gitable4, 2, gitable5 <span class="oblock">endin</span> <span class="oblock">instr</span> 3 kcount <span class="opc">init</span> 0 <span class="octrl">if</span> kcount <span class="op"><</span> 16 then kval <span class="opc">table</span> kcount, gitable2 <span class="opc">printk</span> 0,kval kcount <span class="op">=</span> kcount <span class="op">+</span>1 <span class="octrl">else</span> <span class="opc">turnoff</span> <span class="octrl">endif</span> <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">i</span>1 0 1 <span class="stamnt">s</span> <span class="stamnt">i</span>2 0 10 <span class="stamnt">i</span>3 0 1 <span class="stamnt">i</span>3 1 1 <span class="stamnt">i</span>3 1.5 1 <span class="stamnt">i</span>3 2 1 <span class="stamnt">i</span>3 2.5 1 <span class="stamnt">i</span>3 3 1 <span class="stamnt">i</span>3 3.5 1 <span class="stamnt">i</span>3 4 1 <span class="stamnt">i</span>3 4.5 1 <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1" title="Credits"> <a id="idp52129216"></a> <h2>Credits</h2> <p>Written by Gabriel Maldonado.</p> <p>Example by Andres Cabrera.</p> <p>New in Csound 5 (Previously available only on CsoundAV)</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="vlimit.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="vlowres.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">vlimit </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> vlowres</td> </tr> </table> </div> </body> </html>