Skip to content

Instantly share code, notes, and snippets.

@lvm
Last active December 1, 2016 00:59
Show Gist options
  • Save lvm/2fd7796f42699ec51b2689b2e3d692a0 to your computer and use it in GitHub Desktop.
Save lvm/2fd7796f42699ec51b2689b2e3d692a0 to your computer and use it in GitHub Desktop.
\bassy synthdef for supercollider (and superdirt)
SynthDef(\bassy, {|out=0, freq=440, ctf=1000, rq = 0.5, attack=0.001, release=1, lpcutoff=5000, amp=0.1, mul=1, pan=0.5|
var sig = LFSaw.ar(freq) * 0.5;
var env = EnvGen.ar(Env.perc(attack, release), doneAction:2);
sig = mul * BHiPass.ar(RLPF.ar(sig, lpcutoff*env, rq), ctf, rq);
OffsetOut.ar(out, DirtPan.ar(sig*amp, ~dirt.numChannels, pan, env))
}).add;
d1 $
jux rev $
stut 4 0.5 0.75 $
n "0(6,8)"
# s "bassy"
# attack "0"
# release "0.5"
# rq (scale 0.1 0.2 sine1)
# lpcutoff (every 3 ((fmap(+1000))) "800")
# ctf (rev $ scale 500 1000 sine1)
# vowel "i"
# room "0.25"
# orbit "2"
# gain (palindrome $ scale 0.75 0.85 sine1)
@telephon
Copy link

Re: var sig = Mix.ar(LFSaw.ar(freq*fmul))/2;

-- sounds the same, but avoids division:
var sig = LFSaw.ar(freq * fmul) * 0.5

Re: sig = Pan2.ar(sig, pan)*env;

there is already the DirtPan that should do it for you. better not to double-pan?

@lvm
Copy link
Author

lvm commented Nov 30, 2016

Ah! just saw it, thanks @telephon !

@bgold-cosmos
Copy link

bgold-cosmos commented Nov 30, 2016

The attack, release, and cutoff parameters are also used elsewhere by SuperDirt, so you may be doubling up on the amplitude envelope and lowpass as well (although your filter gets the envelope). That doesn't hurt anything, though, and might sound better that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment