Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > b707d9a4ee443103660a75ccb6e51334 > files > 2364

csound-doc-5.19.01-10.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>pitch</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="pinkish.html" title="pinkish" />
    <link rel="next" href="pitchamdf.html" title="pitchamdf" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">pitch</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="pinkish.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="pitchamdf.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="pitch">
      <a id="pitch"></a>
      <div class="titlepage"></div>
      <a id="IndexPitch" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">pitch</span>
        </h2>
        <p>pitch — 
      Tracks the pitch of a signal.
          </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp36330320"></a>
        <h2>Description</h2>
        <p>
      Using the same techniques as <a class="link" href="spectrum.html" title="spectrum"><em class="citetitle">spectrum</em></a> and <a class="link" href="specptrk.html" title="specptrk"><em class="citetitle">specptrk</em></a>, pitch tracks the pitch of the signal in octave point decimal form, and amplitude in dB.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp36380672"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">koct, kamp <span class="command"><strong>pitch</strong></span> asig, iupdte, ilo, ihi, idbthresh [, ifrqs] [, iconf] \
      [, istrt] [, iocts] [, iq] [, inptls] [, irolloff] [, iskip]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp36382056"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>iupdte</em></span> -- length of period, in seconds, that outputs are updated
    </p>
        <p>
      <span class="emphasis"><em>ilo</em></span>, <span class="emphasis"><em>ihi</em></span> -- range in which pitch is detected, expressed in octave point decimal
    </p>
        <p>
      <span class="emphasis"><em>idbthresh</em></span> -- amplitude, expressed in decibels, necessary for the pitch to be detected.  Once started it continues until it is 6 dB down.
    </p>
        <p>
      <span class="emphasis"><em>ifrqs</em></span> (optional) -- number of divisons of an octave. Default is 12 and is limited to 120.
    </p>
        <p>
      <span class="emphasis"><em>iconf</em></span> (optional) -- the number of conformations needed for an octave jump.  Default is 10. 
    </p>
        <p>
      <span class="emphasis"><em>istrt</em></span> (optional) -- starting pitch for tracker. Default value is (<span class="emphasis"><em>ilo</em></span> + <span class="emphasis"><em>ihi</em></span>)/2.
    </p>
        <p>
      <span class="emphasis"><em>iocts</em></span> (optional) -- number of octave decimations in spectrum. Default is 6.
    </p>
        <p>
      <span class="emphasis"><em>iq</em></span> (optional) -- Q of analysis filters. Default is 10.
    </p>
        <p>
      <span class="emphasis"><em>inptls</em></span> (optional) -- number of harmonics, used in matching. Computation time increases with the number of harmonics. Default is 4.
    </p>
        <p>
      <span class="emphasis"><em>irolloff</em></span> (optional) -- amplitude rolloff for the set of filters expressed as fraction per octave. Values must be positive. Default is 0.6.
    </p>
        <p>
      <span class="emphasis"><em>iskip</em></span> (optional) -- if non-zero, skips initialization. Default is 0.
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp36389664"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>koct</em></span> -- The pitch output, given in the octave point decimal format.
    </p>
        <p>
      <span class="emphasis"><em>kamp</em></span> -- The amplitude output.
    </p>
        <p>
      <span class="emphasis"><em>pitch</em></span> analyzes the input signal, <span class="emphasis"><em>asig</em></span>, to give a pitch/amplitude pair of outputs, for the strongest frequency in the signal. The value is updated every <span class="emphasis"><em>iupdte</em></span> seconds.
    </p>
        <p>
      The number of partials and rolloff fraction can effect the pitch tracking, so some experimentation may be necessary. Suggested values are 4 or 5 harmonics, with rolloff 0.6, up to 10 or 12 harmonics with rolloff 0.75 for complex timbres, with a weak fundamental.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp36392912"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the pitch opcode. It uses the file <a class="ulink" href="examples/pitch.csd" target="_top"><em class="citetitle">pitch.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp36393888"></a>
          <p class="title">
            <strong>Example 593. Example of the pitch opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac     <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if real audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o pitch.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

<span class="oblock">instr</span> 1	<span class="comment">;clean audio</span>

asig <span class="opc">soundin</span> p4
     <span class="opc">outs</span> asig, asig
<span class="oblock">endin</span>

<span class="oblock">instr</span> 2	<span class="comment">;use pitch</span>

iupdte <span class="op">=</span> 0.001	<span class="comment">;high definition</span>
ilo <span class="op">=</span> 6
ihi <span class="op">=</span> 10
idbthresh <span class="op">=</span> 10
ifrqs <span class="op">=</span> 12
iconf <span class="op">=</span> 10
istrt <span class="op">=</span> 8

asig <span class="opc">soundin</span> p4
koct, kamp <span class="opc">pitch</span> asig, iupdte, ilo, ihi, idbthresh, ifrqs, iconf, istrt
kamp <span class="op">=</span> kamp<span class="op">*</span>.00005		<span class="comment">;lower volume</span>
kcps <span class="op">=</span> <span class="opc">cpsoct</span>(koct)
asig <span class="opc">poscil</span> kamp, kcps, 1	<span class="comment">;re-synthesize with sawtooth</span>
     <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span>1 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111   <span class="comment">;sawtooth</span>

<span class="stamnt">i</span> 1 0  3 "fox.wav"
<span class="stamnt">i</span> 2 3  3 "fox.wav"
<span class="stamnt">i</span> 1 6  3 "mary.wav"
<span class="stamnt">i</span> 2 9  3 "mary.wav"
<span class="stamnt">i</span> 1 12 3 "beats.wav"
<span class="stamnt">i</span> 2 15 3 "beats.wav"
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp36396192"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: John ffitch</td>
          </tr>
          <tr>
            <td>University of Bath, Codemist Ltd.</td>
          </tr>
          <tr>
            <td>Bath, UK</td>
          </tr>
          <tr>
            <td>April 1999</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in Csound version 3.54</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="pinkish.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="pitchamdf.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">pinkish </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> pitchamdf</td>
        </tr>
      </table>
    </div>
  </body>
</html>