Repository navigation
Expand file tree
/
Copy pathseco4.sc
More file actions
145 lines (59 loc) · 1.99 KB
/
Copy pathseco4.sc
File metadata and controls
145 lines (59 loc) · 1.99 KB
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
140
141
142
143
144
145
// with synthdef (depends on synths defined above):
v = Voicer.new(8, "harpsi"); // 8 voices, all harpsi
// with Instr & MixerChannel:
s = Server.local; s.boot;
m = MixerChannel.new("harpsi", s, 2, 2);
v = Voicer.new(8, Instr.at([\harpsi]), target:m);
// a nested Instr:
(
i = Instr([\harpsi], {
arg freq = 440, gate = 0;
var out;
out = EnvGen.ar(Env.adsr, gate, doneAction:2) *
Pulse.ar(freq, 0.25, 0.25);
[out,out]
});
f = Instr([\test, \rlpf], {
arg audio, ffreq = 500, rq = 0.1;
RLPF.ar(audio, ffreq, rq);
});
)
// If you supply an Instr as an argument, it must be followed by an argument array or nil.
// The Voicer makes a Patch for the inner Instr using the arg array immediately following.
v = Voicer(8, Instr.at([\test, \rlpf]), [\audio, Instr.at([\harpsi]), nil, \ffreq, 5000, \rq, 0.08]);
v = Voicer.new(8, "harpsi"); // uses Server.local
f = Array.fill(5, { 1000.0.rand + 50 });
v.trigger(f); // play 5 notes
v.release(f); // release the same
(
i = Instr([\harpsi], {
arg freq = 440, gate = 0;
var out;
out = EnvGen.ar(Env.adsr, gate, doneAction:2) *
Pulse.ar(freq, 0.25, 0.25);
[out,out]
}/*, [\freq, \amp]*/);
f = Instr([\test, \rlpf], {
arg audio, ffreq = 500, rq = 0.1;
RLPF.ar(audio, ffreq, rq);
});
v = Voicer(8, f, [\audio, i, nil, \ffreq, 5000, \rq, 0.08]);
)
// globalize the filter cutoff
b = v.mapGlobal(\ffreq);
(
SynthDef.new("SinLFO", { // sinewave lfo
arg outbus, freq = 1, phase = 0, mul = 1, add = 0;
ReplaceOut.kr(outbus, SinOsc.kr(freq, phase, mul, add));
}).load(Server.local);
)
l = Synth.new("SinLFO", [\freq, 0.2, \mul, 500, \add, 1400, \outbus, b.index]);
// all notes have the same filter LFO
v.trigger([60, 64, 67].midicps);
v.unmapGlobal(\ffreq); // LFO stops
v.mapGlobal(\ffreq, b); // set LFO to bus (which is still active)
v.release([60, 64, 67].midicps);
l.free;
m = Array.fill(5, { arg i; MixerChannel("test" ++ (i+1), s) });
n = MixerChannel("essai", s);
z = MixingBoard("test board", nil, m, n);