| 1 | |
| 2 | <refentry id="ctrl21"> |
| 3 | <indexterm id="IndexCtrl21"><primary>ctrl21</primary></indexterm> |
| 4 | <refentryinfo><title>Real-time MIDI:Input</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>ctrl21</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>ctrl21</refname> |
| 13 | |
| 14 | <refpurpose> |
| 15 | Allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range. |
| 16 | </refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | <refsect1> |
| 20 | <title>Description</title> |
| 21 | <para> |
| 22 | Allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis>idest <command>ctrl21</command> ichan, ictlno1, ictlno2, ictlno3, imin, imax [, ifn]</synopsis> |
| 29 | |
| 30 | <synopsis>kdest <command>ctrl21</command> ichan, ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]</synopsis> |
| 31 | </refsect1> |
| 32 | |
| 33 | <refsect1> |
| 34 | <title>Initialization</title> |
| 35 | <para> |
| 36 | <emphasis>idest</emphasis> -- output signal |
| 37 | </para> |
| 38 | |
| 39 | <para> |
| 40 | <emphasis>ichan</emphasis> -- MIDI channel number (1-16) |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | <emphasis>ictlno1</emphasis> -- most-significant byte controller number (0-127) |
| 45 | </para> |
| 46 | |
| 47 | <para> |
| 48 | <emphasis>ictlno2</emphasis> -- mid-significant byte controller number (0-127) |
| 49 | </para> |
| 50 | |
| 51 | <para> |
| 52 | <emphasis>ictlno3</emphasis> -- least-significant byte controller number (0-127) |
| 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | <emphasis>imin</emphasis> -- user-defined minimum floating-point value of output |
| 57 | </para> |
| 58 | |
| 59 | <para> |
| 60 | <emphasis>imax</emphasis> -- user-defined maximum floating-point value of output |
| 61 | </para> |
| 62 | |
| 63 | <para> |
| 64 | <emphasis>ifn</emphasis> (optional) -- table to be read when indexing is required. Table must be normalized. Output is scaled according to <emphasis>imax</emphasis> and <emphasis>imin</emphasis> val. |
| 65 | </para> |
| 66 | </refsect1> |
| 67 | |
| 68 | <refsect1> |
| 69 | <title>Performance</title> |
| 70 | <para> |
| 71 | <emphasis>kdest</emphasis> -- output signal |
| 72 | </para> |
| 73 | |
| 74 | <para> |
| 75 | <emphasis>kmin</emphasis> -- user-defined minimum floating-point value of output |
| 76 | </para> |
| 77 | |
| 78 | <para> |
| 79 | <emphasis>kmax</emphasis> -- user-defined maximum floating-point value of output |
| 80 | </para> |
| 81 | |
| 82 | <para> |
| 83 | <emphasis>ctrl21</emphasis> (i- and k-rate 21 bit MIDI control) allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range. Minimum and maximum values can be varied at k-rate. It can use optional interpolated table indexing. It requires three MIDI controllers as input. |
| 84 | </para> |
| 85 | |
| 86 | <para> |
| 87 | <emphasis>ctrl21</emphasis> differs from <link linkend="midic21"><citetitle>midic21</citetitle></link> because it can be included in score oriented instruments without Csound crashes. It needs the additional parameter <emphasis>ichan</emphasis> containing the MIDI channel of the controller. MIDI channel is the same for all the controllers used in a single <emphasis>ctrl21</emphasis> opcode. |
| 88 | </para> |
| 89 | </refsect1> |
| 90 | |
| 91 | <refsect1> |
| 92 | <title>Examples</title> |
| 93 | <para> |
| 94 | Here is an example of the ctrl21 opcode. It uses the file <ulink url="examples/ctrl21.csd"><citetitle>ctrl21.csd</citetitle></ulink>. |
| 95 | |
| 96 | <example> |
| 97 | <title>Example of the ctrl21 opcode.</title> |
| 98 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 99 | <xi:include href="examples-xml/ctrl21.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 100 | </example> |
| 101 | </para> |
| 102 | </refsect1> |
| 103 | |
| 104 | <refsect1> |
| 105 | <title>See also</title> |
| 106 | <para><link linkend="MidiInput"><citetitle>MIDI input and Initialization</citetitle></link></para> |
| 107 | </refsect1> |
| 108 | |
| 109 | <refsect1> |
| 110 | <title>Credits</title> |
| 111 | <para> |
| 112 | <simplelist> |
| 113 | <member>Author: &namegabriel;</member> |
| 114 | <member>Italy</member> |
| 115 | </simplelist> |
| 116 | </para> |
| 117 | |
| 118 | <para>New in Csound version 3.47</para> |
| 119 | <para>Thanks goes to &namerasmus; for pointing out the correct MIDI channel and controller number ranges.</para> |
| 120 | </refsect1> |
| 121 | </refentry> |