| 1 | |
| 2 | <refentry id="moscil"> |
| 3 | <indexterm id="IndexMoscil"><primary>moscil</primary></indexterm> |
| 4 | <refentryinfo><title>Real-time MIDI:Note Output</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>moscil</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>moscil</refname> |
| 13 | |
| 14 | <refpurpose> |
| 15 | Sends a stream of the MIDI notes. |
| 16 | </refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | <refsect1> |
| 20 | <title>Description</title> |
| 21 | <para> |
| 22 | Sends a stream of the MIDI notes. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis><command>moscil</command> kchn, knum, kvel, kdur, kpause</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Performance</title> |
| 33 | <para> |
| 34 | <emphasis>kchn</emphasis> -- MIDI channel number (1-16) |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>knum</emphasis> -- note number (0-127) |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>kvel</emphasis> -- velocity (0-127) |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | <emphasis>kdur</emphasis> -- note duration in seconds |
| 47 | </para> |
| 48 | |
| 49 | <para> |
| 50 | <emphasis>kpause</emphasis> -- pause duration after each noteoff and before new note in seconds |
| 51 | </para> |
| 52 | |
| 53 | <para> |
| 54 | <emphasis>moscil</emphasis> and <link linkend="midion"><citetitle>midion</citetitle></link> are the most powerful MIDI OUT opcodes. <emphasis>moscil</emphasis> (MIDI oscil) plays a stream of notes of <emphasis>kdur</emphasis> duration. Channel, pitch, velocity, duration and pause can be controlled at k-rate, allowing very complex algorithmically generated melodic lines. When current instrument is deactivated, the note played by current instance of <emphasis>moscil</emphasis> is forcedly truncated. |
| 55 | </para> |
| 56 | |
| 57 | <para> |
| 58 | Any number of <emphasis>moscil</emphasis> opcodes can appear in the same Csound instrument, allowing a counterpoint-style polyphony within a single instrument. |
| 59 | </para> |
| 60 | </refsect1> |
| 61 | |
| 62 | <refsect1> |
| 63 | <title>Examples</title> |
| 64 | <para> |
| 65 | Here is an example of the moscil opcode. It uses the file <ulink url="examples/moscil.csd"><citetitle>moscil.csd</citetitle></ulink>. |
| 66 | |
| 67 | <example> |
| 68 | <title>Example of the moscil opcode.</title> |
| 69 | <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> |
| 70 | <para>This example generates a stream of notes for every note received on the MIDI input. It generates MIDI notes on csound's MIDI output, so be sure to connect something.</para> |
| 71 | <xi:include href="examples-xml/moscil.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 72 | </example> |
| 73 | </para> |
| 74 | </refsect1> |
| 75 | |
| 76 | <refsect1> |
| 77 | <title>See also</title> |
| 78 | <para><link linkend="MidiOnoff"><citetitle>Note-on/Note-off Output</citetitle></link></para> |
| 79 | </refsect1> |
| 80 | |
| 81 | <refsect1> |
| 82 | <title>Credits</title> |
| 83 | <para> |
| 84 | <simplelist> |
| 85 | <member>Author: &namegabriel;</member> |
| 86 | <member>Italy</member> |
| 87 | <member>May 1997</member> |
| 88 | </simplelist> |
| 89 | </para> |
| 90 | |
| 91 | <para>New in Csound version 3.47</para> |
| 92 | <para>Thanks goes to &namerasmus; for pointing out the correct MIDI channel and controller number ranges.</para> |
| 93 | </refsect1> |
| 94 | </refentry> |