Debian Codegraph @

opcodes/loop_le.xml

raw symbols SCIP
1
2 <refentry id="loop_le">
3 <indexterm id="Indexloop_le"><primary>loop_le</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Program Flow Control</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>loop_le</refentrytitle>
7 </refmeta>
8
9
10 <refnamediv>
11 <refname>loop_le</refname>
12 <refpurpose>
13 Looping constructions.
14 </refpurpose>
15 </refnamediv>
16
17 <refsect1>
18 <title>Description</title>
19 <para>
20 Construction of looping operations.
21 </para>
22 </refsect1>
23
24 <refsect1>
25 <title>Syntax</title>
26 <synopsis><command>loop_le</command> indx, incr, imax, label</synopsis>
27 <synopsis><command>loop_le</command> kndx, kncr, kmax, label</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Initialization</title>
32 <para>
33 <emphasis>indx</emphasis> -- i-rate variable to count loop.
34 </para>
35
36 <para>
37 <emphasis>incr</emphasis> -- value to increment the loop.
38 </para>
39
40 <para>
41 <emphasis>imax</emphasis> -- maximum value of loop index.
42 </para>
43
44 </refsect1>
45
46 <refsect1>
47 <title>Performance</title>
48 <para>
49 <emphasis>kndx</emphasis> -- k-rate variable to count loop.
50 </para>
51 <para>
52 <emphasis>kncr</emphasis> -- value to increment the loop.
53 </para>
54 <para>
55 <emphasis>kmax</emphasis> -- maximum value of loop index.
56 </para>
57 <para>
58 The actions of <command>loop_le</command> are equivalent to the
59 code
60 <programlisting>
61 indx <emphasis role="op">=</emphasis> indx <emphasis role="op">+</emphasis> incr
62 <emphasis role="opc">if</emphasis> (indx <emphasis role="op">&lt;=</emphasis> imax) <emphasis role="opc">igoto</emphasis> label</programlisting>
63 <!-- except that the values of the <emphasis>incr</emphasis> and
64 <emphasis>imax</emphasis> parameters cannot change in the loop; --> or
65 <programlisting>
66 kndx <emphasis role="op">=</emphasis> kndx <emphasis role="op">+</emphasis> kncr
67 <emphasis role="opc">if</emphasis> (kndx <emphasis role="op">&lt;=</emphasis> kmax) <emphasis role="opc">kgoto</emphasis> label</programlisting>
68 </para>
69 <para> <note> Adviced is to use the 'modern' while or until opcodes for looping constructions.</note>
70 </para>
71 </refsect1>
72
73 <refsect1>
74 <title>Examples</title>
75 <para>
76 Here is an example of the loop_le opcode. It uses the file <ulink url="examples/loop_le.csd"><citetitle>loop_le.csd</citetitle></ulink>.
77 <example>
78 <title>Example of the loop_le opcode.</title>
79 <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>
80 <xi:include href="examples-xml/loop_le.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
81 </example>
82 Its output should include a line like this:
83 <screen>
84 play instance 0
85 play instance 1
86 play instance 2
87 play instance 3
88 play instance 4
89 play instance 5
90 </screen>
91 </para>
92 </refsect1>
93
94 <refsect1>
95 <title>See also</title>
96 <para><link linkend="ControlPgmctl"><citetitle>Program Flow Control: Looping Constructions</citetitle></link></para>
97 <para> More information on this opcode: <ulink url="http://www.csoundjournal.com/2006summer/controlFlow_part2.html"><citetitle>http://www.csoundjournal.com/2006summer/controlFlow_part2.html</citetitle></ulink> written by Steven Yi,
98 and in the Floss Manuals: <ulink url="https://flossmanual.csound.com/csound-language/control-structures"><citetitle> https://flossmanual.csound.com/csound-language/control-structures</citetitle></ulink></para>
99 </refsect1>
100
101 <refsect1>
102 <title>Credits</title>
103 <para>&nameistvan;.</para>
104 <para>New in Csound version 5.01</para>
105 </refsect1>
106 </refentry>