-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFlashBoxPattern.pde
47 lines (38 loc) · 1.01 KB
/
FlashBoxPattern.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
class FlashBoxPattern extends Pattern {
int m_pitch;
FlashBoxPattern(int channel, int pitch, int velocity) {
super(channel, pitch, velocity);
m_pitch = pitch;
println("Flash pitch " + m_pitch);
}
void draw() {
// Display one flash of color, then end.
color[] flashColors = new color[] {
color(255, 0, 0),
color(0, 255, 0),
color(0, 0, 255),
color(255, 255, 0),
color(0, 255, 255),
color(255, 0, 255),
color(255, 255, 255),
color(255, 64, 64),
color(255, 127, 0),
color(0, 255, 127),
color(255, 0, 0),
color(0, 255, 0),
color(0, 0, 255),
color(255, 255, 0),
color(0, 255, 255),
color(255, 0, 255)
};
int base_pitch = m_pitch - 24;
if((base_pitch/4) >= 0 && (base_pitch/4) < flashColors.length) {
pushStyle();
fill(flashColors[base_pitch/4]);
//fill(100,100,100);
//rect(0,0,40,160);
rect(70+(base_pitch%4)*160, 0, 160, height);
popStyle();
}
}
}