Debian Codegraph @

opcodes/loop_ge.xml

raw symbols SCIP
1
2 <refentry id="loop_ge">
3 <indexterm id="Indexloop_ge"><primary>loop_ge</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Program Flow Control</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>loop_ge</refentrytitle>
7 </refmeta>
8
9
10 <refnamediv>
11 <refname>loop_ge</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_ge</command> indx, idecr, imin, label</synopsis>
27 <synopsis><command>loop_ge</command> kndx, kdecr, kmin, 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>idecr</emphasis> -- value to decrement the loop.
38 </para>
39
40 <para>
41 <emphasis>imin</emphasis> -- minimum 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>kdecr</emphasis> -- value to decrement the loop.
53 </para>
54 <para>
55 <emphasis>kmin</emphasis> -- minimum value of loop index.
56 </para>
57 <para>
58 The actions of <command>loop_ge</command> are equivalent to the
59 code
60 <programlisting>
61 indx <emphasis role="op">=</emphasis> indx <emphasis role="op">-</emphasis> idecr
62 <emphasis role="opc">if</emphasis> (indx <emphasis role="op">&gt;=</emphasis> imin) <emphasis role="opc">igoto</emphasis> label</programlisting>
63 <!-- except that the values of the <emphasis>idecr</emphasis> and
64 <emphasis>imin</emphasis> parameters cannot change in the loop; --> or
65 <programlisting>
66 kndx <emphasis role="op">=</emphasis> kndx <emphasis role="op">-</emphasis> kdecr
67 <emphasis role="opc">if</emphasis> (kndx <emphasis role="op">&gt;=</emphasis> kmin) <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 a group example for all loop_xx opcodes, comparing the different loop_ opcodes. It uses the file <ulink url="examples/loop_-group.csd"><citetitle>loop_-group.csd</citetitle></ulink>.
77 <example>
78 <title>Group example of the loop_xx opcodes.</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_-group.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
81 </example>
82 </para>
83 </refsect1>
84
85 <refsect1>
86 <title>See also</title>
87 <para><link linkend="ControlPgmctl"><citetitle>Program Flow Control: Looping Constructions</citetitle></link></para>
88 <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,
89 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>
90 </refsect1>
91
92 <refsect1>
93 <title>Credits</title>
94 <para>&nameistvan;. 2006</para>
95 <para>New in Csound version 5.01</para>
96 </refsect1>
97 </refentry>