1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"824.42">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
13 span
.Apple-tab-span
{white-space:pre
}
17 <p class=
"p1"><b>MIDI
</b></p>
18 <p class=
"p2"><br></p>
19 <p class=
"p3"><b>MIDIClient
</b></p>
20 <p class=
"p3"><b>MIDIEndpoint
</b></p>
21 <p class=
"p3"><b>MIDIIn
</b></p>
22 <p class=
"p3"><b>MIDIOut
</b></p>
23 <p class=
"p3"><b>superclass: Object
</b></p>
24 <p class=
"p2"><br></p>
25 <p class=
"p3">See the
<b>[UsingMIDI]
</b> helpfile for practical considerations and techniques for using MIDI in SC.
</p>
26 <p class=
"p2"><br></p>
27 <p class=
"p3">MIDIClient is a static class that starts up the MIDI service:
</p>
28 <p class=
"p3">It initializes with a number of virtual inports and outports.
</p>
29 <p class=
"p3">The default is
1. and usually not more a needed.
</p>
30 <p class=
"p3">The information about the hardware is stored in MIDIClient.sources and MIDIClient.destinations as MIDIEndpoints.
</p>
31 <p class=
"p2"><br></p>
32 <p class=
"p3">MIDIIn represents a connection between a inport and a source of the MIDIClient.
</p>
33 <p class=
"p3">There are three possibilities to connect them:
</p>
34 <p class=
"p3">To do something with the incoming MIDI data set the actions.
</p>
35 <p class=
"p2"><br></p>
36 <p class=
"p3">example:
</p>
38 <p class=
"p3">MIDIClient.init;
</p>
39 <p class=
"p3">//There are three possibilities to connect for example to the first device:
</p>
40 <p class=
"p3"><b>//
</b>MIDIIn.connect(
0, MIDIClient.sources.at(
0));
</p>
41 <p class=
"p3"><b>//
</b>MIDIIn.connect(
0, MIDIClient.sources.at(
0).uid);
</p>
42 <p class=
"p3">MIDIIn.connect(
0,
0);
</p>
43 <p class=
"p3">//set the action:
</p>
44 <p class=
"p3">MIDIIn.control = {arg src, chan, num, val;
</p>
45 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>val.postln;
</p>
46 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>};
</p>
48 <p class=
"p2"><br></p>
49 <p class=
"p3">MIDIOut
</p>
50 <p class=
"p2"><br></p>
51 <p class=
"p3">example:
</p>
53 <p class=
"p3">MIDIClient.init;
</p>
54 <p class=
"p3">m = MIDIOut(
0, MIDIClient.destinations.at(
0).uid);
</p>
55 <p class=
"p3">m.noteOn(
0,
60,
60);
</p>
56 <p class=
"p3">)
<span class=
"Apple-converted-space"> </span></p>
57 <p class=
"p2"><br></p>
58 <p class=
"p2"><br></p>