<?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>GENexp</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="ScoregensTop.html" title="Score Statements and GEN Routines" /> <link rel="prev" href="GENtanh.html" title="GENtanh" /> <link rel="next" href="GENsone.html" title="GENsone" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">GENexp</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="GENtanh.html">Prev</a> </td> <th width="60%" align="center">Score Statements and GEN Routines</th> <td width="20%" align="right"> <a accesskey="n" href="GENsone.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="GENexp"> <a id="GENexp"></a> <div class="titlepage"></div> <a id="IndexGENexp" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">GENexp</span> </h2> <p>"exp" — Generate a table with values on the exp function. </p> </div> <div class="refsect1" title="Description"> <a id="idp78581904"></a> <h2>Description</h2> <p> Creates an ftable with values of the exp function. </p> </div> <div class="refsect1" title="Syntax"> <a id="idp78582560"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>f</strong></span> # time size "exp" start end rescale</pre> </div> <div class="refsect1" title="Initialization"> <a id="idp78569432"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>size</em></span> -- number of points in the table. Must be a power of 2 or power-of-2 plus 1 (see <a class="link" href="f.html" title="f Statement (or Function Table Statement)"><em class="citetitle">f statement</em></a>). </p> <p> <span class="emphasis"><em>start, end</em></span> -- first and last value to be stored; the GEN draws a curve that goes from start to end: exp(start) .... exp(end). The points stored are uniformly spaced between these to the table size </p> <p> <span class="emphasis"><em>rescale</em></span> -- if not zero the table is not rescaled </p> </div> <div class="refsect1" title="Examples"> <a id="idp78619800"></a> <h2>Examples</h2> <p> Here is a simple example of the GENexp routine. It uses the file <a class="ulink" href="examples/genexp.csd" target="_top"><em class="citetitle">genexp.csd</em></a>. </p> <div class="example"> <a id="idp78620784"></a> <p class="title"> <strong>Example 1074. Example of the GENexp routine.</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"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></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 genexp.wav -W ;;; for file output any platform</span> <span class="csdtag"></CsOptions></span> <span class="csdtag"><CsInstruments></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 aswp <span class="opc">linseg</span> 0.01, p3<span class="op">*</span>.5, .49, p3<span class="op">*</span>.5, 0.01 <span class="comment">;index sweep function</span> aindex <span class="opc">poscil</span> aswp, 110, 1 <span class="comment">;sound to waveshape</span> atable <span class="opc">tablei</span> aindex, p4, 1, .5 <span class="comment">;waveshape index</span> aenv <span class="opc">linen</span> 0.8, .01, p3, .02 <span class="comment">;amplitude envelope</span> asig <span class="op">=</span> (atable<span class="op">*</span>aenv)<span class="op">*</span>p5 <span class="comment">;impose envelope and scale</span> asig <span class="opc">dcblock2</span> asig <span class="comment">;get rid of DC</span> <span class="opc">outs</span> asig, asig <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">f</span> 1 0 8192 10 1 <span class="comment">;sine wave</span> <span class="stamnt">f</span> 2 0 8192 "exp" 0 15 0 <span class="stamnt">f</span> 3 0 8192 "exp" 0 3 0 <span class="stamnt">i</span>1 0 3 2 2 <span class="stamnt">i</span>1 + 3 3 3 <span class="stamnt">e</span> <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> </div> <p><br class="example-break" /> <span>These are the diagrams of the waveforms of the GENexp routines, as used in the example:</span> </p> <div class="mediaobject"> <img src="images/genexp_1.png" alt="f 2 0 8192 "exp" 0 15 0" /> <div class="caption"> <p> f 2 0 8192 "exp" 0 15 0</p> </div> </div> <p> </p> <div class="mediaobject"> <img src="images/genexp_2.png" alt="f 3 0 8192 "exp" 0 3 0" /> <div class="caption"> <p> f 3 0 8192 "exp" 0 3 0</p> </div> </div> <p> </p> </div> <div class="refsect1" title="See Also"> <a id="idp78626728"></a> <h2>See Also</h2> <p> <a class="link" href="GENexp.html" title="GENexp"><em class="citetitle">GENexp</em></a> and <a class="link" href="GENsone.html" title="GENsone"><em class="citetitle">GENsone</em></a>. </p> <p> More information on this routine: <a class="ulink" href="http://www.csounds.com/journal/issue11/distortionSynthesis.html" target="_top"><em class="citetitle">http://www.csounds.com/journal/issue11/distortionSynthesis</em></a>, written by Victor Lazzarini</p> </div> <div class="refsect1" title="Credits"> <a id="idp78629056"></a> <h2>Credits</h2> <p>Written by Victor Lazzarini</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="GENtanh.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="ScoregensTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="GENsone.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">GENtanh </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> GENsone</td> </tr> </table> </div> </body> </html>