Debian Codegraph @

opcodes/loscil3.xml

raw symbols SCIP
1
2 <refentry id="loscil3">
3 <indexterm id="IndexLoscil3"><primary>loscil3</primary></indexterm>
4 <refentryinfo><title>Signal Generators:Sample Playback</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>loscil3</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>loscil3</refname>
11 <refpurpose>
12 Read sampled sound from a table using cubic interpolation. A version that outputs the exact
13 table position (phase) corresponding to the output sample is
14 provided as an alternative opcode.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Read sampled sound (mono or stereo) from a table, with optional sustain and release looping, using cubic interpolation.
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>ar1 [,ar2] <command>loscil3</command> xamp, kcps, ifn [, ibas] [, imod1] [, ibeg1] [, iend1] \
28 [, imod2] [, ibeg2] [, iend2]</synopsis>
29 <synopsis>aph, ar1 [,ar2] <command>loscil3phs</command> xamp, kcps, ifn [, ibas] [, imod1] [, ibeg1] [, iend1] \
30 [, imod2] [, ibeg2] [, iend2]</synopsis>
31 </refsect1>
32
33 <refsect1>
34 <title>Initialization</title>
35 <para>
36 <emphasis>ifn</emphasis> -- function table number, typically denoting an sampled sound segment with prescribed looping points loaded using <link linkend="GEN01"><citetitle>GEN01</citetitle></link>. The source file may be mono or stereo.
37 </para>
38
39 <para>
40 <emphasis>ibas</emphasis> (optional) -- base frequency in <emphasis>Hz</emphasis> of the recorded sound. This optionally overrides the frequency given in the audio file, but is required if the file did not contain one. The default value is 261.626 Hz, i.e. middle C. (New in Csound 4.03). If this value is not known or not present, use 1 here and in <emphasis>kcps</emphasis>.
41 </para>
42
43 <para>
44 <emphasis>imod1, imod2</emphasis> (optional, default=-1) -- play modes for the sustain and release loops. A value of 1 denotes normal looping, 2 denotes forward &amp; backward looping, 0 denotes no looping. The default value (-1) will defer to the mode and the looping points given in the source file. Make sure you select an appropriate mode if the file does not contain this information.
45 </para>
46
47 <para>
48 <emphasis>ibeg1, iend1, ibeg2, iend2</emphasis> (optional, dependent on <emphasis>mod1, mod2</emphasis>) -- begin and end points of the sustain and release loops. These are measured in <emphasis>sample frames</emphasis> (a set of samples with the same timestamp, one for each channel. Mono: 1 frame = 1 sample. Stereo: 1 frame = 2 samples etc.) from the beginning of the file, so will look the same whether the sound segment is monaural or stereo. If no loop points are specified, and a looping mode (<emphasis>imod1</emphasis>, <emphasis>imod2</emphasis>) is given, the file will be looped for the whole length.
49 </para>
50 </refsect1>
51
52 <refsect1>
53 <title>Performance</title>
54 <para>
55 <emphasis>aph</emphasis> -- the normalised table position
56 corresponding to the output sample (loscil3phs only).
57 </para>
58 <para>
59 <emphasis>ar1, ar2</emphasis> -- the output at audio-rate. There is just <emphasis>ar1</emphasis> for mono output. However, there is both <emphasis>ar1</emphasis> and <emphasis>ar2</emphasis> for stereo output.
60 </para>
61
62 <para>
63 <emphasis>xamp</emphasis> -- the amplitude of the output signal.
64 </para>
65
66 <para>
67 <emphasis>kcps</emphasis> -- the frequency of the output signal in cycles per second.
68 </para>
69
70 <para>
71 <emphasis>loscil3</emphasis> is identical to <link linkend="loscil"><citetitle>loscil</citetitle></link> except that it uses cubic interpolation. New in Csound version 3.50.
72 </para>
73
74 <caution>
75 <title>Note to Windows users</title>
76 <para>
77 Windows users typically use back-slashes, <quote>\</quote>, when specifying the paths of their files. As an example, a Windows user might use the path <quote>c:\music\samples\loop001.wav</quote>. This is problematic because back-slashes are normally used to specify special characters.
78 </para>
79 <para>
80 To correctly specify this path in Csound, one may alternately:
81 <itemizedlist>
82 <listitem><para><emphasis>Use forward slashes</emphasis>: c:/music/samples/loop001.wav</para></listitem>
83 <listitem><para><emphasis>Use back-slash special characters, <quote>\\</quote></emphasis>: c:\\music\\samples\\loop001.wav</para></listitem>
84 </itemizedlist>
85 </para>
86 </caution>
87 <note>
88 <title>Note</title>
89 <para>
90 This is mono loscil3:
91
92 <informalexample>
93 <programlisting>
94 a1 <emphasis role="opc">loscil3</emphasis> 10000, 1, 1, 1, 1</programlisting>
95 </informalexample>
96
97 ...and this is stereo loscil3:
98
99 <informalexample>
100 <programlisting>
101 a1, a2 <emphasis role="opc">loscil3</emphasis> 10000, 1, 1, 1, 1</programlisting>
102 </informalexample>
103 </para>
104 </note>
105 </refsect1>
106
107 <refsect1>
108 <title>Examples</title>
109 <para>
110 Here is an example of the loscil3 opcode. It uses the file <ulink url="examples/loscil3.csd"><citetitle>loscil3.csd</citetitle></ulink>, <ulink url="examples/drumsMlp.wav"><citetitle>drumsMlp.wav</citetitle></ulink> and <ulink url="examples/drumsSlp.wav"><citetitle>drumsSlp.wav</citetitle></ulink>.
111 <example>
112 <title>Example of the loscil3 opcode.</title>
113 <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>
114 <xi:include href="examples-xml/loscil3.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
115 </example>
116 </para>
117 </refsect1>
118
119 <refsect1>
120 <title>See also</title>
121 <para><link linkend="SiggenSample"><citetitle>Sample Playback</citetitle></link></para>
122 </refsect1>
123
124 <refsect1>
125 <title>Credits</title>
126 <para>Note about the mono/stereo difference was contributed by &namerasmus;.</para>
127 </refsect1>
128 </refentry>