-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWindchime.pde
53 lines (45 loc) · 1.21 KB
/
Windchime.pde
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
import arb.soundcipher.*;
import arb.soundcipher.constants.*;
Config config;
SCScore score = new SCScore();
String dataset, datafile;
float score_length = 600;
float duration_min = 1, duration_max = 10;
float tempo = 300;
void setup() {
size(2, 2);
score.tempo(tempo);
loadConfig();
loadEvents();
mapEvents();
scoreEvents();
score.play();
}
void scoreEvents() {
Event e;
for(int i = 0; i < events.size(); i++) {
e = events.get(i);
score.addNote(e.tick, e.channel, e.instrument, e.pitch, e.volume, e.duration, 0.8, 64);
}
}
void draw() { }
void loadConfig() {
config = new Config();
try {
config.pid = getParameter("pid");
config.charge = getParameter("charge");
config.energy = getParameter("energy");
config.x = getParameter("x");
config.y = getParameter("y");
config.z = getParameter("z");
config.r = getParameter("r");
config.t = getParameter("t");
config.px = getParameter("px");
config.py = getParameter("py");
config.pz = getParameter("pz");
config.pt = getParameter("pt");
config.pp = getParameter("pp");
dataset = getParameter("dataset");
datafile = getParameter("datafile");
} catch(Exception e) { println(e.getMessage()); }
}