summaryrefslogtreecommitdiff
path: root/opcodes/schedule.xml
blob: d60a2f726b5eeea0f6b8229d1627c6e1e08798ce (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<refentry id="schedule">
<indexterm id="IndexSchedule"><primary>schedule</primary></indexterm>
  <refentryinfo><title>Instrument Control:Invocation</title></refentryinfo>
  <refmeta>
    <refentrytitle>schedule</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>schedule</refname>
    <refpurpose>
      Adds a new score event.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Adds a new score event.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>schedule</command> insnum, iwhen, idur [, ip4] [, ip5] [...]</synopsis>
    <synopsis><command>schedule</command> &quot;insname&quot;, iwhen, idur [, ip4] [, ip5] [...]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>insnum</emphasis> -- instrument number. Equivalent to p1 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. <emphasis>insnum</emphasis> must be a number greater than the number of the calling instrument.
    </para>

    <para>
      <emphasis><quote>insname</quote></emphasis> -- A string (in double-quotes) representing a named instrument.
    </para>

    <para>
      <emphasis>iwhen</emphasis> -- start time of the new event. Equivalent to p2 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. <emphasis>iwhen</emphasis> must be nonnegative. If <emphasis>iwhen</emphasis> is zero, <emphasis>insum</emphasis> must be greater than or equal to the p1 of the current instrument.
    </para>

    <para>
      <emphasis>idur</emphasis> -- duration of event. Equivalent to p3 in a score <link linkend="i"><citetitle>i statement</citetitle></link>.
    </para>

    <para>
      <emphasis>ip4, ip5, ...</emphasis> -- Equivalent to p4, p5, etc., in a score <link linkend="i"><citetitle>i statement</citetitle></link>.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>schedule</emphasis> adds a new score event. The arguments, including options, are the same as in a score. The <emphasis>iwhen</emphasis> time (p2) is measured from the time of this event.
    </para>

    <para>
      If the duration is zero or negative the new event is of MIDI type, and inherits the release sub-event from the scheduling instruction.
    </para>
    <note>
      <para> Note that the <emphasis>schedule</emphasis> opcode can't accept string p-fields. If you need to pass strings when instantiating an instrument, use the <link linkend="scoreline"><citetitle>scoreline</citetitle></link> or <link linkend="scoreline_i"><citetitle>scoreline_i</citetitle></link> opcode.</para>
    </note>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the schedule opcode. It uses the file <ulink url="examples/schedule.csd"><citetitle>schedule.csd</citetitle></ulink>.
      <example>
        <title>Example of the schedule opcode.</title>
        <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
          <xi:include href="examples-xml/schedule.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="schedwhen"><citetitle>schedwhen</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>See also</title>
    <para><link linkend="event"><citetitle>event</citetitle></link>,
    <link linkend="event_i"><citetitle>event_i</citetitle></link>,
    <link linkend="schedwhen"><citetitle>schedwhen</citetitle></link>,
    <link linkend="schedkwhen"><citetitle>schedkwhen</citetitle></link>,
    <link linkend="schedkwhennamed"><citetitle>schedkwhennamed</citetitle></link>,
    <link linkend="scoreline"><citetitle>scoreline</citetitle></link>,
    <link linkend="scoreline_i"><citetitle>scoreline_i</citetitle></link></para>
    <para> More information on this opcode: <ulink url="http://www.csounds.com/journal/issue15/phrase_loops.html"><citetitle>http://www.csounds.com/journal/issue15/phrase_loops.html</citetitle></ulink>  , written by Jim Aikin </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath/Codemist Ltd.</member>
        <member>Bath, UK</member>
        <member>November 1998</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

    <para>New in Csound version 3.491</para>
    <para>Based on work by &namegabriel;</para>
    <para>Thanks goes to David Gladstein, for clarifying the <emphasis>iwhen</emphasis> parameter.</para>
  </refsect1>
</refentry>