Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > b707d9a4ee443103660a75ccb6e51334 > files > 2751

csound-doc-5.19.01-10.mga5.noarch.rpm

<?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>timout</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="times.html" title="times" />
    <link rel="next" href="tival.html" title="tival" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">timout</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="times.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="tival.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="timout">
      <a id="timout"></a>
      <div class="titlepage"></div>
      <a id="IndexTimout" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">timout</span>
        </h2>
        <p>timout — 
      Conditional branch during p-time depending on elapsed note time.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp49009256"></a>
        <h2>Description</h2>
        <p>
      Conditional branch during p-time depending on elapsed note time. <span class="emphasis"><em>istrt</em></span> and <span class="emphasis"><em>idur</em></span> specify time in seconds. The branch to <span class="emphasis"><em>label</em></span> will become effective at time <span class="emphasis"><em>istrt</em></span>, and will remain so for just <span class="emphasis"><em>idur</em></span> seconds. Note that <span class="emphasis"><em>timout</em></span> can be reinitialized for multiple activation within a single note (see example under <a class="link" href="reinit.html" title="reinit"><em class="citetitle">reinit</em></a>).
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp49021232"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>timout</strong></span> istrt, idur, label</pre>
        <p>
      where <span class="emphasis"><em>label</em></span> is in the same instrument block and is not an expression.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp49022768"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the timout opcode. It uses the file <a class="ulink" href="examples/timout.csd" target="_top"><em class="citetitle">timout.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp49023736"></a>
          <p class="title">
            <strong>Example 884. Example of the timout 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">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

<span class="oblock">instr</span> 1

indx <span class="op">=</span> 0
itim <span class="op">=</span> p4				<span class="comment">;change time for one step</span>

<span class="olabel">clock</span><span class="op">:</span> 
   <span class="octrl">timout</span> 0, itim, <span class="olabel">time</span>
   <span class="opc">reinit</span> <span class="olabel">clock</span>

<span class="olabel">time</span><span class="op">:</span>
   itmp <span class="opc">table</span> indx, 2, 0, 0, 1
   <span class="octrl">if</span> itmp <span class="op">==</span> 1 then
   <span class="opc">print</span> itmp
   <span class="opc">event_i</span> "i",2, 0, .1			<span class="comment">;event has duration of .1 second</span>
<span class="octrl">endif</span>
indx <span class="op">=</span> indx<span class="op">+</span>1

<span class="oblock">endin</span>

<span class="oblock">instr</span> 2	<span class="comment">;play it</span>

kenv <span class="opc">transeg</span> 0.01, p3<span class="op">*</span>0.25, 1, 1, p3<span class="op">*</span>0.75, .5, 0.01
asig <span class="opc">oscili</span> kenv<span class="op">*</span>.4, 400, 1
     <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span> 1 0 1024 10 1	<span class="comment">;sine</span>
<span class="stamnt">f</span> 2 0 16 2 1 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 <span class="comment">;the rythm table</span>

<span class="stamnt">i</span>1 0 10 .1
<span class="stamnt">i</span>1 + 10 .05
<span class="stamnt">i</span>1 + 10 .01
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1" title="See Also">
        <a id="idp49059864"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="goto.html" title="goto"><em class="citetitle">goto</em></a>,
      <a class="link" href="if.html" title="if"><em class="citetitle">if</em></a>,
      <a class="link" href="igoto.html" title="igoto"><em class="citetitle">igoto</em></a>,
      <a class="link" href="kgoto.html" title="kgoto"><em class="citetitle">kgoto</em></a>,
      <a class="link" href="tigoto.html" title="tigoto"><em class="citetitle">tigoto</em></a>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="times.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="tival.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">times </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> tival</td>
        </tr>
      </table>
    </div>
  </body>
</html>