Sophie

Sophie

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

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>chuap</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="chnset.html" title="chnset" />
    <link rel="next" href="cigoto.html" title="cigoto" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">chuap</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="chnset.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="cigoto.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="chuap">
      <a id="chuap"></a>
      <div class="titlepage"></div>
      <a id="Indexchuap" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">chuap</span>
        </h2>
        <p>chuap — 
      Simulates Chua's oscillator, an LRC oscillator with an active resistor, proved capable of bifurcation and chaotic attractors, with k-rate control of circuit elements.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp15896896"></a>
        <h2>Description</h2>
        <p>
      Simulates Chua's oscillator, an LRC oscillator with an active resistor, proved capable of bifurcation and chaotic attractors, with k-rate control of circuit elements.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp15883504"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">aI3, aV2, aV1 <span class="command"><strong>chuap</strong></span> kL, kR0, kC1, kG, kGa, kGb, kE, kC2, iI3, iV2, iV1, ktime_step</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp15884656"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>iI3</em></span> -- Initial current at G
    </p>
        <p>
      <span class="emphasis"><em>iV2</em></span> -- Initial voltage at C2
    </p>
        <p>
      <span class="emphasis"><em>iV1</em></span> -- Initial voltage at C1
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="idp15934472"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kL</em></span> -- Inductor L
    </p>
        <p>
      <span class="emphasis"><em>kR0</em></span> -- Resistor R0
    </p>
        <p>
      <span class="emphasis"><em>kC1</em></span> -- Capacitor C1
    </p>
        <p>
      <span class="emphasis"><em>kG</em></span> -- Resistor G
    </p>
        <p>
      <span class="emphasis"><em>kGa</em></span> -- Resistor V (nonlinearity term)
    </p>
        <p>
      <span class="emphasis"><em>kGb</em></span> -- Resistor V (nonlinearity term)
    </p>
        <p>
      <span class="emphasis"><em>kGb</em></span> -- Resistor V (nonlinearity term)
    </p>
        <p>
      <span class="emphasis"><em>ktime_step</em></span> -- Delta time in the difference equation, can be used to more or less control pitch.
    </p>
        <p>
      <span class="emphasis"><em>Chua's oscillator</em></span> is a simple LRC oscillator with an active resistor. The oscillator can be driven
      into period bifurcation, and thus to chaos, because of the nonlinear response of the active resistor. 
    </p>
        <div class="mediaobject">
          <img src="images/600px-Chua's_circuit.svg.png" />
          <div class="caption">
            <p>Diagram of Chua's Oscillator Circuit</p>
          </div>
        </div>
        <p>
      The circuit is described by a set of three ordinary differential equations called Chua's equations:
    </p>
        <div class="literallayout">
          <p><br />
      dI3      R0      1<br />
      --- =  - -- I3 - - V2<br />
      dt       L       L<br />
<br />
      dV2    1       G<br />
      --- = -- I3 - -- (V2 - V1)<br />
      dt    C2      C2<br />
<br />
      dV1    G              1<br />
      --- = -- (V2 - V1) - -- f(V1)<br />
      dt    C1             C1<br />
    </p>
        </div>
        <p>
      where f() is a piecewise discontinuity simulating the active resistor:
    </p>
        <div class="literallayout">
          <p><br />
      f(V1) = Gb V1 + - (Ga - Gb)(|V1 + E| - |V1 - E|)<br />
    </p>
        </div>
        <p>A solution of these equations (I3,V2,V1)(t) starting from an initial state (I3,V2,V1)(0) is called a trajectory of Chua's
      oscillator. The Csound implementation is a difference equation simulation of Chua's oscillator with Runge-Kutta integration.
    </p>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>This algorithm uses internal non linear feedback loops which causes audio result to depend on the orchestra
      sampling rate. For example, if you develop a project with <span class="emphasis"><em>sr</em></span>=48000Hz and if you want to produce
      an audio CD from it, you should record a file with <span class="emphasis"><em>sr</em></span>=48000Hz and then downsample the file to 44100Hz
      using the <a class="link" href="srconv.html" title="srconv"><em class="citetitle">srconv</em></a> utility.</p>
              </td>
            </tr>
          </table>
        </div>
        <div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Warning">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Warning]" src="images/warning.png" />
              </td>
              <th align="left">Warning</th>
            </tr>
            <tr>
              <td align="left" valign="top">
      Be careful! Some sets of parameters will produce amplitude spikes or positive feedback that could damage your speakers.
    </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp15944840"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the chuap opcode. It uses the file <a class="ulink" href="examples/chuap.csd" target="_top"><em class="citetitle">chuap.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp15945808"></a>
          <p class="title">
            <strong>Example 106. Example of the chuap opcode.</strong>
          </p>
          <div class="example-contents">
            <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">;;;RT audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if RT audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o chuas_oscillator.wav.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

gibuzztable <span class="ohdr">ftgen</span> 1, 0, 16384, 10, 1

<span class="oblock">instr</span> 1
<span class="comment">; sys_variables = system_vars(5:12); % L,R0,C2,G,Ga,Gb,E,C1 or p8:p15</span>
<span class="comment">; integ_variables = [system_vars(14:16),system_vars(1:2)]; % x0,y0,z0,dataset_size,step_size or p17:p19, p4:p5</span>
istep_size    <span class="op">=</span>       p5
iL            <span class="op">=</span>       p8
iR0           <span class="op">=</span>       p9
iC2           <span class="op">=</span>       p10
iG            <span class="op">=</span>       p11
iGa           <span class="op">=</span>       p12
iGb           <span class="op">=</span>       p13
iE            <span class="op">=</span>       p14
iC1           <span class="op">=</span>       p15
iI3           <span class="op">=</span>       p17
iV2           <span class="op">=</span>       p18
iV1           <span class="op">=</span>       p19
iattack       <span class="op">=</span>       0.02
isustain      <span class="op">=</span>       p3
irelease      <span class="op">=</span>       0.02
p3            <span class="op">=</span>       iattack <span class="op">+</span> isustain <span class="op">+</span> irelease
iscale        <span class="op">=</span>       1.0
adamping      <span class="opc">linseg</span>  0.0, iattack, iscale, isustain, iscale, irelease, 0.0
aguide        <span class="opc">buzz</span>    0.5, 440, <span class="ohdr">sr</span><span class="op">/</span>440, gibuzztable
aI3, aV2, aV1 <span class="opc">chuap</span>   iL, iR0, iC2, iG, iGa, iGb, iE, iC1, iI3, iV2, iV1, istep_size 
asignal       <span class="opc">balance</span> aV2, aguide
              <span class="opc">outs</span>    adamping <span class="op">*</span> asignal, adamping <span class="op">*</span> asignal
<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="comment">;        Adapted from ABC++ MATLAB example data.</span>
<span class="stamnt">i</span> 1 0 20 1500 .1   -1 -1 -0.00707925 0.00001647 100  1 -.99955324 -1.00028375 1 -.00222159 204.8 -2.36201596260071 3.08917625807226e-03 3.87075614929199 7 .4 .004 1 86 30<span class="comment">; torus attractor ( gallery of attractors ) </span>
<span class="stamnt">i</span> 1 + 20 1500 .425  0 -1  1.3506168  0              -4.50746268737 -1 2.4924 .93 1 1 0 -22.28662665 .009506608 -22.2861576 32 10 2 20 86 30 <span class="comment">; heteroclinic orbit</span>
<span class="stamnt">i</span> 1 + 20 1024 .05  -1 -1  0.00667    0.000651    10 -1 .856 1.1 1 .06 51.2 -20.200590133667 .172539323568344 -4.07686233520508 2.5 10 .2 1 66 81 <span class="comment">; periodic attractor (torus breakdown route)</span>
<span class="stamnt">i</span> 1 + 20 1024 0.05 -1 -1 0.00667 0.000651 10 -1 0.856 1.1 1 0.1 153.6 21.12496758 0.03001749 0.515828669 2.5 10 0.2 1 66 81  <span class="comment">; torus attractor (torus breakdown route)'</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp15946816"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Inventor of Chua's oscillator: <a class="ulink" href="http://www.eecs.berkeley.edu/~chua" target="_top"><em class="citetitle">Leon O. Chua</em></a></td>
          </tr>
          <tr>
            <td>Author of MATLAB simulation: James Patrick McEvoy <a class="ulink" href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3541" target="_top"><em class="citetitle">MATLAB Adventures in Bifurcations and Chaos (ABC++)</em></a></td>
          </tr>
          <tr>
            <td>Author of Csound port: Michael Gogins</td>
          </tr>
        </table>
        <p>
  </p>
        <p>New in Csound version 5.09</p>
        <p>Note added by François Pinot, August 2009</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="chnset.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="cigoto.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">chnset </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> cigoto</td>
        </tr>
      </table>
    </div>
  </body>
</html>