-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.scd
executable file
·115 lines (92 loc) · 2.36 KB
/
test.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
c = i.c
c.sbuttons ++ c.mbuttons
"----------------------------------------------".postln;
// Actualiza selector
r = "~/supercollider/instrumentos/01_selector.scd";
o.instruments_selector = nil;
o.instruments_selector = r.load.(PathName(r), o);
o.instruments_selector.(o, 0);
"----------------------------------------------".postln;
// prueba de eventos
e = ();
e.sd();
e.sf('s') ?? { 'a' };
e.sf = { |self, a| a ?? {'b'} };
e['sf'].();
i.play_button.type = NK2Button.type_trigger;
i.ev.play_button = { |button|
button.val.postln;
};
//Esto era el mididef que hice al principio
o.mididef = { | val, cc, chan, src |
var action = o.evalAction(val, cc);
switch( action.type,
false, { /* pass */ },
"R_release", { "r R_release".postln },
"R_press", { "r R_press".postln },
);
}
o.mididef = o.mididefDefault()
"----------------------------------------------".postln;
// Cosa del principio ahora se usa 0002_init
s.boot;
Server.killAll;
w = NK2Writer(s);
o = NK2Node(s,w).activate;
"----------------------------------------------".postln;
// NodeProxys a full
o.slots[0].nodeProxy.source = { Saw.ar([300, 301.3], 1) };
o.play;
o.proxy_space.postln;
"----------------------------------------------".postln;
// NodeProxys
a = o.nodeSlot(1);
a.source = { Saw.ar([400, 401.3], 1) };
b = o.nodeSlot(1);
b.source = {
(a * o.faders[0].kr)
};
b.play;
c = o.nodeSlot(2);
c.source = { Saw.ar([200, 201.3], 1) };
b.source = {
(a * o.faders[0].kr) +
(c * o.faders[1].kr)
};
"----------------------------------------------".postln;
// ProxySpaces
p = ProxySpace.new(s);
p[\x][0] = { Saw.ar([400, 401.3], 1) };
p[\x][1] = { Saw.ar([100, 101.3], 1) };
p[\z] = (p[\x] * pi).sin * 0.1 * { LFSaw.kr(LFNoise1.kr(0.1 ! 3).sum * -18).max(0.2) };
p[\z].play;
p[\x][1] = nil;
p[\a] = { Saw.ar(o.faders[2].kr*1000) };
p[\b] = { Saw.ar(o.faders[1].kr*1000) };
p[\c] = { p[\a] + p[\b] }
p[\c].play;
p[\c].vol = 1;
p[\a].map(\freq , o.faders[2].kr)
p[\c].free;
p[\c] = nil
p.push
~a.play;
~i1 = { Saw.ar([400, 401.3], 1) };
~i2 = { Saw.ar([100, 101.3], 1) };
~a[0] = ~i1;
~a[1] = ~i2;
~i1.vol = 0.1;
~i2.vol = 0.1;
~a.vol = 1;
~a.stop;
"----------------------------------------------".postln;
// cosas del principio
o.src_id;
o.rbuttons.do({ |button| button.led.blink });
o.slots[1].nodeProxy.vol
o.faders[2].kr
o.activate
"----------------------------------------------".postln;
// Writer
w.on(32);
w.off(32);