Skip to content

Commit

Permalink
Them changes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmkarlsson authored Sep 6, 2024
1 parent 881f8a6 commit 3b9f620
Show file tree
Hide file tree
Showing 28 changed files with 400 additions and 394 deletions.
35 changes: 18 additions & 17 deletions classes/CleanAux.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set up auxs in the startup.scd file. Look for this line:
~clean.start([0,2,4,6]);
The above line gives you 8 outputs.
Another way to set your auxs would be to use them as sends to different effects:
Another way to set up your auxs would be to use them as sends to different effects:
~clean.start([0,0,0]);
Expand All @@ -20,7 +20,7 @@ It is also possible to use both delay and reverb on the same aux.

CleanAux {

var <clean, <outBus, <auxIndex;
var <clean, <outBus, <auxIndex;
var <server;
var <synthBus, <globalEffectBus, <dryBus;
var <group, <globalEffects, <cutGroups;
Expand Down Expand Up @@ -54,7 +54,7 @@ CleanAux {
this.globalEffects = [
// all global effects sleep when the input is quiet for long enough and no parameters are set.
GlobalCleanEffect(\clean_jpverb, [\jpr, \jpg, \jts, \jpd, \jps, \jed, \jmd, \jmf, \jpl, \jpm, \jph, \jlc, \jhc]),
GlobalCleanEffect(\clean_trem, [\trd, \trr, \tvr, \tvd]),
//GlobalCleanEffect(\clean_trem, [\trd, \trr, \tvr, \tvd]),
GlobalCleanEffect(\clean_hal, [\hal, \hai, \rts, \bld, \edf, \ldf, \hhp, \hlp]),
GlobalCleanEffect(\clean_delay, [\delaytime, \delayfeedback, \delaySend, \delayAmp, \lock, \cps]),
GlobalCleanEffect(\clean_reverb, [\rev, \rin, \dry]),
Expand Down Expand Up @@ -198,23 +198,25 @@ CleanAux {
~enr = 0.5;
~flp = 0;
~rma = 0;
~rmf = 0;
~rdf = 0;
~rmf = 200;
~rdf = 200;
~rdt = 10;
~jpg = 1.0;
~jts = 1.0;
~jpd = 0.8;
~jps = 0.2;
~jed = 1.0;
~jmd = 0.0;
~jmf = 0.3;
~jpl = 0.8;
~jpm = 0.6;
~jph = 0.4;
~jts = 1.0;
~jpd = 0.8;
~jps = 0.2;
~jed = 1.0;
~jmd = 0.0;
~jmf = 0.3;
~jpl = 0.8;
~jpm = 0.6;
~jph = 0.4;
~jlc = 1.0;
~jhc = 1.0;
~cai = 1.0;
//~mii = 1;
~buf = "b[0].bufnum";
~bufn = "b.size";
~unit = \r;
~midinote = #{ ~note ? ~num + (~octave * 12) };
~freq = #{
Expand Down Expand Up @@ -246,7 +248,6 @@ CleanAux {
~octaveRatio = octaveRatio;
~num = num;
~midinote = midinote;
//~note = note;
~freq.value;
}
};
Expand All @@ -261,7 +262,7 @@ CleanAux {
~detuneFreq = 0.0; // detune in Hertz
~harmonic = 1.0; // harmonic ratio
~octaveRatio = 2.0;
~num = 0; // sample number or note
~num = 0; // sample number
//~freq = #{ ~midinote.value.midicps };
~delta = 1.0;
~latency = 0.0;
Expand All @@ -287,4 +288,4 @@ CleanAux {
};
}
}
}
}
17 changes: 6 additions & 11 deletions classes/CleanEvent.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CleanEvent {
play {
event.parent = aux.defaultParentEvent;
event.use {
// snd and num stand for synth/sample and note/number
// snd and num stand for synth/sample and number
~snd ?? { this.splitName };
// unless aux wide diversion returns something, we proceed
~diversion.(this) ?? {
Expand Down Expand Up @@ -38,7 +38,7 @@ CleanEvent {
var synthEvent, synthDesc;
var soundEvent = aux.clean.soundLibrary.getEvent(~snd, ~num);
if(soundEvent.isNil) {
// only call ~notFound if no ~diversion is given that anyhow redirects control
// only call ~notFound if no ~diversion is given that somehow redirects control
if(~diversion.isNil) { ~notFound.value }
} {
// the stored sound event becomes the environment's proto slot, which partly can override its parent
Expand Down Expand Up @@ -161,7 +161,7 @@ CleanEvent {
// for every buffer, unitDuration is (and should be) defined.
~buffer !? { sustain = min(unitDuration, sustain) };

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


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

getMsgFunc { |instrument|
Expand Down Expand Up @@ -264,9 +263,5 @@ CleanEvent {
});
});
});

}


}

}
7 changes: 1 addition & 6 deletions classes/CleanEventTypes.sc
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,7 @@ CleanEventTypes {
};

true // always return something != nil to end processing in CleanEvent

}

)
}

}


}
5 changes: 2 additions & 3 deletions classes/CleanModule.sc
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
CleanModules encapsulate two functions:
1) For testing for parameters (whether or not to start a synth at all).
1) For testing parameters (whether or not to start a synth at all).
2) Activated when the parameters are found in the message.
*/


CleanModule {
var <name, <func, <test;

Expand All @@ -33,4 +32,4 @@ CleanModule {
storeArgs {
^[name, func, test]
}
}
}
4 changes: 2 additions & 2 deletions classes/CleanSoundLibrary.sc
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ CleanSoundLibrary {
var path;
path = Main.packages.asDict.at('SuperClean');
if (path.isNil, {
path = Main.packages.asDict.at('SuperClean-master');
path = Main.packages.asDict.at('SuperClean-main');
if (path.isNil, {
"SuperClean:: The SuperClean root folder should be named either 'SuperClean' or 'SuperClean-master'".warn;
"SuperClean:: The SuperClean root folder should be named either 'SuperClean' or 'SuperClean-main'".warn;
})
});
^path
Expand Down
2 changes: 1 addition & 1 deletion classes/GlobalCleanEffect.sc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GlobalCleanEffect {
)
}

release { |releaseTime = 0.2|
release { |releaseTime = 0.02|
if(synth.notNil) {
synth.server.sendBundle(nil,
['/error', -1], // Surpress error, because we don't keep track of server state.
Expand Down
2 changes: 0 additions & 2 deletions classes/SuperClean.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
SuperCollider implementation of Clean.
This object handles local effects.
These are relative to a server and a number of output channels.
It keeps a number of clean auxs (see below).
Expand Down
1 change: 0 additions & 1 deletion classes/SuperCleanExtBuffer.sc
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@
buffer
}
}

}
116 changes: 77 additions & 39 deletions examples.scd
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,40 @@
// deterministic operations, indefinite duration
(
Pdef(0,
Pseed(4,
Pseed(8,
Pbind(*[
type: \cln,
snd: \fmx,
dup: Pexprand(9, 99),
hr1: Pdup(Pkey(\dup) - Pwhite(0, 7), Pshuf((1 .. 4), inf)),
hr2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((1 .. 4), inf)),
hr3: Pdup(Pkey(\dup) - Pwhite(0, 7), Pshuf((1 .. 4), inf)),
hr4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((1 .. 4), inf)),
fdb: Pexprand(0.0001, 100.0),
mi2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((0.0001 .. 4.0), inf)),
mi3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((0.0001 .. 4.0), inf)),
mi4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pshuf((0.0001 .. 4.0), inf)),
amp: Pexprand(0.3, 0.8),
en1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pexprand(0.0001, 0.555)),
dup: Pexprand(9, 29),
hr1: Pdup(Pkey(\dup) - Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
hr2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
hr3: Pdup(Pkey(\dup) - Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
hr4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((1 .. 5), inf)),
mi1: Pexprand(0.00001, 19.0),
mi2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((0.1 .. 5.0), inf)).trace,
mi3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((0.1 .. 5.0), inf)),
mi4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pxshuf((0.1 .. 5.0), inf)),
en1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pexprand(0.01, 0.555)),
en2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pkey(\en1) * Pexprand(0.2, 0.666)),
en3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pkey(\en1) * Pkey(\en2) / Pexprand(0.3, 0.777)),
en4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pkey(\en1) * Pkey(\en2) / Pkey(\en3) * Pexprand(0.4, 0.888)),
cu1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
cu2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
cu3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
cu4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pwhite(0.25, 1.0)),
dur: Pdup(Pkey(\dup) + Pwhite(2, 9), 2 / Pbrown(5, 19, Pwhite(1, 3), inf)),
legato: Pkey(\dur) * Pexprand(16, 64),
freq: (Pdup(Pexprand(4, 32), 10 * Pexprand(1, 5).round)
* Pdup(Pexprand(1, 64), Pexprand(1, 5)).round
* Pdup(Pkey(\dup), Pexprand(1, 7).round)),
cav: 1,
ca1: Pseg(Pexprand(0.25, 1.0), Pexprand(8.0, 64.0), \welch, inf),
pan: Pbrown(0.0, 1.0, Pdup(Pwhite(1, 3), Pwhite(0.01, 0.1))).trace,
atk: Pexprand(0.01, 4.0),
cu1: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
cu2: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
cu3: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
cu4: Pdup(Pkey(\dup) + Pwhite(0, 7), Pmeanrand(-4.0, 4.0)),
amp: Pdup(Plprand(1, 5), Pexprand(0.25, 0.5)),
dur: 1 / Pdup(Pkey(\dup) + Pwhite(2, 9), Pbrown(5, 19, Pwhite(1, 3), inf)),
freq: (Pdup(Pexprand(4, 32), 10 * Pexprand(1, 5).asInteger)
* Pdup(Pexprand(1, 64), Pexprand(1, 5).asInteger)
* Pdup(Pkey(\dup), Pexprand(1, 7).asInteger)),
cav: 2,
cai: Pseg(Phprand(0.5, 1.0), Pexprand(8.0, 64.0), \welch, inf),
pan: Pbrown(0.0, 1.0, Pdup(Pwhite(1, 3), Pwhite(0.01, 0.1))),
atk: Pexprand(1.0, 8.0),
hld: Pkey(\dur) * 2,
rel: Pkey(\dur) * 2,
crv: 5,
sustain: Pexprand(2.5, 5.0),
crv: 3,
sustain: Pkey(\atk) + Pkey(\hld) + Pkey(\rel) * 8,
])
)
).play
Expand All @@ -52,29 +51,29 @@ Pdef(0,
type: \cln,
snd: \mmd,
num: Pwhite(0, 23),
dur: Pwrand([1/12, 1/3], [9, 1].normalizeSum, inf),
dur: Pwrand2([1/12, 1/3], [9, 1], inf),
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),
amp: Pexprand(1.0, 8.0),
pan: Pdup(Pwhite(0, 28), Pwrand([Pwhite(0.0, 0.333), Pwhite(0.666, 1.0)], [1, 1.5].normalizeSum, inf)),
lpf: Pwrand([625, 1250, 2500, 5000, 10000, 20000], (1 .. 6).normalizeSum, inf),
spd: Pwrand([
1/64, 1/32, 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64],
[1, 2, 4, 8, 16, 32, 64, 32, 16, 8, 4, 2, 1].normalizeSum,inf),
pan: Pdup(Pwhite(0, 28), Pwrand2([Pwhite(0.0, 0.333), Pwhite(0.666, 1.0)], [1, 1.5], inf)),
lpf: Pwrand2([625, 1250, 2500, 5000, 10000, 20000], (1 .. 6), inf),
spd: Pwrand2([
1/64, 1/32, 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64],
[1, 2, 4, 8, 16, 32, 64, 32, 16, 8, 4, 2, 1],inf),
shp: Pwhite(0.0, 1.0).trace,
dla: 0.001,
dlf: 0.94,
dlt: 1/2 / Pdup(Pwrand([1, 2, 3], [256, 16, 1].normalizeSum,inf), Pbrown(1, 199, Prand((1 .. 19), inf))),
rin: Pwrand([0,0.05], [9, 1].normalizeSum, inf),
dlt: 1/2 / Pdup(Pwrand2([1, 2, 3], [256, 16, 1],inf), Pbrown(1, 199, Prand((1 .. 19), inf))),
rin: Pwrand2([0,0.05], [9, 1], inf),
rev: 0.97,
dry: Pdup(Pwhite(1, 9), Pwrand([0.25, 1], [3, 1].normalizeSum, inf)),
dry: Pdup(Pwhite(1, 9), Pwrand2([0.25, 1], [3, 1], inf)),
hpf: 40,
]), 1, 15,
)
)
).play
)

// an example using add which is the built in additive synthesizer
// an example using add which can be used a kind of additive synthesizer
// stochastic operations, indefinite duration
(
Pdef(0,
Expand Down Expand Up @@ -114,7 +113,7 @@ Pdef(0,
hld: Pdup(Pwhite(5, 11), Pwhite(3.0, 5.0), inf),
rel: Pdup(Pwhite(5, 11), Pwhite(5.0, 11.0), inf),
crv: -8,
amp: Pseg(Pexprand(0.5, 0.9), Pexprand(0.25, 4.0), \exp, inf),
amp: Pseg(Pexprand(0.425, 0.85), Pexprand(0.25, 4.0), \exp, inf),
pan: Pwhite(0.0, 1.0),
wid: Pwhite(0.0, 1.0),
iph: Pexprand(0.0001, 1.0),
Expand Down Expand Up @@ -162,7 +161,7 @@ Pdef(0,
Pbind(*[
type: \cln,
snd: \kps,
amp: Pexprand(0.5, 1.0),
amp: Pexprand(0.4, 0.8),
freq: 32 * Prand([1, 2, 4, 8, 16], inf) * (1, 3 .. 11),
dur: 1 / Pdup(Pwhite(5, 11), Pwhite(5, 11)),
sustain: Pexprand(0.5, 4.0),
Expand Down Expand Up @@ -197,6 +196,30 @@ Pdef(0,
).play
)

( // an example using clp which is a handclap synth
// stochastic operations, indefinite duration
Pdef(0,
Pbind(*[
type: \cln,
snd: \clp,
atk: 0,
rel: Pseg(Pdup(2, Pwhite(0.2, 0.8)), Pwhite(9.0, 11.0), \lin, inf),
crv: -8,
dur: Pseg([1, 1/24], 10, \lin, inf),
stretch: Pseg(Pdup(2, Pwhite(0.01, 1.0)), Plprand(1.0, 11.0), \lin, inf),
pan: Pseg(Pdup(2, Pmeanrand(0.0, 1.0)), Plprand(1.0, 11.0), \lin, inf),
amp: Pseg(Pdup(2, Plprand(0.4, 0.8)), Plprand(1.0, 11.0), \lin, inf),
srp: Pseg(Pdup(2, Pwhite(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
srq: Pseg(Pdup(2, Pwhite(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
bdy: Pseg(Pdup(2, Plprand(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
tha: Pseg(Pdup(2, Plprand(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
tho: Pseg(Pdup(2, Plprand(0.0, 1.0)), Pwhite(9.0, 11.0), \lin, inf),
dmp: Pseg(Pdup(2, Phprand(20.0, 20000.0)), Plprand(1.0, 11.0), \lin, inf).trace,
sustain: Pkey(\rel),
])
).play
)

( // an example using dfd which is a transient / noise excited filter that can selfoscillate
Pdef(0, // deterministic operations, indefinite duration
Pseed(192,
Expand All @@ -216,6 +239,21 @@ Pdef(0, // deterministic operations, indefinite duration
).play
)

// an example using blp which is a sine wave which lets you add a number of harmonics
( // stochastic operations, finite duration
Pdef(0,
Pbind(*[
type: \cln,
snd: \blp,
dur: 1 / Pdup(Plprand(9, 49), Pwhite(7.0, 13.0)),
pan: Pseq([0, 0.25, 0.5, 1, 0.75, 0.5], 99),
nmh: Pseries(1, 1, inf) % Pseq((1 .. 39), inf).trace,
amp: (Pseries(1, 1, inf) % Pseq((1 .. 29), inf)).linlin(0, 29, 0.7, 0.9),
sustain: 9,
])
).play
)

// an example using bow which is a digital wave guide physical model of a bowed instrument
( // deterministic operations, indefinite duration
var a = Pwhite(0.0, 0.25).asStream;
Expand Down
Loading

0 comments on commit 3b9f620

Please sign in to comment.