1
0

initial commit

This commit is contained in:
2025-02-26 07:33:14 +01:00
commit 13e794f44b
21 changed files with 515 additions and 0 deletions

48
pad.scd Normal file
View File

@ -0,0 +1,48 @@
2.midiratio
(
SynthDef(\pad, {
arg freq = 440, gate = 1;
var env, rel, sig, sig2, detuner1, detuner2;
rel = \rel.kr(1);
env = EnvGen.ar(Env.asr(1.2, 0.5, 3), gate, doneAction: Done.freeSelf);
// this is the key part: several oscillators in UNISON, here using a noise ugen
sig = LFSaw.ar((-5..5).collect({|i| freq + i}), LFTri.kr(0.05).range(1, 2));
sig = Splay.ar(sig, 0.1);
sig = RLPF.ar(sig, [3000, 2000, 1250, 600] * LFNoise2.kr(1).range(0.5, 1.2), 0.4);
sig = Splay.ar(sig, 0.1);
sig = HPF.ar(sig, 150);
sig = sig * env;
sig = sig * \amp.kr(1);
Out.ar(\out.kr(0), Limiter.ar(sig));
}).add;
)
(
MIDIClient.init;
MIDIIn.connectAll;
MIDIFunc.trace(true);
)
(
~synths = Array.fill(127, nil);
MIDIdef.noteOn(\on, {
arg val, num, chan,src;
if(~synths[num] == nil, { // To be absolutely save
~synths[num] = Synth(\pad, [
\amp, 0.5,
\freq, num.midicps,
\harm, exprand(4,20)]);
});
});
MIDIdef.noteOff(\off, {
arg val, num, chan,src;
if(~synths[num] != nil, { // To be absolutely safe
~synths[num].set(\gate, 0);
~synths[num] = nil; // Remove the reference
});
});
)
(-10..10)