Sophie

Sophie

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

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>lpread</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="lposcilsa2.html" title="lposcilsa2" />
    <link rel="next" href="lpreson.html" title="lpreson" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">lpread</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="lposcilsa2.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="lpreson.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="lpread">
      <a id="lpread"></a>
      <div class="titlepage"></div>
      <a id="IndexLpread" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">lpread</span>
        </h2>
        <p>lpread — 
      Reads a control file of time-ordered information frames.
          </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp29786312"></a>
        <h2>Description</h2>
        <p>
      Reads a control file of time-ordered information frames.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp29786984"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">krmsr, krmso, kerr, kcps <span class="command"><strong>lpread</strong></span> ktimpnt, ifilcod [, inpoles] [, ifrmrate]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp29797504"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifilcod</em></span> -- integer or character-string denoting a control-file (reflection coefficients and four parameter values) derived from n-pole linear predictive spectral analysis of a source audio signal. An integer denotes the suffix of a file <span class="emphasis"><em>lp.m</em></span>; a character-string (in double quotes) gives a filename, optionally a full pathname. If not fullpath, the file is sought first in the current directory, then in that of the environment variable SADIR (if defined). Memory usage depends on the size of the file, which is held entirely in memory during computation but shared by multiple calls (see also <span class="emphasis"><em>adsyn</em></span>, <a class="link" href="pvoc.html" title="pvoc"><em class="citetitle">pvoc</em></a>).
    </p>
        <p>
      <span class="emphasis"><em>inpoles</em></span> (optional, default=0) -- number of poles in the lpc analysis. It is required only when the control file does not have a header; it is ignored when a header is detected.
    </p>
        <p>
      <span class="emphasis"><em>ifrmrate</em></span> (optional, default=0) -- frame rate per second in the lpc analysis. It is required only when the control file does not have a header; it is ignored when a header is detected.
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp29834848"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>lpread</em></span> accesses a control file of time-ordered information frames, each containing n-pole filter coefficients derived from linear predictive analysis of a source signal at fixed time intervals (e.g. 1/100 of a second), plus four parameter values:
    </p>
        <p>
      <span class="emphasis"><em>krmsr</em></span> -- root-mean-square (rms) of the residual of analysis
    </p>
        <p>
      <span class="emphasis"><em>krmso</em></span> -- rms of the original signal
    </p>
        <p>
      <span class="emphasis"><em>kerr</em></span> -- the normalized error signal
    </p>
        <p>
      <span class="emphasis"><em>kcps</em></span> -- pitch in Hz
    </p>
        <p>
      <span class="emphasis"><em>ktimpnt</em></span> -- The passage of time, in seconds, through the analysis file. <span class="emphasis"><em>ktimpnt</em></span> must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.
    </p>
        <p>
      <span class="emphasis"><em>lpread</em></span> gets its values from the control file according to the input value <span class="emphasis"><em>ktimpnt</em></span> (in seconds). If <span class="emphasis"><em>ktimpnt</em></span> proceeds at the analysis rate, time-normal synthesis will result; proceeding at a faster, slower, or variable rate will result in time-warped synthesis. At each k-period, <span class="emphasis"><em>lpread</em></span> interpolates between adjacent frames to more accurately determine the parameter values (presented as output) and the filter coefficient settings (passed internally to a subsequent <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a>).
    </p>
        <p>The error signal <span class="emphasis"><em>kerr</em></span> (between 0 and 1) derived during predictive analysis reflects the deterministic/random nature of the analyzed source. This will emerge low for pitched (periodic) material and higher for noisy material. The transition from voiced to unvoiced speech, for example, produces an error signal value of about .3. During synthesis, the error signal value can be used to determine the nature of the <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a> driving function: for example, by arbitrating between pitched and non-pitched input, or even by determining a mix of the two. In normal speech resynthesis, the pitched input to <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a> is a wideband periodic signal or pulse train derived from a unit such as <a class="link" href="buzz.html" title="buzz"><em class="citetitle">buzz</em></a>, and the nonpitched source is usually derived from <a class="link" href="rand.html" title="rand"><em class="citetitle">rand</em></a>. However, any audio signal can be used as the driving function, the only assumption of the analysis being that it has a flat response.
    </p>
        <p><a class="link" href="lpfreson.html" title="lpfreson"><em class="citetitle">lpfreson</em></a> is a formant shifted <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a>, in which <span class="emphasis"><em>kfrqratio</em></span> is the (cps) ratio of shifted to original formant positions. This permits synthesis in which the source object changes its apparent acoustic size. <a class="link" href="lpfreson.html" title="lpfreson"><em class="citetitle">lpfreson</em></a> with <span class="emphasis"><em>kfrqratio</em></span> = 1 is equivalent to <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a>.
    </p>
        <p>Generally, <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a> provides a means whereby the time-varying content and spectral shaping of a composite audio signal can be controlled by the dynamic spectral content of another. There can be any number of lpread/lpreson (or lpfreson) pairs in an instrument or in an orchestra; they can read from the same or different control files independently.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp29847712"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the lpread opcode. It uses the file <a class="ulink" href="examples/lpread.csd" target="_top"><em class="citetitle">lpread.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp29848680"></a>
          <p class="title">
            <strong>Example 426. Example of the lpread 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 realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o lpread.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">; works with or without -a option when analyzing "fox.wav" from the manual</span>
ilen  <span class="opc">filelen</span> "fox.wav"	<span class="comment">; length of soundfile</span>
<span class="opc">prints</span> "fox.wav <span class="op">=</span> <span class="op">%</span>f seconds\\n",ilen

ktime <span class="opc">line</span> 0, p3, p4
krmsr,krmso,kerr,kcps <span class="opc">lpread</span> ktime,"fox_poles.lpc"
krmso <span class="op">=</span> krmso<span class="op">*</span>.00007			<span class="comment">; low volume</span>
aout  <span class="opc">buzz</span> krmso, kcps, 15, 1
krmsr <span class="op">=</span> krmsr<span class="op">*</span>.0001			<span class="comment">; low volume</span>
asig  <span class="opc">rand</span> krmsr
      <span class="opc">outs</span> (aout<span class="op">*</span>2)<span class="op">+</span>asig, (aout<span class="op">*</span>2)<span class="op">+</span>asig	<span class="comment">; mix buzz and rand</span>

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="comment">; sine</span>
<span class="stamnt">f</span>1 0 4096 10 1 

<span class="stamnt">i</span> 1 0 2.8 1	<span class="comment">; first words only</span>
<span class="stamnt">i</span> 1 4 2.8 2.8	<span class="comment">; whole sentence</span>
<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" />
      The audio file <span class="quote">“<span class="quote">fox.wav</span>”</span> is 2.8 seconds long. So <span class="emphasis"><em>filelen</em></span>'s output should be a line like this:
      </p>
        <pre class="screen">
fox.wav = 2.756667 seconds
      </pre>
        <p>
    </p>
      </div>
      <div class="refsect1" title="See Also">
        <a id="idp29851824"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="lpfreson.html" title="lpfreson"><em class="citetitle">lpfreson</em></a>, 
      <a class="link" href="lpreson.html" title="lpreson"><em class="citetitle">lpreson</em></a>, 
      <a class="link" href="lpanal.html" title="lpanal"><em class="citetitle">LPANAL</em></a> 
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="lposcilsa2.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="lpreson.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">lposcilsa2 </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> lpreson</td>
        </tr>
      </table>
    </div>
  </body>
</html>