Debian Codegraph @

opcodes/loopseg.xml

raw symbols SCIP
1
2 <refentry id="loopseg">
3 <indexterm id="IndexLoopseg"><primary>loopseg</primary></indexterm>
4 <refentryinfo><title>Signal Generators:Linear and Exponential Generators</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>loopseg</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>loopseg</refname>
11 <refpurpose>
12 Generate control signal consisting of linear segments delimited by two or more specified points.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Generate control signal consisting of linear segments delimited by two or more specified points. The entire envelope is looped at <emphasis>kfreq</emphasis> rate. Each parameter can be varied at k-rate.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>ksig <command>loopseg</command> kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \
26 [, kvalue2] [, ktime2][...]</synopsis>
27 </refsect1>
28
29 <refsect1>
30 <title>Initialization</title>
31 <para>
32 <emphasis>iphase</emphasis> -- A value between 0 and 1 to say
33 where to start the loop. Zero, the commonest value, indicates
34 the beginning.
35 </para>
36 </refsect1>
37
38 <refsect1>
39 <title>Performance</title>
40 <para>
41 <emphasis>ksig</emphasis> -- Output signal.
42 </para>
43
44 <para>
45 <emphasis>kfreq</emphasis> -- Repeat rate in Hz or fraction of Hz.
46 </para>
47
48 <para>
49 <emphasis>ktrig</emphasis> -- If non-zero, retriggers the envelope from start (see <link linkend="trigger"><citetitle>trigger opcode</citetitle></link>), before the envelope cycle is completed.
50 </para>
51
52 <para>
53 <emphasis>kvalue0...kvalueN</emphasis> -- Values of points
54 </para>
55
56 <para>
57 <emphasis>ktime0...ktimeN</emphasis> -- Times between points; expressed in fractions of a cycle (see below). The final time designates a ramp between the final value and the first value.
58 </para>
59
60 <para>
61 <emphasis>loopseg</emphasis> opcode is similar to <link linkend="linseg"><citetitle>linseg</citetitle></link>, but the entire envelope is looped at <emphasis>kfreq</emphasis> rate. Notice that times are not expressed in seconds but in fraction of a cycle. Actually each duration represent is proportional to the other, and the entire cycle duration is proportional to the sum of all duration values.
62 </para>
63
64 <para>
65 The sum of all duration is then rescaled according to <emphasis>kfreq</emphasis> argument. For example, considering an envelope made up of 3 segments, each segment having 100 as duration value, their sum will be 300. This value represents the total duration of the envelope, and is actually divided into 3 equal parts, a part for each segment.
66 </para>
67
68 <para>
69 Actually, the real envelope duration in seconds is determined by <emphasis>kfreq</emphasis>. Again, if the envelope is made up of 3 segments, but this time the first and last segments have a duration of 50, whereas the central segment has a duration of 100 again, their sum will be 200. This time 200 represent the total duration of the 3 segments, so the central segment will be twice as long as the other segments.
70 </para>
71
72 <para>
73 All parameters can be varied at k-rate. Negative frequency values are allowed, reading the envelope backward. <emphasis>ktime0</emphasis> should always be set to 0, except if the user wants some special effect.
74 </para>
75 </refsect1>
76
77 <refsect1>
78 <title>Examples</title>
79 <para>
80 Here is an example of the loopseg opcode. It uses the file <ulink url="examples/loopseg.csd"><citetitle>loopseg.csd</citetitle></ulink>.
81 <example>
82 <title>Example of the loopseg opcode.</title>
83 <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>
84 <xi:include href="examples-xml/loopseg.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
85 </example>
86 </para>
87 </refsect1>
88
89 <refsect1>
90 <title>See also</title>
91 <para><link linkend="SiggenLineexp"><citetitle>Linear and Exponential Generators</citetitle></link></para>
92 </refsect1>
93
94 <refsect1>
95 <title>Credits</title>
96 <para>Author: &namegabriel;</para>
97 <para>New in Version 4.13</para>
98 </refsect1>
99 </refentry>