Debian Codegraph @

opcodes/looptseg.xml

raw symbols SCIP
1 
2 <refentry id="looptseg">
3 <indexterm id="IndexLooptseg"><primary>looptseg</primary></indexterm>
4 <refentryinfo><title>Signal Generators:Linear and Exponential Generators</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>looptseg</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>looptseg</refname>
13 <refpurpose>
14 Generate control signal consisting of exponential or linear segments delimited by two or more specified points.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Generate control signal consisting of controllable exponential segments or 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.
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>ksig <command>looptseg</command> kfreq, ktrig, iphase, kvalue0, ktype0, ktime0, [, kvalue1] [,ktype1] [, ktime1] \
28 [, kvalue2] [,ktype2] [, ktime2] [...] [, kvalueN] [,ktypeN] [, ktimeN]</synopsis>
29 </refsect1>
30
31 <refsect1>
32 <title>Initialization</title>
33 <para>
34 <emphasis>iphase</emphasis> -- A value between 0 and 1 to say
35 where to start the loop. Zero, the commonest value, indicates
36 the beginning.
37 </para>
38 </refsect1>
39
40 <refsect1>
41 <title>Performance</title>
42 <para>
43 <emphasis>ksig</emphasis> -- Output signal.
44 </para>
45
46 <para>
47 <emphasis>kfreq</emphasis> -- Repeat rate in Hz or fraction of Hz.
48 </para>
49
50 <para>
51 <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.
52 </para>
53
54 <para>
55 <emphasis>kvalue0...kvalueN</emphasis> -- Values of points
56 </para>
57
58 <para>
59 <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.
60 </para>
61
62 <para>
63 <emphasis>ktype0...ktypeN</emphasis> -- shape of the envelope. If the value is 0 then the shap eis linear; otherwise it is an concave exponential (positive type) or a convex exponential (negative type).
64 </para>
65
66 <para>
67 <emphasis>looptseg</emphasis> opcode is similar to <link linkend="transeg"><citetitle>transeg</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.
68 </para>
69
70 <para>
71 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.
72 </para>
73
74 <para>
75 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.
76 </para>
77
78 <para>
79 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.
80 </para>
81 </refsect1>
82
83 <refsect1>
84 <title>Examples</title>
85 <para>
86 Here is an example of the looptseg opcode. It uses the file <ulink url="examples/looptseg.csd"><citetitle>looptseg.csd</citetitle></ulink>.
87
88 <example>
89 <title>Example of the looptseg opcode.</title>
90
91
92
93 <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>
94 <xi:include href="examples-xml/looptseg.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
95 </example>
96 </para>
97 </refsect1>
98
99 <refsect1>
100 <title>See also</title>
101 <para><link linkend="SiggenLineexp"><citetitle>Linear and Exponential Generators</citetitle></link></para>
102 </refsect1>
103
104 <refsect1>
105 <title>Credits</title>
106 <para>Author: &namejohn;</para>
107 <para>New in Version 5.12</para>
108 </refsect1>
109 </refentry>