<?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>fog</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <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="fofilter.html" title="fofilter" /> <link rel="next" href="fold.html" title="fold" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">fog</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="fofilter.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="fold.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="fog"> <a id="fog"></a> <div class="titlepage"></div> <a id="IndexFog" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">fog</span> </h2> <p>fog — Audio output is a succession of grains derived from data in a stored function table </p> </div> <div class="refsect1" title="Description"> <a id="id2911866"></a> <h2>Description</h2> <p> Audio output is a succession of grains derived from data in a stored function table <span class="emphasis"><em>ifna</em></span>. The local envelope of these grains and their timing is based on the model of <span class="emphasis"><em>fof</em></span> synthesis and permits detailed control of the granular synthesis. </p> </div> <div class="refsect1" title="Syntax"> <a id="id2912683"></a> <h2>Syntax</h2> <pre class="synopsis">ares <span class="command"><strong>fog</strong></span> xamp, xdens, xtrans, aspd, koct, kband, kris, kdur, kdec, \ iolaps, ifna, ifnb, itotdur [, iphs] [, itmode] [, iskip]</pre> </div> <div class="refsect1" title="Initialization"> <a id="id2912702"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>iolaps</em></span> -- number of pre-located spaces needed to hold overlapping grain data. Overlaps are density dependent, and the space required depends on the maximum value of <span class="emphasis"><em>xdens</em></span> * <span class="emphasis"><em>kdur</em></span>. Can be over-estimated at no computation cost. Uses less than 50 bytes of memory per <span class="emphasis"><em>iolap</em></span>. </p> <p> <span class="emphasis"><em>ifna</em></span>, <span class="emphasis"><em>ifnb</em></span> -- table numbers of two stored functions. The first is the data used for granulation, usually from a soundfile (<a class="link" href="GEN01.html" title="GEN01"><em class="citetitle">GEN01</em></a>). The second is a rise shape, used forwards and backwards to shape the grain rise and decay; this is normally a sigmoid (<a class="link" href="GEN19.html" title="GEN19"><em class="citetitle">GEN19</em></a>) but may be linear (<a class="link" href="GEN05.html" title="GEN05"><em class="citetitle">GEN05</em></a>). </p> <p> <span class="emphasis"><em>itotdur</em></span> -- total time during which this <span class="emphasis"><em>fog</em></span> will be active. Normally set to p3. No new grain is created if it cannot complete its <span class="emphasis"><em>kdur</em></span> within the remaining <span class="emphasis"><em>itotdur</em></span>. </p> <p> <span class="emphasis"><em>iphs</em></span> (optional) -- initial phase of the fundamental, expressed as a fraction of a cycle (0 to 1). The default value is 0. </p> <p> <span class="emphasis"><em>itmode</em></span> (optional) -- transposition mode. If zero, each grain keeps the <span class="emphasis"><em>xtrans</em></span> value it was launched with. If non-zero, each is influenced by <span class="emphasis"><em>xtrans</em></span> continuously. The default value is 0. </p> <p> <span class="emphasis"><em>iskip</em></span> (optional, default=0) -- If non-zero, skip initialization (allows legato use). </p> </div> <div class="refsect1" title="Performance"> <a id="id2912823"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>xamp</em></span> -- amplitude factor. Amplitude is also dependent on the number of overlapping grains, the interaction of the rise shape (<span class="emphasis"><em>ifnb</em></span>) and the exponential decay (<span class="emphasis"><em>kband</em></span>), and the scaling of the grain waveform (<span class="emphasis"><em>ifna</em></span>). The actual amplitude may therefore exceed <span class="emphasis"><em>xamp</em></span>. </p> <p> <span class="emphasis"><em>xdens</em></span> -- density. The frequency of grains per second. </p> <p> <span class="emphasis"><em>xtrans</em></span> -- transposition factor. The rate at which data from the stored function table <span class="emphasis"><em>ifna</em></span> is read within each grain. This has the effect of transposing the original material. A value of 1 produces the original pitch. Higher values transpose upwards, lower values downwards. Negative values result in the function table being read backwards. </p> <p> <span class="emphasis"><em>aspd</em></span> -- Starting index pointer. <span class="emphasis"><em>aspd</em></span> is the normalized index (0 to 1) to table <span class="emphasis"><em>ifna</em></span> that determines the movement of a pointer used as the starting point for reading data within each grain. (<span class="emphasis"><em>xtrans</em></span> determines the rate at which data is read starting from this pointer.) </p> <p> <span class="emphasis"><em>koct</em></span> -- octaviation index. The operation of this parameter is identical to that in <a class="link" href="fof.html" title="fof"><em class="citetitle">fof</em></a>. </p> <p> <span class="emphasis"><em>kband</em></span>, <span class="emphasis"><em>kris</em></span>, <span class="emphasis"><em>kdur</em></span>, <span class="emphasis"><em>kdec</em></span> -- grain envelope shape. These parameters determine the exponential decay (<span class="emphasis"><em>kband</em></span>), and the rise (<span class="emphasis"><em>kris</em></span>), overall duration (<span class="emphasis"><em>kdur</em></span>,) and decay (<span class="emphasis"><em>kdec</em></span> ) times of the grain envelope. Their operation is identical to that of the local envelope parameters in <span class="emphasis"><em>fof</em></span>. </p> </div> <div class="refsect1" title="Examples"> <a id="id2912966"></a> <h2>Examples</h2> <p> </p> <div class="informalexample"> <pre class="programlisting"> ;p4 = transposition factor ;p5 = speed factor ;p6 = function table for grain data i1 = <span class="ohdr">sr</span><span class="op">/</span><span class="opc">ftlen</span>(p6) ;scaling to reflect sample rate and table length a1 <span class="opc">phasor</span> i1*p5 ;index for speed a2 <span class="opc">fog</span> 5000, 100, p4, a1, 0, 0, , .01, .02, .01, 2, p6, 1, p3, 0, 1 </pre> </div> <p> </p> </div> <div class="refsect1" title="Credits"> <a id="id2913013"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Michael Clark</td> </tr> <tr> <td>Huddersfield</td> </tr> <tr> <td>May 1997</td> </tr> </table> <p> </p> <p>New in version 3.46</p> <p> The Csound fog generator is by Michael Clarke, extending his earlier work based on IRCAM's FOF algorithm. </p> <p>Added notes by Rasmus Ekman on September 2002.</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="fofilter.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="fold.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">fofilter </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> fold</td> </tr> </table> </div> </body> </html>