-
Notifications
You must be signed in to change notification settings - Fork 2
/
SteinbergCC121.function.js
executable file
·48 lines (46 loc) · 1.44 KB
/
SteinbergCC121.function.js
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
function initFunction() {
// Creating views
application = host.createApplication();
transport = host.createTransport();
return onMidiFunction;
}
function onMidiFunction(status, data1, data2) {
// Check if message is MIDI CC
if (isChannelController(status)) {
switch (data1) {
case CC.VALUE:
transport.metronomeVolume().inc(midiCcValueToInteger(data2), ENCODER_RESOLUTION);
break;
}
} else if (isNoteOn(status) && data2 > 0) {
switch (data1) {
case NOTE.FUNCTION1:
application.undo();
break;
case NOTE.FUNCTION2:
application.redo();
break;
case NOTE.FUNCTION3:
application.remove();
break;
case NOTE.FUNCTION4:
application.duplicate();
break;
case NOTE.VALUEENCODERBUTTON:
transport.isMetronomeEnabled().toggle();
break;
case NOTE.EQENABLE1:
application.createAudioTrack(-1);
break;
case NOTE.EQENABLE2:
application.createInstrumentTrack(-1);
break;
case NOTE.EQENABLE3:
application.createEffectTrack(-1);
break;
case NOTE.EQENABLE4:
application.rename();
break;
}
}
}