<?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>jspline</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="joystick.html" title="joystick" /> <link rel="next" href="opk.html" title="k" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">jspline</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="joystick.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="opk.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="jspline"></a> <div class="titlepage"></div> <a id="IndexJspline" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">jspline</span> </h2> <p>jspline — A jitter-spline generator. </p> </div> <div class="refsect1"> <a id="idm281472921651976"></a> <h2>Description</h2> <p> A jitter-spline generator. </p> </div> <div class="refsect1"> <a id="idm281472921650744"></a> <h2>Syntax</h2> <pre class="synopsis">ares <span class="command"><strong>jspline</strong></span> xamp, kcpsMin, kcpsMax</pre> <pre class="synopsis">kres <span class="command"><strong>jspline</strong></span> kamp, kcpsMin, kcpsMax</pre> </div> <div class="refsect1"> <a id="idm281472921577320"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>kres, ares</em></span> -- Output signal </p> <p> <span class="emphasis"><em>xamp</em></span> -- Amplitude factor </p> <p> <span class="emphasis"><em>kcpsMin, kcpsMax</em></span> -- Range of point-generation rate. Min and max limits are expressed in cps. </p> <p> <span class="emphasis"><em>jspline</em></span> (jitter-spline generator) generates a smooth curve based on random points generated at [<span class="emphasis"><em>cpsMin</em></span>, <span class="emphasis"><em>cpsMax</em></span>] rate. This opcode is similar to <a class="link" href="randomi.html" title="randomi"><em class="citetitle">randomi</em></a> or <a class="link" href="randi.html" title="randi"><em class="citetitle">randi</em></a> or <a class="link" href="jitter.html" title="jitter"><em class="citetitle">jitter</em></a>, but segments are not straight lines, but cubic spline curves. Output value range is approximately > -<span class="emphasis"><em>xamp</em></span> and < <span class="emphasis"><em>xamp</em></span>. Actually, real range could be a bit greater, because of interpolating curves beetween each pair of random-points. </p> <p> At present time generated curves are quite smooth when <span class="emphasis"><em>cpsMin</em></span> is not too different from <span class="emphasis"><em>cpsMax</em></span>. When <span class="emphasis"><em>cpsMin</em></span>-<span class="emphasis"><em>cpsMax</em></span> interval is big, some little discontinuity could occurr, but it should not be a problem, in most cases. Maybe the algorithm will be improved in next versions. </p> <p> These opcodes are often better than <a class="link" href="jitter.html" title="jitter"><em class="citetitle">jitter</em></a> when user wants to <span class="quote">“<span class="quote">naturalize</span>”</span> or <span class="quote">“<span class="quote">analogize</span>”</span> digital sounds. They could be used also in algorithmic composition, to generate smooth random melodic lines when used together with <a class="link" href="samphold.html" title="samphold"><em class="citetitle">samphold</em></a> opcode. </p> <p> Note that the result is quite different from the one obtained by filtering white noise, and they allow the user to obtain a much more precise control. </p> </div> <div class="refsect1"> <a id="idm281472921561928"></a> <h2>Examples</h2> <p> Here is an example of the jspline opcode. It uses the file <a class="ulink" href="examples/jspline.csd" target="_top"><em class="citetitle">jspline.csd</em></a>. </p> <div class="example"> <a id="idm281472921560072"></a> <p class="title"> <strong>Example 449. Example of the jspline 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="idm281472750084328"></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 jspline.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> k<span class="n">amp</span> <span class="nb">init</span> <span class="nb">p4</span> k<span class="n">cpsmin</span> <span class="nb">init</span> <span class="mi">2</span> k<span class="n">cpsmax</span> <span class="nb">init</span> <span class="mi">20</span> k<span class="n">sp</span> <span class="nb">jspline</span> k<span class="n">amp</span><span class="p">,</span> k<span class="n">cpsmin</span><span class="p">,</span> k<span class="n">cpsmax</span> a<span class="n">out</span> <span class="nb">pluck</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">200</span><span class="o">+</span>k<span class="n">sp</span><span class="p">,</span> <span class="mi">1000</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span> a<span class="n">out</span> <span class="nb">dcblock</span> a<span class="n">out</span> <span class="c1">;remove DC</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">10</span> <span class="mi">2</span> <span class="c1">;a bit jitter</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">8</span> <span class="mi">10</span> <span class="mi">10</span> <span class="c1">;some more</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">16</span> <span class="mi">10</span> <span class="mi">20</span> <span class="c1">;lots more</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="idm281472921555784"></a> <h2>Credits</h2> <p>Author: Gabriel Maldonado</p> <p>New in Version 4.15</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="joystick.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="opk.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">joystick </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> k</td> </tr> </table> </div> </body> </html>