-
Notifications
You must be signed in to change notification settings - Fork 1
/
StageMaster.sc
66 lines (58 loc) · 2.17 KB
/
StageMaster.sc
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
StageMaster
{
classvar masterSynth, masterFunc, activeSynth;
*activate
{ |numChannels = 2, compThreshold = 0.7, limiterLevel = 1.0, highEndDb = 3.0|
fork
{
masterFunc =
{
{
activeSynth =
Synth(\stageMaster,
target: RootNode(Server.default),
addAction: \addToTail
);
}.defer(0.01)
};
masterSynth = SynthDef(
\stageMaster,
{
var input = In.ar(0, numChannels);
// Remove DC offset
input = Select.ar(CheckBadValues.ar(input, 0, 0), [input, DC.ar(0), DC.ar(0), input]);
// Compressor
input = Compander.ar(
input,
input,
thresh: compThreshold,
slopeBelow: 1.05,
slopeAbove: 0.4,
clampTime: 0.01,
relaxTime: 0.01
);
// Hi-shelf EQ, for brightness
input = BHiShelf.ar(
input,
freq: 2400.0,
rs: 1.0,
db: highEndDb
);
// Limiter
input = Limiter.ar(input, limiterLevel);
ReplaceOut.ar(0, input);
}
).add;
Server.default.sync;
masterFunc.value;
CmdPeriod.add(masterFunc);
"StageMaster activated".postln;
}
}
*deactivate
{
activeSynth.free;
CmdPeriod.remove(masterFunc);
"StageMaster inactive...".postln;
}
}