-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCCinchannelselect.axo
53 lines (53 loc) · 2.43 KB
/
CCinchannelselect.axo
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
<objdefs appVersion="1.0.12">
<obj.normal id="CCinchannelselect" uuid="2680db0d-1d3d-4d16-a3e7-2d004545b471">
<sDescription>Receives Midi Continuous Controller messages</sDescription>
<author>Johannes Taelman</author>
<license>BSD</license>
<helpPatch>midi_in.axh</helpPatch>
<inlets/>
<outlets>
<frac32.positive name="midiCC" description="midi CC 0-63.5"/>
<bool32.pulse name="trig" description="trigger output"/>
</outlets>
<displays/>
<params/>
<attribs>
<spinner name="cc" MinValue="0" MaxValue="127" DefaultValue="0"/>
<spinner name="default" MinValue="0" MaxValue="127" DefaultValue="0"/>
<combo name="device">
<MenuEntries>
<string>omni</string>
<string>din</string>
<string>usb host port 1</string>
<string>usb host port 2</string>
<string>usb host port 3</string>
<string>usb host port 4</string>
<string>internal port 1</string>
<string>internal port 2</string>
<string>usb device port 1</string>
</MenuEntries>
<CEntries>
<string>true</string>
<string>dev == MIDI_DEVICE_DIN && port == 1</string>
<string>dev == MIDI_DEVICE_USB_HOST && port == 1</string>
<string>dev == MIDI_DEVICE_USB_HOST && port == 2</string>
<string>dev == MIDI_DEVICE_USB_HOST && port == 3</string>
<string>dev == MIDI_DEVICE_USB_HOST && port == 4</string>
<string>dev == MIDI_DEVICE_INTERNAL && port == 1</string>
<string>dev == MIDI_DEVICE_INTERNAL && port == 2</string>
<string>dev == MIDI_DEVICE_USB_DEVICE && port == 1</string>
</CEntries>
</combo>
<spinner name="channel" MinValue="1" MaxValue="16" DefaultValue="0"/>
</attribs>
<code.declaration><![CDATA[int32_t ccv;
int32_t ntrig;]]></code.declaration>
<code.init><![CDATA[ccv = attr_default << 20;]]></code.init>
<code.krate><![CDATA[outlet_midiCC= ccv;
outlet_trig = ntrig;
ntrig = 0;]]></code.krate>
<code.midihandler><![CDATA[if(attr_device) {
if ((status == (attr_channel-1) + MIDI_CONTROL_CHANGE)&&(data1 == attr_cc)) { ccv = data2<<20; ntrig = 1;}
}]]></code.midihandler>
</obj.normal>
</objdefs>