Debian Codegraph @

opcodes/syncphasor.xml

raw symbols SCIP
1
2 <refentry id="syncphasor">
3 <indexterm id="IndexSyncPhasor"><primary>syncphasor</primary></indexterm>
4 <refentryinfo><title>Signal Generators:Phasors</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>syncphasor</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>syncphasor</refname>
13 <refpurpose>
14 Produces a normalized moving phase value with sync input and output.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Produces a moving phase value between zero and one and an extra impulse output ("sync out") whenever its phase value crosses or is reset to zero. The phase can be reset at any time by an impulse on the "sync in" parameter.
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>aphase, asyncout <command>syncphasor</command> xcps, asyncin, [, iphs]</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Initialization</title>
32 <para>
33 <emphasis>iphs</emphasis> (optional) -- initial phase, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is zero.
34 </para>
35 </refsect1>
36
37 <refsect1>
38 <title>Performance</title>
39 <para>
40 <emphasis>aphase</emphasis> -- the output phase value; always between 0 and 1.
41 </para>
42
43 <para>
44 <emphasis>asyncout</emphasis> -- the sync output has a value of 1.0 for one sample whenever the phase value crosses zero or whenever the sync input is non-zero. It is zero at all other times.
45 </para>
46
47 <para>
48 <emphasis>asyncin</emphasis> -- the sync input causes the phase to reset to zero whenever <emphasis>asyncin</emphasis> is non-zero.
49 </para>
50
51 <para>
52 <emphasis>xcps</emphasis> -- frequency of the phasor in cycles-per-second. If <emphasis>xcps</emphasis> is negative, the phase value will decrease from 1 to 0 instead of increasing.
53 </para>
54
55 <para>
56 An internal phase is successively accumulated in accordance with the <emphasis>xcps</emphasis> frequency to produce a moving phase value, normalized to lie in the range 0 &lt;= phs &lt; 1. When used as the index to a <link linkend="table"><citetitle>table</citetitle></link> unit, this phase (multiplied by the desired function table length) will cause it to behave like an oscillator.
57 </para>
58
59 <para>
60 The phase of <emphasis>syncphasor</emphasis> though can be synced to another phasor (or other signal) using the <emphasis>asyncin</emphasis> parameter. Any time that <emphasis>asyncin</emphasis> is a non-zero value, the value of <emphasis>aphase</emphasis> will be reset to zero. <emphasis>syncphasor</emphasis> also outputs its own "sync" signal that consists of a one-sample impulse whenever its phase crosses zero or is reset. This makes it easy to chain together multiple <emphasis>syncphasor</emphasis> opcodes to create an oscillator "hard sync" effect.
61 </para>
62
63 </refsect1>
64
65 <refsect1>
66 <title>Examples</title>
67 <para>
68 Here is an example of the syncphasor opcode. It uses the file <ulink url="examples/syncphasor.csd"><citetitle>syncphasor.csd</citetitle></ulink>.
69
70 <example>
71 <title>Example of the syncphasor opcode.</title>
72
73 <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>
74 <xi:include href="examples-xml/syncphasor.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
75 </example>
76 </para>
77 <para>
78 Here is another example of the syncphasor opcode. It uses the file <ulink url="examples/syncphasor-CZresonance.csd"><citetitle>syncphasor-CZresonance.csd</citetitle></ulink>.
79 <example>
80 <title>Another example of the syncphasor opcode.</title>
81 <xi:include href="examples-xml/syncphasor-CZresonance.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
82 </example>
83 </para>
84 </refsect1>
85
86 <refsect1>
87 <title>See also</title>
88 <para><link linkend="SiggenPhasors"><citetitle>Phasors</citetitle></link></para>
89 </refsect1>
90
91 <refsect1>
92 <title>Credits</title>
93 <para>
94 <simplelist>
95 <member>Adapted from the <emphasis>phasor</emphasis> opcode by &nameanthony;</member>
96 <member>January 2008</member>
97 </simplelist>
98 </para>
99
100 <para>New in Csound version 5.08</para>
101 </refsect1>
102 </refentry>