-
Notifications
You must be signed in to change notification settings - Fork 0
/
ElliClassExtesnions.sc
60 lines (48 loc) · 1.14 KB
/
ElliClassExtesnions.sc
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
+ MIDIClockOut {
*new { arg deviceName, portName, tempoClock;
var port;
if(deviceName.notNil , {
//port = MIDIOut.newByName(deviceName, portName);
port = EE.midiOut;
}, {
port = MIDIOut.new(0, MIDIClient.destinations[0].uid);
});
if(port.isNil, {
Error("Device not found " + deviceName + portName).throw;
});
^super.newCopyArgs(BeatSched.new(tempoClock:tempoClock), port)
}
start {
CmdPeriod.add(this);
click = 0;
sched.beat = 0.0;
port.songPtr(sched.beat);
port.start;
isPlaying = true;
this.next;
}
stop {
sched.clear;
port.stop;
isPlaying = false;
CmdPeriod.remove(this);
}
}
+ String {
// open a new Pbindef window to edit it. On close don't ask to save.
newEditWindow { arg title="Untitled", makeListener=false;
var doc = Document.new(title, this, makeListener)
.promptToSave_(false);
^doc
/*.keyDownAction = { |view, char, mod, unicode, keycode, key|
//[view, char, mod, unicode, keycode, key].postln; // Uncomment this to check what key you are pressing.
if(key == 16777220 && mod.isCtrl, {this.interpret; doc.close}
)};
*/
}
}
+ Routine {
get_receiver {
^receiver
}
}