<?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>metro</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <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="mediank.html" title="mediank" /> <link rel="next" href="midic14.html" title="midic14" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">metro</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="mediank.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="midic14.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="metro"> <a id="metro"></a> <div class="titlepage"></div> <a id="IndexMetro" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">metro</span> </h2> <p>metro — Trigger Metronome </p> </div> <div class="refsect1" title="Description"> <a id="id3015341"></a> <h2>Description</h2> <p> Generate a metronomic signal to be used in any circumstance an isochronous trigger is needed. </p> </div> <div class="refsect1" title="Syntax"> <a id="id3015354"></a> <h2>Syntax</h2> <pre class="synopsis">ktrig <span class="command"><strong>metro</strong></span> kfreq [, initphase]</pre> </div> <div class="refsect1" title="Initialization"> <a id="id3016304"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>initphase</em></span> - initial phase value (in the 0 to 1 range) </p> </div> <div class="refsect1" title="Performance"> <a id="id3016319"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>ktrig</em></span> - output trigger signal </p> <p> <span class="emphasis"><em>kfreq</em></span> - frequency of trigger bangs in cps </p> <p> <span class="emphasis"><em>metro</em></span> is a simple opcode that outputs a sequence of isochronous bangs (that is 1 values) each 1/kfreq seconds. Trigger signals can be used in any circumstance, mainly to temporize realtime algorithmic compositional structures. </p> <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> <table border="0" summary="Note"> <tr> <td rowspan="2" align="center" valign="top" width="25"> <img alt="[Note]" src="images/note.png" /> </td> <th align="left">Note</th> </tr> <tr> <td align="left" valign="top"> <p> <span class="emphasis"><em>metro</em></span> will produce a trigger signal of 1 when its phase is exactly 0 or 1. If you want to skip the initial trigger, use a very small value like 0.00000001. </p> </td> </tr> </table> </div> </div> <div class="refsect1" title="Examples"> <a id="id3016372"></a> <h2>Examples</h2> <p> Here is an example of the metro opcode. It uses the file <a class="ulink" href="examples/metro.csd" target="_top"><em class="citetitle">metro.csd</em></a> </p> <div class="example"> <a id="id3016388"></a> <p class="title"> <b>Example 360. Example of the metro opcode.</b> </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">kr</span> <span class="op">=</span> 100 <span class="ohdr">ksmps</span> <span class="op">=</span> 441 <span class="ohdr">nchnls</span> <span class="op">=</span> 2 <span class="oblock">instr</span> 1 ktrig <span class="opc">metro</span> 0.2 <span class="opc">printk2</span> ktrig <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">i</span> 1 0 20 <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="id3016405"></a> <h2>Credits</h2> <p>Written by Gabriel Maldonado.</p> <p>Example written by Andrés 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="mediank.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="midic14.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">mediank </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> midic14</td> </tr> </table> </div> </body> </html>