<?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>t Statement (Tempo 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="s.html" title="s Statement" /> <link rel="next" href="v.html" title="v Statement" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">t Statement (Tempo Statement)</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="s.html">Prev</a> </td> <th width="60%" align="center">Score Statements and GEN Routines</th> <td width="20%" align="right"> <a accesskey="n" href="v.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="t"></a> <div class="titlepage"></div> <a id="IndexTStatement" class="indexterm"></a> <a id="IndexTempoStatement" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">t Statement (Tempo Statement)</span> </h2> <p>t — Sets the tempo. </p> </div> <div class="refsect1"> <a id="idm281472821206968"></a> <h2>Description</h2> <p> This statement sets the tempo and specifies the accelerations and decelerations for the current section. This is done by converting beats into seconds. </p> </div> <div class="refsect1"> <a id="idm281472821205608"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>t</strong></span> p1 p2 p3 p4 ... (unlimited)</pre> </div> <div class="refsect1"> <a id="idm281472821203576"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>p1</em></span> -- Must be zero. </p> <p> <span class="emphasis"><em>p2</em></span> -- Initial tempo on beats per minute. </p> <p> <span class="emphasis"><em>p3, p5, p7,...</em></span> -- Times in beats (in non-decreasing order). </p> <p> <span class="emphasis"><em>p4, p6, p8,...</em></span> -- Tempi for the referenced beat times. </p> </div> <div class="refsect1"> <a id="idm281472821138680"></a> <h2>Performance</h2> <p> Time and Tempo-for-that-time are given as ordered couples that define points on a "tempo vs. time" graph. (The time-axis here is in beats so is not necessarily linear.) The beat-rate of a Section can be thought of as a movement from point to point on that graph: motion between two points of equal height signifies constant tempo, while motion between two points of unequal height will cause an accelarando or ritardando accordingly. The graph can contain discontinuities: two points given equal times but different tempi will cause an immediate tempo change. </p> <p> Motion between different tempos over non-zero time is inverse linear. That is, an accelerando between two tempos M1 and M2 proceeds by linear interpolation of the single-beat durations from 60/M1 to 60/M2. </p> <p> The first tempo given must be for beat 0. </p> <p> A tempo, once assigned, will remain in effect from that time-point unless influenced by a succeeding tempo, i.e. the last specified tempo will be held to the end of the section. </p> <p> A <span class="emphasis"><em>t statement</em></span> applies only to the score section in which it appears. Only one <span class="emphasis"><em>t statement</em></span> is meaningful in a section; it can be placed anywhere within that section. If a score section contains no <span class="emphasis"><em>t statement</em></span>, then beats are interpreted as seconds (i.e. with an implicit <span class="emphasis"><em>t 0 60</em></span> statement). </p> <p> N.B. If the CSound command includes a <a class="link" href="CommandFlags.html#FlagsMinusLowerT"><em class="citetitle">-t flag</em></a>, the interpreted tempo of all score <span class="emphasis"><em>t statements</em></span> will be overridden by the command-line tempo. </p> </div> <div class="refsect1"> <a id="idm281472821130296"></a> <h2>Examples</h2> <p> Here is an example of the t statement. It uses the file <a class="ulink" href="examples/t.csd" target="_top"><em class="citetitle">t.csd</em></a>. </p> <div class="example"> <a id="idm281472821128440"></a> <p class="title"> <strong>Example 1175. Example of the t statement.</strong> </p> <div class="example-contents"> <div class="refsect1"> <a id="idm281472683808008"></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 t.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">.8</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="nb">t</span> <span class="mi">0</span> <span class="mi">240</span> <span class="mi">12</span> <span class="mi">30</span> <span class="mi">15</span> <span class="mi">240</span> <span class="c1">;start tempo = 240 </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">;tempo = 240</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">3</span> <span class="mi">2</span> <span class="mi">220</span> <span class="c1">;slow down &</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">6</span> <span class="mi">2</span> <span class="mi">440</span> <span class="c1">;slow down &</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">9</span> <span class="mi">2</span> <span class="mi">880</span> <span class="c1">;slow down & </span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">12</span> <span class="mi">2</span> <span class="mi">110</span> <span class="c1">;slow down to 30 at 12 seconds</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">15</span> <span class="mi">2</span> <span class="mi">220</span> <span class="c1">;speed up to 240 again</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">18</span> <span class="mi">2</span> <span class="mi">440</span> <span class="c1">;stay at tempo 240</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">21</span> <span class="mi">2</span> <span class="mi">880</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> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="s.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="v.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">s Statement </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> v Statement</td> </tr> </table> </div> </body> </html>