<?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>pvsftw</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <link rel="stylesheet" type="text/css" href="syntax-highlighting.css" /> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /> <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="pvsftr.html" title="pvsftr" /> <link rel="next" href="pvsfwrite.html" title="pvsfwrite" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">pvsftw</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="pvsftr.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="pvsfwrite.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="pvsftw"></a> <div class="titlepage"></div> <a id="IndexPvsftw" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">pvsftw</span> </h2> <p>pvsftw — Writes amplitude and/or frequency data to function tables. </p> </div> <div class="refsect1"> <a id="idm281472898965976"></a> <h2>Description</h2> <p> Writes amplitude and/or frequency data to function tables. </p> </div> <div class="refsect1"> <a id="idm281472898886728"></a> <h2>Syntax</h2> <pre class="synopsis">kflag <span class="command"><strong>pvsftw</strong></span> fsrc, ifna [, ifnf]</pre> </div> <div class="refsect1"> <a id="idm281472898884648"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>ifna</em></span> -- A table, at least inbins in size, that stores amplitude data. Ignored if ifna = 0 </p> <p> <span class="emphasis"><em>ifnf</em></span> -- A table, at least inbins in size, that stores frequency data. Ignored if ifnf = 0 </p> </div> <div class="refsect1"> <a id="idm281472898882024"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>kflag</em></span> -- A flag that has the value of 1 when new data is available, 0 otherwise. </p> <p> <span class="emphasis"><em>fsrc</em></span> -- a PVOC-EX formatted source. </p> <p> Enables the contents of <span class="emphasis"><em>fsrc</em></span> to be exchanged with function tables, for custom processing. Except when the frame overlap equals <span class="emphasis"><em>ksmps</em></span> (which will generally not be the case), the frame data is not updated each control period. The data in <span class="emphasis"><em>ifna</em></span>, <span class="emphasis"><em>ifnf</em></span> should only be processed when <span class="emphasis"><em>kflag</em></span> is set to 1. To process only frequency data, set <span class="emphasis"><em>ifna</em></span> to zero. </p> <p> As the functions tables are required only to store data from <span class="emphasis"><em>fsrc</em></span>, there is no advantage in defining then in the score. They should generally be created in the instrument using <a class="link" href="ftgen.html" title="ftgen"><em class="citetitle">ftgen</em></a>. </p> <p> By exporting amplitude data, say, from one fsig and importing it into another, basic cross-synthesis (as in <a class="link" href="pvscross.html" title="pvscross"><em class="citetitle">pvscross</em></a>) can be performed, with the option to modify the data beforehand using the table manipulation opodes. </p> <p> Note that the format data in the source fsig is not written to the tables. This therefore offers a means of transferring amplitude and frequency data between non-identical fsigs. Used this way, these opcodes become potentially pathological, and can be relied upon to produce unexpected results. In such cases, resynthesis using <a class="link" href="pvsadsyn.html" title="pvsadsyn"><em class="citetitle">pvsadsyn</em></a> would almost certainly be required. </p> <p> To perform a straight copy from one fsig to another one of identical format, the conventional assignment syntax can be used: </p> <div class="literallayout"> <p> <br /> fsig1 = fsig2<br /> </p> </div> <p> It is not necessary to use function tables in this case. </p> </div> <div class="refsect1"> <a id="idm281472898869320"></a> <h2>Examples</h2> <p> Here is an example of the pvsftw opcode. It uses the file <a class="ulink" href="examples/pvsftw.csd" target="_top"><em class="citetitle">pvsftw.csd</em></a>. </p> <div class="example"> <a id="idm281472898867464"></a> <p class="title"> <strong>Example 762. Example of the pvsftw 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> <div class="refsect1"> <a id="idm281472720042152"></a> <pre class="programlisting"> <span class="nt"><CsoundSynthesizer></span> <span class="nt"><CsOptions></span> <span class="c1">; Select audio/midi flags here according to platform</span> -odac <span class="c1">;;;realtime audio out</span> <span class="c1">;-iadc ;;;uncomment -iadc if realtime audio input is needed too</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o pvsftw.wav -W ;;; for file output any platform</span> <span class="nt"></CsOptions></span> <span class="nt"><CsInstruments></span> <span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span> <span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">32</span> <span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">2</span> <span class="vg">0dbfs</span> <span class="o">=</span> <span class="mi">1</span> <span class="kd">instr</span> <span class="nf">1</span> i<span class="n">nbins</span> <span class="o">=</span> <span class="mi">512</span> i<span class="n">fn</span> <span class="nb">ftgen</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span>i<span class="n">nbins</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">1</span> <span class="c1">; make ftable</span> <span class="n">fsrc</span> <span class="nb">pvsdiskin</span> <span class="s">"fox.pvx"</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span> <span class="c1">; read PVOCEX file</span> k<span class="n">flag</span> <span class="nb">pvsftw</span> <span class="n">fsrc</span><span class="p">,</span>i<span class="n">fn</span> <span class="c1">; export amps to table,</span> k<span class="n">amp</span> <span class="nb">init</span> <span class="mi">0</span> <span class="k">if</span> k<span class="n">flag</span><span class="o">==</span><span class="mi">0</span> <span class="k">kgoto</span> <span class="nl">contin</span> <span class="c1">; only proc when frame is ready </span> <span class="nb">tablew</span> k<span class="n">amp</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span>i<span class="n">fn</span> <span class="c1">; kill lowest bins, for obvious effect</span> <span class="nb">tablew</span> k<span class="n">amp</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span>i<span class="n">fn</span> <span class="nb">tablew</span> k<span class="n">amp</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span>i<span class="n">fn</span> <span class="nb">tablew</span> k<span class="n">amp</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span>i<span class="n">fn</span> <span class="c1">; read modified data back to fsrc</span> <span class="nb">pvsftr</span> <span class="n">fsrc</span><span class="p">,</span>i<span class="n">fn</span> <span class="nl">contin</span><span class="p">:</span> <span class="c1">; and resynth</span> a<span class="n">out</span> <span class="nb">pvsynth</span> <span class="n">fsrc</span> <span class="nb">outs</span> a<span class="n">out</span><span class="p">,</span> a<span class="n">out</span> <span class="kd">endin</span> <span class="nt"></CsInstruments></span> <span class="nt"><CsScore></span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">4</span> <span class="nb">e</span> <span class="nt"></CsScore></span> <span class="nt"></CsoundSynthesizer></span> </pre> </div> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1"> <a id="idm281472898863176"></a> <h2>See Also</h2> <p> <a class="link" href="pvsftr.html" title="pvsftr"><em class="citetitle">pvsftr</em></a> </p> </div> <div class="refsect1"> <a id="idm281472898861128"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Richard Dobson</td> </tr> <tr> <td>August 2001 </td> </tr> </table> <p> </p> <p>New in version 4.13</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="pvsftr.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="pvsfwrite.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">pvsftr </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> pvsfwrite</td> </tr> </table> </div> </body> </html>