-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrgan.ck
51 lines (37 loc) · 858 Bytes
/
Organ.ck
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
public class Organ extends MidiInstrument{
fun void setup() {
//setInstrument(bt);
}
// handler shred for a single voice
fun void handler(NoteEvent onEvent)
{
BeeThree bt;
Event off;
int note;
bt => g;
// inifinite time loop
while( true )
{
onEvent => now;
//if(on.note == 34){
// startRec();
// continue;
//}
onEvent.note @=> note;
// dynamically repatch
//s => g;
Std.mtof( note ) => bt.freq;
//1 => s.noteOn;
onEvent.velocity / 127.0 => float vel;
vel => bt.noteOn;
off @=> us[note];
off => now;
//null @=> us[note];
while(vel >0.0001){
vel => bt.noteOn;
vel - 0.0001 => vel;
}
0 => bt.noteOn;
}
}
}