Debian Codegraph @

opcodes/midipitchbend.xml

raw symbols SCIP
1
2 <refentry id="midipitchbend">
3 <indexterm id="IndexMidipitchbend"><primary>midipitchbend</primary></indexterm>
4 <refentryinfo><title>Real-time MIDI:MIDI/Score Interoperability</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>midipitchbend</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>midipitchbend</refname>
13 <refpurpose>
14 Gets a MIDI pitchbend value.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 <emphasis>midipitchbend</emphasis> is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
22 </para>
23
24 <para>
25 In general, it should be possible to write instrument definitions that work identically with both scores
26 and MIDI, including both MIDI files and real-time MIDI input, without using any conditional statements, and that take full advantage of MIDI voice messages.
27 </para>
28
29 <para>
30 Note that correlating Csound instruments with MIDI channel numbers is done using the <link linkend="massign"><citetitle>massign</citetitle></link> opcode for real-time performance,. For file-driven performance, instrument numbers default to MIDI channel number + 1, but the defaults are overridden by any MIDI program change messages in the file.
31 </para>
32 </refsect1>
33
34 <refsect1>
35 <title>Syntax</title>
36 <synopsis><command>midipitchbend</command> xpitchbend [, ilow] [, ihigh]</synopsis>
37 </refsect1>
38
39 <refsect1>
40 <title>Initialization</title>
41 <para>
42 <emphasis>ilow</emphasis> (optional) -- optional low value after rescaling, defaults to 0.
43 </para>
44
45 <para>
46 <emphasis>ihigh</emphasis> (optional) -- optional high value after rescaling, defaults to 127.
47 </para>
48 </refsect1>
49
50 <refsect1>
51 <title>Performance</title>
52 <para>
53 <emphasis>xpitchbend</emphasis> -- returns the MIDI pitch bend during MIDI activation, remains unchanged otherwise.
54 </para>
55
56 <para>
57 If the instrument was activated by MIDI input, the opcode overwrites the value of <emphasis>xpitchbend</emphasis> with the corresponding value from MIDI input. If the instrument was <emphasis>NOT</emphasis> activated by MIDI input, the value of <emphasis>xpitchbend</emphasis> remains unchanged.
58 </para>
59
60 <para>
61 This enables score p-fields to receive MIDI input data during MIDI activation, and score values otherwise.
62 </para>
63
64 <note>
65 <title>Adapting a score-activated Csound instrument.</title>
66 <para>See the <link linkend="MidiInterop"><citetitle>MIDI interop opcodes</citetitle></link> section for details on adapting score driven instruments for MIDI or vice-versa.</para>
67 </note>
68 </refsect1>
69
70 <refsect1>
71 <title>Examples</title>
72 <para>
73 Here is an example of the midipitchbend opcode. It uses the file <ulink url="examples/midipitchbend.csd"><citetitle>midipitchbend.csd</citetitle></ulink>.
74 <example>
75 <title>Example of the midipitchbend opcode.</title>
76 <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>
77 <xi:include href="examples-xml/midipitchbend.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
78 </example>
79
80 Its output should include lines like:
81 <screen>
82 i1 0.12695
83 i1 0.00000
84 i1 -0.01562
85 </screen>
86 </para>
87 </refsect1>
88
89 <refsect1>
90 <title>See also</title>
91 <para><link linkend="MidiInterop"><citetitle>MIDI/Score Interoperability</citetitle></link></para>
92 </refsect1>
93
94 <refsect1>
95 <title>Credits</title>
96 <para>Author: Michael Gogins</para>
97 <para>New in version 4.20</para>
98 </refsect1>
99 </refentry>