Debian Codegraph @

opcodes/syncgrain.xml

raw symbols SCIP
1 <refentry id="syncgrain">
2 <indexterm id="IndexSyncgrain"><primary>syncgrain</primary></indexterm>
3 <refentryinfo><title>Signal Generators:Granular Synthesis</title></refentryinfo>
4 <refmeta>
5 <refentrytitle>syncgrain</refentrytitle>
6 </refmeta>
7
8
9
10 <refnamediv>
11 <refname>syncgrain</refname>
12 <refpurpose>
13 Synchronous granular synthesis.
14 </refpurpose>
15 </refnamediv>
16
17 <refsect1>
18 <title>Description</title>
19 <para>
20 <emphasis>syncgrain</emphasis> implements synchronous granular synthesis. The source sound for the
21 grains is obtained by reading a function table containing the samples of the source waveform.
22 For sampled-sound sources, <link linkend="GEN01"><citetitle>GEN01</citetitle></link> is used.
23 <emphasis>syncgrain</emphasis> will accept deferred allocation tables.
24 </para>
25 <para>
26 The grain generator has full control of frequency (grains/sec), overall amplitude,
27 grain pitch (a sampling increment) and grain size (in secs),
28 both as fixed or time-varying (signal) parameters.
29 An extra parameter is the grain pointer speed (or rate),
30 which controls which position the generator will start reading samples
31 in the table for each successive grain. It is measured in fractions of grain size,
32 so a value of 1 (the default) will make each successive grain read from where the
33 previous grain should finish. A value of 0.5 will make the next grain start at the midway position
34 from the previous grain start and finish, etc.. A value of 0 will make the generator read
35 always from a fixed position of the table (wherever the pointer was last at).
36 A negative value will decrement pointer positions. This control gives extra flexibility for creating
37 timescale modifications in the resynthesis.
38 </para>
39 <para>
40 <emphasis>syncgrain</emphasis> will generate any number of parallel grain streams (which will depend
41 on grain density/frequency), up to the <emphasis>iolaps</emphasis> value (default 100). The number
42 of streams (overlapped grains) is determined by grainsize*grain_freq. More grain overlaps will
43 demand more calculations and the synthesis might not run in realtime (depending on processor power).
44 </para>
45 <para>
46 <emphasis>syncgrain</emphasis> can simulate FOF-like formant synthesis, provided that a suitable shape is used
47 as grain envelope and a sinewave as the grain wave. For this use, grain sizes of around
48 0.04 secs can be used. The formant centre frequency is determined by the grain pitch.
49 Since this is a sampling increment, in order to use a frequency in Hz, that value has to be
50 scaled by tablesize/sr. Grain frequency will determine the fundamental.
51 </para>
52 <para>
53 <emphasis>syncgrain</emphasis> uses floating-point indexing, so its precision is not affected by
54 large-size tables. This opcode is based on the SndObj library SyncGrain class.
55 </para>
56 </refsect1>
57
58 <refsect1>
59 <title>Syntax</title>
60 <synopsis>asig <command>syncgrain</command> kamp, kfreq, kpitch, kgrsize, kprate, ifun1, \
61 ifun2, iolaps</synopsis>
62 </refsect1>
63
64 <refsect1>
65 <title>Initialization</title>
66 <para>
67 <emphasis>ifun1</emphasis> -- source signal function table. Deferred-allocation tables (see
68 <link linkend="GEN01"><citetitle>GEN01</citetitle></link>) are accepted, but the opcode
69 expects a mono source.
70 </para>
71 <para>
72 <emphasis>ifun2</emphasis> -- grain envelope function table.
73 </para>
74 <para>
75 <emphasis>iolaps</emphasis> -- maximum number of overlaps,
76 max(<emphasis>kfreq</emphasis>)*max(<emphasis>kgrsize</emphasis>). Estimating a large value
77 should not affect performance, but exceeding this value will probably have disastrous
78 consequences.
79 </para>
80
81 </refsect1>
82
83 <refsect1>
84 <title>Performance</title>
85 <para>
86 <emphasis>kamp</emphasis> -- amplitude scaling
87 </para>
88 <para>
89 <emphasis>kfreq</emphasis> -- frequency of grain generation, or density, in grains/sec.
90 </para>
91
92 <para>
93 <emphasis>kpitch</emphasis> -- grain pitch scaling (1=normal pitch, &lt; 1 lower, > 1 higher; negative, backwards)
94 </para>
95
96 <para>
97 <emphasis>kgrsize</emphasis> -- grain size in secs.
98 </para>
99 <para>
100 <emphasis>kprate</emphasis> -- readout pointer rate, in grains. The value of 1 will advance
101 the reading pointer 1 grain ahead in the source table. Larger values
102 will time-compress and smaller values will time-expand the source signal.
103 Negative values will cause the pointer to run backwards and zero will
104 freeze it.
105 </para>
106 </refsect1>
107
108 <refsect1>
109 <title>Examples</title>
110 <para>
111 Here is an example of the syncgrain opcode. It uses the file <ulink url="examples/syncgrain.csd"><citetitle>syncgrain.csd</citetitle></ulink>.
112 <example>
113 <title>Example of the syncgrain opcode.</title>
114 <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>
115 <xi:include href="examples-xml/syncgrain.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
116 </example>
117 </para>
118 </refsect1>
119
120 <refsect1>
121 <title>See Also</title>
122 <para>
123 <link linkend="SiggenGranular"><citetitle>Granular Synthesis</citetitle></link>
124 </para>
125 </refsect1>
126
127 <refsect1>
128 <title>Credits</title>
129 <para>
130 <simplelist>
131 <member>Author: &namevictor;</member>
132 <member>January 2005</member>
133 </simplelist>
134 </para>
135
136 <para>New plugin in version 5</para>
137 <para>January 2005.</para>
138 </refsect1>
139 </refentry>