ark_d.amorphic/lib/softSaw.scd

26 lines
647 B
Plaintext
Raw Normal View History

2020-04-08 15:04:49 +02:00
(
SynthDef(\softSaw, {
arg out = 0, freq = 40, oscdetune = 0.1, amp = 1, pan = 0,
gate = 1, attackTime = 0.1, susLevel = 1.0, releaseTime = 1.0;
var env, snd;
oscdetune = oscdetune * 0.1;
amp = amp * 0.4;
env = Linen.kr(gate, attackTime, susLevel, releaseTime, doneAction:2);
snd = VarSaw.ar(
freq: [freq, freq * (1.003 + oscdetune)],
width: SinOsc.kr(0.01,0.2).range(0.05,0.095));
snd = snd + VarSaw.ar(
freq: [(freq*2 * (1.001 - oscdetune)),(freq*2 * (1 + oscdetune))],
width: SinOsc.kr(0.06,0.8).range(0.2,0.8));
snd = Balance2.ar(snd.at(0), snd.at(1), pos: pan);
snd = snd * amp * env;
Out.ar(out, snd);
}).add;
);