Skip to content

Commit 3b9f620

Browse files
Them changes
1 parent 881f8a6 commit 3b9f620

28 files changed

+400
-394
lines changed

classes/CleanAux.sc

+18-17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set up auxs in the startup.scd file. Look for this line:
88
~clean.start([0,2,4,6]);
99
1010
The above line gives you 8 outputs.
11-
Another way to set your auxs would be to use them as sends to different effects:
11+
Another way to set up your auxs would be to use them as sends to different effects:
1212
1313
~clean.start([0,0,0]);
1414
@@ -20,7 +20,7 @@ It is also possible to use both delay and reverb on the same aux.
2020

2121
CleanAux {
2222

23-
var <clean, <outBus, <auxIndex;
23+
var <clean, <outBus, <auxIndex;
2424
var <server;
2525
var <synthBus, <globalEffectBus, <dryBus;
2626
var <group, <globalEffects, <cutGroups;
@@ -54,7 +54,7 @@ CleanAux {
5454
this.globalEffects = [
5555
// all global effects sleep when the input is quiet for long enough and no parameters are set.
5656
GlobalCleanEffect(\clean_jpverb, [\jpr, \jpg, \jts, \jpd, \jps, \jed, \jmd, \jmf, \jpl, \jpm, \jph, \jlc, \jhc]),
57-
GlobalCleanEffect(\clean_trem, [\trd, \trr, \tvr, \tvd]),
57+
//GlobalCleanEffect(\clean_trem, [\trd, \trr, \tvr, \tvd]),
5858
GlobalCleanEffect(\clean_hal, [\hal, \hai, \rts, \bld, \edf, \ldf, \hhp, \hlp]),
5959
GlobalCleanEffect(\clean_delay, [\delaytime, \delayfeedback, \delaySend, \delayAmp, \lock, \cps]),
6060
GlobalCleanEffect(\clean_reverb, [\rev, \rin, \dry]),
@@ -198,23 +198,25 @@ CleanAux {
198198
~enr = 0.5;
199199
~flp = 0;
200200
~rma = 0;
201-
~rmf = 0;
202-
~rdf = 0;
201+
~rmf = 200;
202+
~rdf = 200;
203203
~rdt = 10;
204204
~jpg = 1.0;
205-
~jts = 1.0;
206-
~jpd = 0.8;
207-
~jps = 0.2;
208-
~jed = 1.0;
209-
~jmd = 0.0;
210-
~jmf = 0.3;
211-
~jpl = 0.8;
212-
~jpm = 0.6;
213-
~jph = 0.4;
205+
~jts = 1.0;
206+
~jpd = 0.8;
207+
~jps = 0.2;
208+
~jed = 1.0;
209+
~jmd = 0.0;
210+
~jmf = 0.3;
211+
~jpl = 0.8;
212+
~jpm = 0.6;
213+
~jph = 0.4;
214214
~jlc = 1.0;
215215
~jhc = 1.0;
216216
~cai = 1.0;
217217
//~mii = 1;
218+
~buf = "b[0].bufnum";
219+
~bufn = "b.size";
218220
~unit = \r;
219221
~midinote = #{ ~note ? ~num + (~octave * 12) };
220222
~freq = #{
@@ -246,7 +248,6 @@ CleanAux {
246248
~octaveRatio = octaveRatio;
247249
~num = num;
248250
~midinote = midinote;
249-
//~note = note;
250251
~freq.value;
251252
}
252253
};
@@ -261,7 +262,7 @@ CleanAux {
261262
~detuneFreq = 0.0; // detune in Hertz
262263
~harmonic = 1.0; // harmonic ratio
263264
~octaveRatio = 2.0;
264-
~num = 0; // sample number or note
265+
~num = 0; // sample number
265266
//~freq = #{ ~midinote.value.midicps };
266267
~delta = 1.0;
267268
~latency = 0.0;
@@ -287,4 +288,4 @@ CleanAux {
287288
};
288289
}
289290
}
290-
}
291+
}

classes/CleanEvent.sc

+6-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CleanEvent {
1010
play {
1111
event.parent = aux.defaultParentEvent;
1212
event.use {
13-
// snd and num stand for synth/sample and note/number
13+
// snd and num stand for synth/sample and number
1414
~snd ?? { this.splitName };
1515
// unless aux wide diversion returns something, we proceed
1616
~diversion.(this) ?? {
@@ -38,7 +38,7 @@ CleanEvent {
3838
var synthEvent, synthDesc;
3939
var soundEvent = aux.clean.soundLibrary.getEvent(~snd, ~num);
4040
if(soundEvent.isNil) {
41-
// only call ~notFound if no ~diversion is given that anyhow redirects control
41+
// only call ~notFound if no ~diversion is given that somehow redirects control
4242
if(~diversion.isNil) { ~notFound.value }
4343
} {
4444
// the stored sound event becomes the environment's proto slot, which partly can override its parent
@@ -161,7 +161,7 @@ CleanEvent {
161161
// for every buffer, unitDuration is (and should be) defined.
162162
~buffer !? { sustain = min(unitDuration, sustain) };
163163

164-
~fadeTime = min(~fadeTime.value, sustain * 0.19098);
164+
~fadeTime = min(~fadeTime.value, sustain * 0.19098); // is this number magic?
165165
~fadeInTime = if(~bgn != 0) { ~fadeTime } { 0.0 };
166166
~sustain = sustain - (~fadeTime + ~fadeInTime);
167167
~spd = spd;
@@ -174,14 +174,13 @@ CleanEvent {
174174
~amp = pow(~amp, 1) * ~amp;
175175
~channel !? { ~pan = ~pan.value + (~channel.value / ~numChannels) };
176176
~pan = ~pan * 2 - 1; // convert unipolar (0..1) range into bipolar one (-1...1)
177-
~delayAmp = ~dla ? 0.0; // below is how you would rename parameter names to anything you want
177+
~delayAmp = ~dla ? 0.0;
178178
~delaytime = ~dlt ? 0.0;
179179
~delayfeedback = ~dlf ? 0.0;
180180
~bandf = ~bpf ? 0.0;
181181
~bandq = ~bpq ? 0.0;
182182

183-
184-
~latency = ~latency + ~lag.value + (~offset.value * ~spd.value); // don't accidentally change this tho
183+
~latency = ~latency + ~lag.value + (~offset.value * ~spd.value);
185184
}
186185

187186
getMsgFunc { |instrument|
@@ -264,9 +263,5 @@ CleanEvent {
264263
});
265264
});
266265
});
267-
268266
}
269-
270-
271-
}
272-
267+
}

classes/CleanEventTypes.sc

+1-6
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,7 @@ CleanEventTypes {
121121
};
122122

123123
true // always return something != nil to end processing in CleanEvent
124-
125124
}
126-
127125
)
128126
}
129-
130-
}
131-
132-
127+
}

classes/CleanModule.sc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/*
22
33
CleanModules encapsulate two functions:
4-
1) For testing for parameters (whether or not to start a synth at all).
4+
1) For testing parameters (whether or not to start a synth at all).
55
2) Activated when the parameters are found in the message.
66
77
*/
88

9-
109
CleanModule {
1110
var <name, <func, <test;
1211

@@ -33,4 +32,4 @@ CleanModule {
3332
storeArgs {
3433
^[name, func, test]
3534
}
36-
}
35+
}

classes/CleanSoundLibrary.sc

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ CleanSoundLibrary {
130130
var path;
131131
path = Main.packages.asDict.at('SuperClean');
132132
if (path.isNil, {
133-
path = Main.packages.asDict.at('SuperClean-master');
133+
path = Main.packages.asDict.at('SuperClean-main');
134134
if (path.isNil, {
135-
"SuperClean:: The SuperClean root folder should be named either 'SuperClean' or 'SuperClean-master'".warn;
135+
"SuperClean:: The SuperClean root folder should be named either 'SuperClean' or 'SuperClean-main'".warn;
136136
})
137137
});
138138
^path

classes/GlobalCleanEffect.sc

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GlobalCleanEffect {
2626
)
2727
}
2828

29-
release { |releaseTime = 0.2|
29+
release { |releaseTime = 0.02|
3030
if(synth.notNil) {
3131
synth.server.sendBundle(nil,
3232
['/error', -1], // Surpress error, because we don't keep track of server state.

classes/SuperClean.sc

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/*
22
3-
SuperCollider implementation of Clean.
4-
53
This object handles local effects.
64
These are relative to a server and a number of output channels.
75
It keeps a number of clean auxs (see below).

classes/SuperCleanExtBuffer.sc

-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
buffer
2424
}
2525
}
26-
2726
}

examples.scd

+77-39
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,40 @@
22
// deterministic operations, indefinite duration
33
(
44
Pdef(0,
5-
Pseed(4,
5+
Pseed(8,
66
Pbind(*[
77
type: \cln,
88
snd: \fmx,
9-
dup: Pexprand(9, 99),
10-
hr1: Pdup(Pkey(\dup) - Pwhite(0, 7), Pshuf((1 .. 4), inf)),
11-
hr2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((1 .. 4), inf)),
12-
hr3: Pdup(Pkey(\dup) - Pwhite(0, 7), Pshuf((1 .. 4), inf)),
13-
hr4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((1 .. 4), inf)),
14-
fdb: Pexprand(0.0001, 100.0),
15-
mi2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((0.0001 .. 4.0), inf)),
16-
mi3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((0.0001 .. 4.0), inf)),
17-
mi4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((0.0001 .. 4.0), inf)),
18-
amp: Pexprand(0.3, 0.8),
19-
en1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pexprand(0.0001, 0.555)),
9+
dup: Pexprand(9, 29),
10+
hr1: Pdup(Pkey(\dup) - Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
11+
hr2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
12+
hr3: Pdup(Pkey(\dup) - Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
13+
hr4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
14+
mi1: Pexprand(0.00001, 19.0),
15+
mi2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((0.1 .. 5.0), inf)).trace,
16+
mi3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((0.1 .. 5.0), inf)),
17+
mi4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((0.1 .. 5.0), inf)),
18+
en1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pexprand(0.01, 0.555)),
2019
en2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pkey(\en1) * Pexprand(0.2, 0.666)),
2120
en3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pkey(\en1) * Pkey(\en2) / Pexprand(0.3, 0.777)),
2221
en4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pkey(\en1) * Pkey(\en2) / Pkey(\en3) * Pexprand(0.4, 0.888)),
23-
cu1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
24-
cu2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
25-
cu3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
26-
cu4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
27-
dur: Pdup(Pkey(\dup) + Pwhite(2, 9), 2 / Pbrown(5, 19, Pwhite(1, 3), inf)),
28-
legato: Pkey(\dur) * Pexprand(16, 64),
29-
freq: (Pdup(Pexprand(4, 32), 10 * Pexprand(1, 5).round)
30-
* Pdup(Pexprand(1, 64), Pexprand(1, 5)).round
31-
* Pdup(Pkey(\dup), Pexprand(1, 7).round)),
32-
cav: 1,
33-
ca1: Pseg(Pexprand(0.25, 1.0), Pexprand(8.0, 64.0), \welch, inf),
34-
pan: Pbrown(0.0, 1.0, Pdup(Pwhite(1, 3), Pwhite(0.01, 0.1))).trace,
35-
atk: Pexprand(0.01, 4.0),
22+
cu1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
23+
cu2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
24+
cu3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
25+
cu4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
26+
amp: Pdup(Plprand(1, 5), Pexprand(0.25, 0.5)),
27+
dur: 1 / Pdup(Pkey(\dup) + Pwhite(2, 9), Pbrown(5, 19, Pwhite(1, 3), inf)),
28+
freq: (Pdup(Pexprand(4, 32), 10 * Pexprand(1, 5).asInteger)
29+
* Pdup(Pexprand(1, 64), Pexprand(1, 5).asInteger)
30+
* Pdup(Pkey(\dup), Pexprand(1, 7).asInteger)),
31+
cav: 2,
32+
cai: Pseg(Phprand(0.5, 1.0), Pexprand(8.0, 64.0), \welch, inf),
33+
pan: Pbrown(0.0, 1.0, Pdup(Pwhite(1, 3), Pwhite(0.01, 0.1))),
34+
atk: Pexprand(1.0, 8.0),
3635
hld: Pkey(\dur) * 2,
3736
rel: Pkey(\dur) * 2,
38-
crv: 5,
39-
sustain: Pexprand(2.5, 5.0),
37+
crv: 3,
38+
sustain: Pkey(\atk) + Pkey(\hld) + Pkey(\rel) * 8,
4039
])
4140
)
4241
).play
@@ -52,29 +51,29 @@ Pdef(0,
5251
type: \cln,
5352
snd: \mmd,
5453
num: Pwhite(0, 23),
55-
dur: Pwrand([1/12, 1/3], [9, 1].normalizeSum, inf),
54+
dur: Pwrand2([1/12, 1/3], [9, 1], inf),
5655
rel: Pdup(Pwhite(1, 8), Pseq([1/16, 1/17, 1/18, 1/19, 1/20, 1/21, 1/22, 1/8, 2], inf)) * Pexprand(0.1, 10.0),
5756
amp: Pexprand(1.0, 8.0),
58-
pan: Pdup(Pwhite(0, 28), Pwrand([Pwhite(0.0, 0.333), Pwhite(0.666, 1.0)], [1, 1.5].normalizeSum, inf)),
59-
lpf: Pwrand([625, 1250, 2500, 5000, 10000, 20000], (1 .. 6).normalizeSum, inf),
60-
spd: Pwrand([
61-
1/64, 1/32, 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64],
62-
[1, 2, 4, 8, 16, 32, 64, 32, 16, 8, 4, 2, 1].normalizeSum,inf),
57+
pan: Pdup(Pwhite(0, 28), Pwrand2([Pwhite(0.0, 0.333), Pwhite(0.666, 1.0)], [1, 1.5], inf)),
58+
lpf: Pwrand2([625, 1250, 2500, 5000, 10000, 20000], (1 .. 6), inf),
59+
spd: Pwrand2([
60+
1/64, 1/32, 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64],
61+
[1, 2, 4, 8, 16, 32, 64, 32, 16, 8, 4, 2, 1],inf),
6362
shp: Pwhite(0.0, 1.0).trace,
6463
dla: 0.001,
6564
dlf: 0.94,
66-
dlt: 1/2 / Pdup(Pwrand([1, 2, 3], [256, 16, 1].normalizeSum,inf), Pbrown(1, 199, Prand((1 .. 19), inf))),
67-
rin: Pwrand([0,0.05], [9, 1].normalizeSum, inf),
65+
dlt: 1/2 / Pdup(Pwrand2([1, 2, 3], [256, 16, 1],inf), Pbrown(1, 199, Prand((1 .. 19), inf))),
66+
rin: Pwrand2([0,0.05], [9, 1], inf),
6867
rev: 0.97,
69-
dry: Pdup(Pwhite(1, 9), Pwrand([0.25, 1], [3, 1].normalizeSum, inf)),
68+
dry: Pdup(Pwhite(1, 9), Pwrand2([0.25, 1], [3, 1], inf)),
7069
hpf: 40,
7170
]), 1, 15,
7271
)
7372
)
7473
).play
7574
)
7675

77-
// an example using add which is the built in additive synthesizer
76+
// an example using add which can be used a kind of additive synthesizer
7877
// stochastic operations, indefinite duration
7978
(
8079
Pdef(0,
@@ -114,7 +113,7 @@ Pdef(0,
114113
hld: Pdup(Pwhite(5, 11), Pwhite(3.0, 5.0), inf),
115114
rel: Pdup(Pwhite(5, 11), Pwhite(5.0, 11.0), inf),
116115
crv: -8,
117-
amp: Pseg(Pexprand(0.5, 0.9), Pexprand(0.25, 4.0), \exp, inf),
116+
amp: Pseg(Pexprand(0.425, 0.85), Pexprand(0.25, 4.0), \exp, inf),
118117
pan: Pwhite(0.0, 1.0),
119118
wid: Pwhite(0.0, 1.0),
120119
iph: Pexprand(0.0001, 1.0),
@@ -162,7 +161,7 @@ Pdef(0,
162161
Pbind(*[
163162
type: \cln,
164163
snd: \kps,
165-
amp: Pexprand(0.5, 1.0),
164+
amp: Pexprand(0.4, 0.8),
166165
freq: 32 * Prand([1, 2, 4, 8, 16], inf) * (1, 3 .. 11),
167166
dur: 1 / Pdup(Pwhite(5, 11), Pwhite(5, 11)),
168167
sustain: Pexprand(0.5, 4.0),
@@ -197,6 +196,30 @@ Pdef(0,
197196
).play
198197
)
199198

199+
( // an example using clp which is a handclap synth
200+
// stochastic operations, indefinite duration
201+
Pdef(0,
202+
Pbind(*[
203+
type: \cln,
204+
snd: \clp,
205+
atk: 0,
206+
rel: Pseg(Pdup(2, Pwhite(0.2, 0.8)), Pwhite(9.0, 11.0), \lin, inf),
207+
crv: -8,
208+
dur: Pseg([1, 1/24], 10, \lin, inf),
209+
stretch: Pseg(Pdup(2, Pwhite(0.01, 1.0)), Plprand(1.0, 11.0), \lin, inf),
210+
pan: Pseg(Pdup(2, Pmeanrand(0.0, 1.0)), Plprand(1.0, 11.0), \lin, inf),
211+
amp: Pseg(Pdup(2, Plprand(0.4, 0.8)), Plprand(1.0, 11.0), \lin, inf),
212+
srp: Pseg(Pdup(2, Pwhite(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
213+
srq: Pseg(Pdup(2, Pwhite(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
214+
bdy: Pseg(Pdup(2, Plprand(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
215+
tha: Pseg(Pdup(2, Plprand(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
216+
tho: Pseg(Pdup(2, Plprand(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
217+
dmp: Pseg(Pdup(2, Phprand(20.0, 20000.0)), Plprand(1.0, 11.0), \lin, inf).trace,
218+
sustain: Pkey(\rel),
219+
])
220+
).play
221+
)
222+
200223
( // an example using dfd which is a transient / noise excited filter that can selfoscillate
201224
Pdef(0, // deterministic operations, indefinite duration
202225
Pseed(192,
@@ -216,6 +239,21 @@ Pdef(0, // deterministic operations, indefinite duration
216239
).play
217240
)
218241

242+
// an example using blp which is a sine wave which lets you add a number of harmonics
243+
( // stochastic operations, finite duration
244+
Pdef(0,
245+
Pbind(*[
246+
type: \cln,
247+
snd: \blp,
248+
dur: 1 / Pdup(Plprand(9, 49), Pwhite(7.0, 13.0)),
249+
pan: Pseq([0, 0.25, 0.5, 1, 0.75, 0.5], 99),
250+
nmh: Pseries(1, 1, inf) % Pseq((1 .. 39), inf).trace,
251+
amp: (Pseries(1, 1, inf) % Pseq((1 .. 29), inf)).linlin(0, 29, 0.7, 0.9),
252+
sustain: 9,
253+
])
254+
).play
255+
)
256+
219257
// an example using bow which is a digital wave guide physical model of a bowed instrument
220258
( // deterministic operations, indefinite duration
221259
var a = Pwhite(0.0, 0.25).asStream;

0 commit comments

Comments
 (0)