-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArcUsage.scd
37 lines (28 loc) · 1 KB
/
ArcUsage.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
(
Server.default = Server.local;
s.waitForBoot({
// create your arc object
~arc = Arc.new("/arc", 270);
// choose your appropriate device
// if you have another monome device plugged in
// make sure the correct device is chosen
~arc.useDevice(0);
// first argument is your arc object, second sets sensitivity
~arcKnobberEncoder = ArcEncoder(~arc, 8);
~arcKnobberRotary = ArcRotary(~arc, 2);
OSCFunc.newMatching({ | message |
var knob_n = message[1]; // reports which knob is rotating
var delta = message[2]; // delta coming from rotating knob
if(knob_n == 0) {
// will report position of led (0-63)
"encoder knob#0: % \n".postf(~arcKnobberEncoder.spin(knob_n, delta));
};
if(knob_n == 1) {
// will report delta from arc
"rotary knob#1: % \n".postf(~arcKnobberRotary.spin(knob_n, delta));
};
}, "/arc/enc/delta");
});
)
// turn off your device here if you'd like
~arc.darkness;