/
tidal-midi.scd
66 lines (48 loc) · 1.62 KB
/
tidal-midi.scd
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
// version 0.3
// first, initialize your midi device.
(
MIDIClient.init;
MIDIClient.list; // to check, which are there, you can query them
)
// create a midi out connection
~midiOut = MIDIOut.newByName("FastLane USB", "Port A"); // substitute your own device here
// you may want to adjust the latency here
~midiOut.latency = 0.0;
// define one instrument called "midi" (you may call it what you like)
// it uses the built in event type "midi" (this is predefined).
~dirt.soundLibrary.addMIDI(\midi, ~midiOut);
// You can then test it on the tidal side with this:
Send some notes:
```
d1 $ note "c d e f" # s "midi"
```
Send them to the tenth midi channel (counting from 0)
```
d1 $ note "c d e f" # s "midi" # midichan 9
```
Send midi clock:
```
d1 $ midicmd "[start/4,midiClock*48]" # s "midi"
```
Send control values
```
d1 $ ccn "28*16" # ccv 127 # s "midi" # midichan 9
```
// note: parameter names may change in the future!
// In supercollider terms, the following midicmds and their parameters are supported
// (the usual note/freq and legato/sustain parameters are taken into account)
polyTouch: midichan, midinote, polyTouch
program: midichan, progNum
bend: midichan, val
sysex: uid, array
noteOn: midichan, midinote, amp // default
allNotesOff: midichan
smpte: frames, seconds, minutes, hours, frameRate
songPtr: songPtr
control: midichan, ctlNum, control
touch: midichan, val
noteOff: midichan, midinote, amp // sent automatically, after sustain.
// Tidal defines the following parameters:
```
midicmd, midichan, progNum, val, uid, array, frames, seconds, minutes, hours, frameRate, songPtr, ctlNum, control, cc, ccn, ccv
```