Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 6ed14ebfd686aa32f7956e552aa2e21d > files > 2031

csound-manual-5.13.0-5.fc15.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>linsegr</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="linseg.html" title="linseg" />
    <link rel="next" href="locsend.html" title="locsend" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">linsegr</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="linseg.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="locsend.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="linsegr">
      <a id="linsegr"></a>
      <div class="titlepage"></div>
      <a id="IndexLinsegr" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">linsegr</span>
        </h2>
        <p>linsegr — 
      Trace a series of line segments between specified points including a release segment.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="id2984944"></a>
        <h2>Description</h2>
        <p>
      Trace a series of line segments between specified points including a release segment.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="id2984958"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ares <span class="command"><strong>linsegr</strong></span> ia, idur1, ib [, idur2] [, ic] [...], irel, iz</pre>
        <pre class="synopsis">kres <span class="command"><strong>linsegr</strong></span> ia, idur1, ib [, idur2] [, ic] [...], irel, iz</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="id2985186"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ia</em></span> -- starting value.
    </p>
        <p>
      <span class="emphasis"><em>ib, ic</em></span>, etc. -- value after <span class="emphasis"><em>dur1</em></span> seconds, etc.
    </p>
        <p>
      <span class="emphasis"><em>idur1</em></span> -- duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.
    </p>
        <p>
      <span class="emphasis"><em>idur2, idur3</em></span>, etc. -- duration in seconds of subsequent segments. A zero or negative value will terminate the initialization process with the preceding point, permitting the last-defined line or curve to be continued indefinitely in performance. The default is zero.
    </p>
        <p>
      <span class="emphasis"><em>irel, iz</em></span> -- duration in seconds and final value of a note releasing segment.
    </p>
        <p>
      For Csound versions prior to 5.00, the release time cannot be longer than 32767/<a class="link" href="kr.html" title="kr"><em class="citetitle">kr</em></a> seconds. This limit has been extended to (2<sup>31</sup>-1)/kr.
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="id2985930"></a>
        <h2>Performance</h2>
        <p>
      These units generate control or audio signals whose values can pass through 2 or more specified points. The sum of <span class="emphasis"><em>dur</em></span> values may or may not equal the instrument's performance time: a shorter performance will truncate the specified pattern, while a longer one will cause the last-defined segment to continue on in the same direction.
    </p>
        <p>
      <span class="emphasis"><em>linsegr</em></span> is amongst the Csound <span class="quote">“<span class="quote">r</span>”</span> units that contain a note-off sensor and release time extender. When each senses an event termination or MIDI noteoff, it immediately extends the performance time of the current instrument by <span class="emphasis"><em>irel </em></span>seconds, and sets out to reach the value <span class="emphasis"><em>iz</em></span> by the end of that period (no matter which segment the unit is in). <span class="quote">“<span class="quote">r</span>”</span> units can also be modified by MIDI noteoff velocities. For two or more extenders in an instrument, extension is by the greatest period.
    </p>
        <p>
      You can use other pre-made envelopes which start a release segment upon recieving a note off message, like <a class="link" href="linenr.html" title="linenr"><em class="citetitle">linenr</em></a> and <a class="link" href="expsegr.html" title="expsegr"><em class="citetitle">expsegr</em></a>, or you can construct more complex envelopes using <a class="link" href="xtratim.html" title="xtratim"><em class="citetitle">xtratim</em></a> and <a class="link" href="release.html" title="release"><em class="citetitle">release</em></a>. Note that you don't need to use <a class="link" href="xtratim.html" title="xtratim"><em class="citetitle">xtratim</em></a> if you are using <span class="emphasis"><em>linsegr</em></span>, since the time is extended automatically.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="id2986036"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the linsegr opcode. It uses the file <a class="ulink" href="examples/linsegr.csd" target="_top"><em class="citetitle">linsegr.csd</em></a>.

      </p>
        <div class="example">
          <a id="id2986052"></a>
          <p class="title">
            <b>Example 335. Example of the linsegr opcode.</b>
          </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">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in    No messages</span>
-odac           -iadc     -d     <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o linsegr.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="comment">; Initialize the global variables.</span>
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">kr</span> <span class="op">=</span> 4410
<span class="ohdr">ksmps</span> <span class="op">=</span> 10
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="comment">; Instrument #1.</span>
<span class="oblock">instr</span> 1
  <span class="comment">; p4 = frequency in pitch-class notation.</span>
  kcps <span class="op">=</span> <span class="opc">cpspch</span>(p4)

  <span class="comment">; Use an amplitude envelope with second-long release.</span>
  kenv <span class="opc">linsegr</span> 1, p3, 0.25, 1, 0
  kamp <span class="op">=</span> kenv <span class="op">*</span> 30000

  a1 <span class="opc">oscil</span> kamp, kcps, 1
  <span class="opc">out</span> a1
<span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Table #1, a sine wave.</span>
<span class="stamnt">f</span> 1 0 16384 10 1

<span class="comment">; Make sure the score lasts for four seconds.</span>
<span class="stamnt">f</span> 0 4

<span class="comment">; p4 = frequency (in pitch-class notation).</span>
<span class="comment">; Play Instrument #1 for a half-second, p4=8.00</span>
<span class="stamnt">i</span> 1 0 0.5 8.00
<span class="comment">; Play Instrument #1 for a half-second, p4=8.01</span>
<span class="stamnt">i</span> 1 1 0.5 8.01
<span class="comment">; Play Instrument #1 for a half-second, p4=8.02</span>
<span class="stamnt">i</span> 1 2 0.5 8.02
<span class="comment">; Play Instrument #1 for a half-second, p4=8.03</span>
<span class="stamnt">i</span> 1 3 0.5 8.03
<span class="stamnt">e</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="See Also">
        <a id="id2986090"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="linenr.html" title="linenr"><em class="citetitle">linenr</em></a>,
      <a class="link" href="expsegr.html" title="expsegr"><em class="citetitle">expsegr</em></a>,
      <a class="link" href="envlpxr.html" title="envlpxr"><em class="citetitle">envlpxr</em></a>,
      <a class="link" href="mxadsr.html" title="mxadsr"><em class="citetitle">mxadsr</em></a>,
      <a class="link" href="madsr.html" title="madsr"><em class="citetitle">madsr</em></a>
      <a class="link" href="expon.html" title="expon"><em class="citetitle">expon</em></a>,
      <a class="link" href="expseg.html" title="expseg"><em class="citetitle">expseg</em></a>,
      <a class="link" href="expsega.html" title="expsega"><em class="citetitle">expsega</em></a>
      <a class="link" href="line.html" title="line"><em class="citetitle">line</em></a>,
      <a class="link" href="linseg.html" title="linseg"><em class="citetitle">linseg</em></a>,
      <a class="link" href="xtratim.html" title="xtratim"><em class="citetitle">xtratim</em></a>,
      <a class="link" href="transegr.html" title="transegr"><em class="citetitle">transegr</em></a>
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="id2986196"></a>
        <h2>Credits</h2>
        <p>Author: Barry L. Vercoe</p>
        <p>Example written by Kevin Conder.</p>
        <p>December 2002, December 2006. Thanks to Istvan Varga, added documentation about the maximum release time.</p>
        <p>New in Csound 3.47</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="linseg.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="locsend.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">linseg </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> locsend</td>
        </tr>
      </table>
    </div>
  </body>
</html>