-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevan-democracy-piece.scd
73 lines (50 loc) · 1.08 KB
/
evan-democracy-piece.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
67
68
69
70
// B =
~destination = NetAddr("172.20.75.200", 57210);
~destination.sendMsg("/stuff", 12, 16);
~numberOfCandidates = 16; // because of QuNeo buttons
~numberOfVoters = 13; // number of players
~voted = Array.newClear(~numberOfVoters);
~tally = Array.fill(~numberOfCandidates, 0);
~tally[0] = ~tally[0] + 1
(
OSCdef(\test, {arg ...args;
var voterID, candidate;
voterID = args[0][1]; // double check
candidate = args[0][0]; // double check
if(~voted[voteID]==0,
{
~voted[voterID] = 1;
~tally[candidate] = ~tally[candidate] + 1;
},
{
"you are trying to voice twice, huh?".postln;
}
);
}, path: '/stuff');
)
// From Evan's laptop
//
(
~destinations = [
"192.19.121.121",
"192.19.121.121",
"192.19.121.121",
// etc
];
)
// Start TempoClock on everyone's laptop
(
~destinations.do({arg item;
item.sendMsg(/* start TempoClock */);
t = TempoClock.new; // your local tempo clock
});
)
// corresponding code on everyone's laptop:
(
OSCdef(\tempoStart, {arg ...args;
t = TempoClock.new;
},
path: '/tempo'
)
)
// TEMPO CLOCK controls tallying and sending results out