Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 5fcfcb7517038d1f44ab4e478e6e61fa > files > 2450

csound-doc-6.10.0-1.mga7.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>midiarp</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="midglobal.html" title="midglobal" />
    <link rel="next" href="midic14.html" title="midic14" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">midiarp</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="midglobal.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="midic14.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="midiarp"></a>
      <div class="titlepage"></div>
      <a id="Indexmidiarp" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">midiarp</span>
        </h2>
        <p>midiarp — 
      Generates arpeggios based on currently held MIDI notes. 
    </p>
      </div>
      <div class="refsect1">
        <a id="idm281472915433336"></a>
        <h2>Description</h2>
        <p>
      midiarp constructs arpeggios based currently held MIDI notes. The opcode will output notes in the form of MIDI note numbers, and a metronomic signal that can be used to sequence the notes. Users can choose the rate at which the notes are generated, and may also choose from a set of arpeggio patterns. 
    </p>
      </div>
      <div class="refsect1">
        <a id="idm281472915374568"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">kMidiNoteNum, kCounter<span class="command"><strong>midiarp</strong></span> kRate[, kMode]</pre>
      </div>
      <div class="refsect1">
        <a id="idm281472915372360"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>kRate</em></span> -- sets the rate at which new notes will be generated and controls the frequency of the metronomic pulse signal.  
    </p>
        <p>
      <span class="emphasis"><em>kMode</em></span> -- Optional. Sets the mode of the arpeggio. 0 for up and down, 1, for up, 2 for down, and 3 for random. If left out, it will default to mode 0, up and down.
    </p>
      </div>
      <div class="refsect1">
        <a id="idm281472915369784"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kMideNoteNum</em></span> -- the current note number in the arpeggio pattern. 
    </p>
        <p>
      <span class="emphasis"><em>kCounter</em></span> -- a metronomic pulse that can be used to trigger playback of the notes in the arpeggio. This signal will output a 1 followed by 0s on each cycle. The frequency is set using the <span class="emphasis"><em>kRate</em></span> input parameter.   
    </p>
      </div>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
        <table border="0" summary="Note: 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>
      It is important that the instrument which holds the midiarp opcode is not continuously triggered on each new MIDI note. To prevent this from happening use the massign opcode, as shown in the example below. 
      </p>
            </td>
          </tr>
        </table>
      </div>
      <div class="refsect1">
        <a id="idm281472915365224"></a>
        <h2>Example</h2>
        <p>
      This example shows how midiarp can be used to trigger arpeggios using a secondary instrument for playback. Instrument 100 listens to incoming MIDI notes, and then triggers playback using instrument 200. <span class="emphasis"><em>massign</em></span> is used to prevent instrument 100 from being triggered each time a new MIDI note is pressed. This examples uses the file <a class="ulink" href="examples/midiarp.csd" target="_top"><em class="citetitle">midiarp.csd</em></a>.
      </p>
        <div class="example">
          <a id="idm281472915362808"></a>
          <p class="title">
            <strong>Example 535. Example of the midiarp opcode</strong>
          </p>
          <div class="example-contents">
            <div class="refsect1">
              <a id="idm281472739424008"></a>
              <pre class="programlisting">
<span class="nt">&lt;CsoundSynthesizer&gt;</span>
<span class="nt">&lt;CsOptions&gt;</span>
<span class="c1">; Select audio/midi flags here according to platform</span>
<span class="c1">; Audio out   Audio in    No messages</span>
-odac 	-d    -m0d     -M0  -+rtmidi=virtual <span class="c1">;;;RT audio I/O with MIDI in</span>
<span class="c1">; For Non-realtime ouput leave only the line below:</span>
<span class="c1">; -o midiin.wav -W ;;; for file output any platform</span>
<span class="nt">&lt;/CsOptions&gt;</span>
<span class="nt">&lt;CsInstruments&gt;</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="nb">massign</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="c1">; prevent triggering of instrument with MIDI</span>

<span class="kd">instr</span> <span class="nf">100</span>
k<span class="n">Mode</span> <span class="o">=</span> <span class="mi">3</span>
k<span class="n">Tempo</span> <span class="o">=</span> <span class="mi">6</span>
k<span class="n">Note</span><span class="p">,</span> k<span class="n">Counter</span> <span class="n">midiarp</span> k<span class="n">Tempo</span>

k<span class="n">FilterFreq</span> <span class="nb">oscil</span> <span class="mi">2000</span><span class="p">,</span> <span class="mf">.05</span>
<span class="c1">;if kCounter is 1 trigger instrument 2 to play</span>
<span class="k">if</span> k<span class="n">Counter</span><span class="o">==</span><span class="mi">1</span> <span class="k">then</span> 	
	<span class="nb">event</span> <span class="s">"i"</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> k<span class="n">Note</span><span class="p">,</span> k<span class="n">FilterFreq</span><span class="o">+</span><span class="mi">2200</span>
<span class="k">endif</span>

<span class="kd">endin</span>

<span class="kd">instr</span> <span class="nf">200</span>
k<span class="n">Env</span> <span class="nb">expon</span> <span class="mf">.4</span><span class="p">,</span> <span class="nb">p3</span><span class="p">,</span> <span class="mf">.001</span>
a<span class="n">Out</span> <span class="nb">vco2</span> k<span class="n">Env</span><span class="p">,</span> <span class="nb">cpsmidinn</span><span class="p">(</span><span class="nb">p4</span><span class="p">)</span><span class="o">*</span><span class="mi">2</span>		<span class="c1">;convert note number to cps</span>
a<span class="n">Filter</span> <span class="nb">moogladder</span> a<span class="n">Out</span><span class="p">,</span> <span class="nb">p5</span><span class="p">,</span> <span class="mi">0</span>
<span class="nb">outs</span> a<span class="n">Filter</span><span class="p">,</span> a<span class="n">Filter</span>
<span class="kd">endin</span>

<span class="nt">&lt;/CsInstruments&gt;</span>
<span class="nt">&lt;CsScore&gt;</span>
<span class="nb">i</span><span class="mi">100</span> <span class="mi">0</span> <span class="mi">1000</span>
<span class="nt">&lt;/CsScore&gt;</span>
<span class="nt">&lt;/CsoundSynthesizer&gt;</span>
</pre>
            </div>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idm281472915360984"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Rory Walsh</td>
          </tr>
          <tr>
            <td>2017</td>
          </tr>
        </table>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="midglobal.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="midic14.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">midglobal </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> midic14</td>
        </tr>
      </table>
    </div>
  </body>
</html>