Debian Codegraph @

opcodes/ptrack.xml

raw symbols SCIP
1
2 <refentry id="ptrack">
3 <indexterm id="Indexptrack"><primary>ptrack</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>ptrack</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>ptrack</refname>
11 <refpurpose>
12 Tracks the pitch of a signal.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 <emphasis>ptrack</emphasis> takes an input signal, splits it into <emphasis>ihopsize</emphasis> blocks and using a STFT method, extracts an estimated pitch for its fundamental frequency as well as estimating the total amplitude of the signal in dB, relative to full-scale (0dB). The method implies an analysis window size of 2*<emphasis>ihopsize</emphasis> samples (overlaping by 1/2 window), which has to be a power-of-two, between 128 and 8192 (hopsizes between 64 and 4096). Smaller windows will give better time precision, but worse frequency accuracy (esp. in low fundamentals).This opcode is based on an original algorithm by M. Puckette.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>kcps, kamp <command>ptrack</command> asig, ihopsize[,ipeaks]</synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Initialization</title>
30 <para>
31 <emphasis>ihopsize</emphasis> -- size of the analysis 'hop', in samples, required to be power-of-two (min 64, max 4096).
32 This is the period between measurements.
33 </para>
34
35 <para>
36 <emphasis>ipeaks</emphasis>, <emphasis>ihi</emphasis> -- number of spectral peaks to use in the analysis, defaults to 20 (optional)
37 </para>
38 </refsect1>
39 <refsect1>
40 <title>Performance</title>
41 <para>
42 <emphasis>kcps</emphasis> -- estimated pitch in Hz.
43 </para>
44
45 <para>
46 <emphasis>kamp</emphasis> -- estimated amplitude in dB relative to full-scale (0dB) (ie. always &lt;= 0).
47 </para>
48
49 <para>
50 <emphasis>ptrack</emphasis> analyzes the input signal, <emphasis>asig</emphasis>,
51 to give a pitch/amplitude pair of outputs, for the fundamental of a monophonic signal.
52 The output is updated every <emphasis>sr/ihopsize</emphasis> seconds.
53 </para>
54 </refsect1>
55
56 <refsect1>
57 <title>Examples</title>
58 <para>
59 Here is an example of the ptrack opcode. This example uses the files <ulink url="examples/ptrack.csd"><citetitle>ptrack.csd</citetitle></ulink>.
60 <example>
61 <title>Example of the ptrack opcode.</title>
62
63 See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link>
64 and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.
65 <xi:include href="examples-xml/ptrack.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
66
67 </example>
68 </para>
69 </refsect1>
70
71 <refsect1>
72 <title>See also</title>
73 <para><link linkend="ControlSensing"><citetitle>Sensing and Control: Tempo and Pitch estimation</citetitle></link></para>
74 </refsect1>
75
76 <refsect1>
77 <title>Credits</title>
78 <para>
79 <simplelist>
80 <member>Author: &namevictor;</member>
81 <member>NUI, Maynooth.</member>
82 <member>Maynooth, Ireland</member>
83 <member>March, 2007</member>
84 </simplelist>
85 </para>
86
87 <para>New in Csound version 5.05</para>
88 </refsect1>
89 </refentry>