summaryrefslogtreecommitdiff
path: root/opcodes/metro.xml
blob: 282432cd0bc6780fdbda15af58cbf6bd0e9c3cac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<refentry id="metro">
<indexterm id="IndexMetro"><primary>metro</primary></indexterm>
  <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo>
  <refmeta>
    <refentrytitle>metro</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>metro</refname>
    <refpurpose>
     Trigger Metronome
          </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
	Generate a metronomic signal to be used in any circumstance an isochronous trigger is needed.
    </para>
  </refsect1>
  <refsect1>
    <title>Syntax</title>
    <synopsis>ktrig  <command>metro</command>  kfreq [, initphase]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>initphase</emphasis>  - initial phase value (in the 0 to 1 range)
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ktrig</emphasis> - output trigger signal
    </para>
    <para>
      <emphasis>kfreq</emphasis> - frequency of trigger bangs in cps
    </para>

     <para>
     <emphasis>metro</emphasis> 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.
     </para>

     <note>
        <para>
        <emphasis>metro</emphasis> 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.
     </para>
     </note>

  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the metro opcode. It uses the file <ulink url="examples/metro.csd"><citetitle>metro.csd</citetitle></ulink>

      <example>
        <title>Example of the metro opcode.</title>
        <xi:include href="examples-xml/metro.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>

      </example>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>Written by &namegabriel;.</para>
    <para>Example written by &nameandres;.</para>
    <para>New in Csound 5 (Previously available only on CsoundAV)</para>
  </refsect1>
</refentry>