-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcameo+adj.scd
139 lines (119 loc) · 3.32 KB
/
cameo+adj.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// eDMX1 Pro on NetAddr(192.168.1.102);
// strobes - cameo thunderwash on 400, 500 (7 chans)
// pars - adj mega hex pars on 100, 108, 116, 124 (8 chans)
(
~buf = DmxBuffer();
~buf.addDevice(OlaOsc());
// load rainstar fixture library
DmxFixture.loadLibrary("adj");
DmxFixture.loadLibrary("cameo");
// create a project
~dmx = DmxPatcher(\insterburg);
~dmx.addFixture(DmxFixture(\adj_mega_hex_par_8, ~buf, 100), [\pars]);
~dmx.addFixture(DmxFixture(\adj_mega_hex_par_8, ~buf, 108), [\pars]);
~dmx.addFixture(DmxFixture(\adj_mega_hex_par_8, ~buf, 116), [\pars]);
~dmx.addFixture(DmxFixture(\adj_mega_hex_par_8, ~buf, 124), [\pars]);
~dmx.addFixture(DmxFixture(\cameo_thunderwash_600_7_1, ~buf, 500), [\wash]);
~dmx.addFixture(DmxFixture(\cameo_thunderwash_600_7_1, ~buf, 400), [\wash]);
// create a player
~player = DmxPlayer.default;
~soundIn = DmxSoundIn(0, 0.7, 60);
~blueColors = Color.xwindows.keys.select({ |key| key.asString.find("blue").notNil });
~greenColors = Color.xwindows.keys.select({ |key| key.asString.find("green").notNil });
~redColors = Color.xwindows.keys.select({ |key| key.asString.find("red").notNil });
~orangeColors = Color.xwindows.keys.select({ |key| key.asString.find("orange").notNil });
~yellowColors = Color.xwindows.keys.select({ |key| key.asString.find("yellow").notNil });
~pinkColors = Color.xwindows.keys.select({ |key| key.asString.find("pink").notNil });
~magentaColors = Color.xwindows.keys.select({ |key| key.asString.find("magenta").notNil });
)
// check buffer initialized correctly:
// buffer indexes start from 0, while DMX addresses from 1, therefore to access address 100-108:
~buf.buffer[99..107].postln;
// turn washes off
PdmxScene(\group, \wash, \dimmer, 0).play;
// turn washes almost off
PdmxScene(\group, \wash, \dimmer, 2, \color, [127, 127, 0]).play;
// magenta & cyan
PdmxScene(\group, \wash, \fixtures, 0, \dimmer, 255, \shutter, \open, \color, [0, 1.0, 1.0]).play;
PdmxScene(\group, \wash, \fixtures, 1, \dimmer, 255, \shutter, \open, \color, [1.0, 0, 1.0]).play;
// fade washes dimmer
(
z.stop;
z = {
inf.do { |i|
PdmxScene(\group, \wash, \dimmer, (i%20)).play;
0.25.wait;
};
}.fork;
)
(
// turn strobe on for 1 second every 5 secs
y.stop;
y = {
inf.do {
PdmxScene(\group, \wash, \shutter, \ramp_up_rand).play;
1.wait;
PdmxScene(\group, \wash, \shutter, \closed).play;
5.wait;
}
}.fork;
)
// pars anim
(
x.stop;
x= {
inf.do { |i|
4.do { |j|
PdmxScene(\group, \pars, \shutter, 0).play;
~dmx.groups[\pars].fixtures[j].set(\color, [255, 0, 0]);
~dmx.groups[\pars].fixtures[j].set(\shutter, 255);
0.03.wait;
};
};
}.fork;
)
// set dimmer to full for 1 second (sudden flash of light when executed)
(
w.stop;
w = {
PdmxScene(\group, \wash, \dimmer, 255).play;
0.5.wait;
PdmxScene(\group, \wash, \dimmer, 0).play;
}.fork;
)
// strobe on/off
(
v.stop;
v = {
inf.do { |i|
PdmxScene(\group, \wash, \shutter, 11+240.rand).play;
15.rand.wait;
PdmxScene(\group, \wash, \shutter, 0).play;
15.rand.wait;
};
}.fork;
)
(
u.stop;
u = {
inf.do { |i|
PdmxScene(\group, \wash, \dimmer, 10, \shutter, \open, \color, [255.rand, 0, 255.rand]).play;
3.wait;
};
}.fork;
)
// reset the whole buffer
512.do { |i|
~buf.set(i, 0);
}
// reset pars
32.do { |i|
~buf.set(99 + i, 0);
}
// check sound data is coming in
(
~soundIn.onData.clear;
~soundIn.onData.add({ |soundIn|
soundIn.postln;
});
)