summaryrefslogtreecommitdiff
path: root/opcodes/outkc.xml
blob: fbc9c70c127632bf2673272fb6ee7d6f6394c92e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<refentry id="outkc">
<indexterm id="IndexOutkc"><primary>outkc</primary></indexterm>
  <refentryinfo><title>Real-time MIDI:Output</title></refentryinfo>
  <refmeta>
    <refentrytitle>outkc</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>outkc</refname>

    <refpurpose>
      Sends MIDI controller messages at k-rate.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Sends MIDI controller messages at k-rate.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>outkc</command> kchn, knum, kvalue, kmin, kmax</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kchn</emphasis> -- MIDI channel number (1-16)
    </para>

    <para>
      <emphasis>knum</emphasis> -- controller number (0-127 for example 1 = ModWheel; 2 = BreathControl etc.)
    </para>

    <para>
      <emphasis>kvalue</emphasis> -- floating point value
    </para>

    <para>
      <emphasis>kmin</emphasis> -- minimum floating point value (converted in MIDI integer value 0)
    </para>

    <para>
      <emphasis>kmax</emphasis> -- maximum floating point value (converted in MIDI integer value 127 (7 bit))
    </para>

    <para>
      <emphasis>outkc</emphasis> (k-rate MIDI controller output) sends controller messages to MIDI OUT device. It works only with MIDI instruments which recognize them. It can drive a different value of a parameter for each note currently active. 
    </para>

    <para>
      It can scale the k-value floating-point argument according to the <emphasis>kmin</emphasis> and <emphasis>kmax</emphasis> values. For example: set <emphasis>kmin</emphasis> = 1.0 and <emphasis>kmax</emphasis> = 2.0.
When the <emphasis>kvalue</emphasis> argument receives a 2.0 value, the opcode will send a 127 value to the MIDI OUT device. When the <emphasis>kvalue</emphasis> argument receives a 1.0 value, it will send a 0 value. k-rate opcodes send a message each time the MIDI converted value of argument <emphasis>kvalue</emphasis> changes.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the outkc opcode. It uses the file <ulink url="examples/outkc.csd"><citetitle>outkc.csd</citetitle></ulink>.
      <example>
        <title>Example of the outkc opcode.</title>
        <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>
          <xi:include href="examples-xml/outkc.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="outiat"><citetitle>outiat</citetitle></link>,
      <link linkend="outic14"><citetitle>outic14</citetitle></link>,
      <link linkend="outic"><citetitle>outic</citetitle></link>,
      <link linkend="outipat"><citetitle>outipat</citetitle></link>,
      <link linkend="outipb"><citetitle>outipb</citetitle></link>,
      <link linkend="outipc"><citetitle>outipc</citetitle></link>,
      <link linkend="outkat"><citetitle>outkat</citetitle></link>,
      <link linkend="outkc14"><citetitle>outkc14</citetitle></link>,
      <link linkend="outkpat"><citetitle>outkpat</citetitle></link>,
      <link linkend="outkpb"><citetitle>outkpb</citetitle></link>,
      <link linkend="outkpc"><citetitle>outkpc</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.47</para>
    <para>Thanks goes to &namerasmus; for pointing out the correct MIDI channel and controller number ranges.</para>
  </refsect1>
</refentry>