<?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>v Statement</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="ScoregensTop.html" title="Score Statements and GEN Routines" /> <link rel="prev" href="t.html" title="t Statement (Tempo Statement)" /> <link rel="next" href="x.html" title="x Statement" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">v Statement</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="t.html">Prev</a> </td> <th width="60%" align="center">Score Statements and GEN Routines</th> <td width="20%" align="right"> <a accesskey="n" href="x.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="v"></a> <div class="titlepage"></div> <a id="IndexVStatement" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">v Statement</span> </h2> <p>v — Provides for locally variable time warping of score events. </p> </div> <div class="refsect1"> <a id="idm281472821153768"></a> <h2>Description</h2> <p> The <span class="emphasis"><em>v statement</em></span> provides for locally variable time warping of score events. </p> </div> <div class="refsect1"> <a id="idm281472821152056"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>v</strong></span> p1</pre> </div> <div class="refsect1"> <a id="idm281472821093480"></a> <h2>Initialization</h2> <p> <span class="command"><strong>p1</strong></span> -- Time warp factor (must be positive). </p> </div> <div class="refsect1"> <a id="idm281472821091576"></a> <h2>Performance</h2> <p> The <span class="emphasis"><em>v statement</em></span> takes effect with the following <a class="link" href="i.html" title="i Statement (Instrument or Note Statement)"><em class="citetitle">i statement</em></a>, and remains in effect until the next <a class="link" href="v.html" title="v Statement"><em class="citetitle">v statement</em></a>, <a class="link" href="s.html" title="s Statement"><em class="citetitle">s statement</em></a>, or <a class="link" href="e.html" title="e Statement"><em class="citetitle">e statement</em></a>. </p> </div> <div class="refsect1"> <a id="idm281472821086200"></a> <h2>Examples</h2> <p> The value of p1 is used as a multiplier for the start times (p2) of subsequent <a class="link" href="i.html" title="i Statement (Instrument or Note Statement)"><em class="citetitle">i statements</em></a>. </p> <p> </p> <div class="informalexample"> <pre class="programlisting"> <span class="stamnt">i</span>1 0 1 <span class="comment">; note1</span> <span class="stamnt">v</span>2 <span class="stamnt">i</span>1 1 1 <span class="comment">; note2</span></pre> </div> <p> In this example, the second note occurs two beats after the first note, and is twice as long. </p> <p> Although the <span class="emphasis"><em>v statement</em></span> is similar to the <a class="link" href="t.html" title="t Statement (Tempo Statement)"><em class="citetitle">t statement</em></a>, the <span class="emphasis"><em>v statement</em></span> is local in operation. That is, <span class="emphasis"><em>v</em></span> affects only the following notes, and its effect may be cancelled or changed by another <span class="emphasis"><em>v statement</em></span>. </p> <p> Carried values are unaffected by the <span class="emphasis"><em>v statement</em></span> (see <a class="link" href="ScoreTop.html#ScoreCarry" title="Carry"><em class="citetitle">Carry</em></a>). </p> <p> </p> <div class="informalexample"> <pre class="programlisting"> <span class="stamnt">i</span>1 0 1 <span class="stamnt">v</span>2 <span class="stamnt">i</span>. + . <span class="stamnt">i</span>. . .</pre> </div> <p> In this example, the <span class="emphasis"><em>v statement</em></span> has no effect. </p> </div> <div class="refsect1"> <a id="idm281472821069560"></a> <h2>Examples</h2> <p> Here is an example of the v statement. It uses the file <a class="ulink" href="examples/v.csd" target="_top"><em class="citetitle">v.csd</em></a>. </p> <div class="example"> <a id="idm281472821067704"></a> <p class="title"> <strong>Example 1176. Example of the v statement.</strong> </p> <div class="example-contents"> <div class="refsect1"> <a id="idm281472683715672"></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 RT audio input is needed too</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o v.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">env</span> <span class="nb">expseg</span> <span class="mf">.01</span><span class="p">,</span> <span class="nb">p3</span><span class="o">*</span><span class="mf">0.25</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">p3</span><span class="o">*</span><span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.01</span> a<span class="n">sig</span> <span class="nb">poscil3</span> <span class="mf">.4</span><span class="o">*</span>a<span class="n">env</span><span class="p">,</span> <span class="nb">p4</span><span class="p">,</span> <span class="mi">1</span> <span class="nb">outs</span> a<span class="n">sig</span><span class="p">,</span> a<span class="n">sig</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">16384</span> <span class="mi">10</span> <span class="mi">1</span> <span class="c1">;sine wave</span> <span class="c1">;because note 3 and 5 are played simultaneously and are nearly of the same frequency,</span> <span class="c1">;played together they will create a "beating" sound.</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">110</span> <span class="c1">; note1</span> <span class="nb">v</span><span class="mi">2</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">3</span> <span class="o">.</span> <span class="mi">220</span> <span class="c1">; note2</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">6</span> <span class="o">.</span> <span class="mi">110</span> <span class="c1">; note3</span> <span class="nb">v</span><span class="mi">1</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">9</span> <span class="o">.</span> <span class="mi">880</span> <span class="c1">; note4</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">12</span> <span class="o">.</span> <span class="mi">100</span> <span class="c1">; note5</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" /> In this example, note3 and note5 occur simultaneously, while note4 actually occurs before note3, that is, at its original place. Durations are unaffected. </p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="t.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="ScoregensTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="x.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">t Statement (Tempo Statement) </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> x Statement</td> </tr> </table> </div> </body> </html>