Debian Codegraph @

opcodes/ntrpol.xml

raw symbols SCIP
1
2 <refentry id="ntrpol">
3 <indexterm id="IndexNtrpol"><primary>ntrpol</primary></indexterm>
4 <refentryinfo><title>Signal Modifiers:Sample Level Operators</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>ntrpol</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>ntrpol</refname>
13 <refpurpose>
14 Calculates the weighted mean value of two input signals.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Calculates the weighted mean value (i.e. linear interpolation) of two input signals
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>ares <command>ntrpol</command> asig1, asig2, kpoint [, imin] [, imax]</synopsis>
28
29 <synopsis>ires <command>ntrpol</command> isig1, isig2, ipoint [, imin] [, imax]</synopsis>
30
31 <synopsis>kres <command>ntrpol</command> ksig1, ksig2, kpoint [, imin] [, imax]</synopsis>
32 </refsect1>
33
34 <refsect1>
35 <title>Initialization</title>
36 <para>
37 <emphasis>imin</emphasis> -- minimum xpoint value (optional, default 0)
38 </para>
39
40 <para>
41 <emphasis>imax</emphasis> -- maximum xpoint value (optional, default 1)
42 </para>
43 </refsect1>
44
45 <refsect1>
46 <title>Performance</title>
47 <para>
48 <emphasis>xsig1</emphasis>, <emphasis>xsig2</emphasis> -- input signals
49 </para>
50
51 <para>
52 <emphasis>xpoint</emphasis> -- interpolation point between the two values
53 </para>
54
55 <para>
56 <emphasis>ntrpol</emphasis> opcode outputs the linear interpolation between two input values. <emphasis>xpoint</emphasis> is the distance of evaluation point from the first value. With the default values of <emphasis>imin</emphasis> and <emphasis>imax</emphasis>, (0 and 1) a zero value indicates no distance from the first value and the maximum distance from the second one. With a 0.5 value, <emphasis>ntrpol</emphasis> will output the mean value of the two inputs, indicating the exact half point between <emphasis>xsig1</emphasis> and <emphasis>xsig2</emphasis>. A 1 value indicates the maximum distance from the first value and no distance from the second one. The range of <emphasis>xpoint</emphasis> can be also defined with <emphasis>imin</emphasis> and <emphasis>imax</emphasis> to make its management easier.
57 </para>
58
59 <para>
60 These opcodes are useful for crossfading two signals.
61 </para>
62 </refsect1>
63
64 <refsect1>
65 <title>Examples</title>
66 <para>
67 Here is an example of the ntrpol opcode. It uses the file <ulink url="examples/ntrpol.csd"><citetitle>ntrpol.csd</citetitle></ulink>.
68 <example>
69 <title>Example of the ntrpol opcode.</title>
70 <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>
71 <xi:include href="examples-xml/ntrpol.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
72 </example>
73 </para>
74 </refsect1>
75
76 <refsect1>
77 <title>See also</title>
78 <para><link linkend="SigmodSample"><citetitle>Sample Level Operators</citetitle></link></para>
79 </refsect1>
80
81 <refsect1>
82 <title>Credits</title>
83 <para>
84 <simplelist>
85 <member>Author: &namegabriel;</member>
86 <member>Italy</member>
87 <member>October 1998</member>
88 </simplelist>
89 </para>
90
91 <para>New in Csound version 3.49</para>
92 </refsect1>
93 </refentry>