Last active
September 17, 2023 12:00
-
-
Save reprimande/5a92483787fdd379d8b4efdf30fea5be to your computer and use it in GitHub Desktop.
SynthDef 20230916
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SynthDef(\saw1, { | |
var snd, freq, ratio, spread, spreadTo, num, freqs, amps, detune, attack, decay, modSpread, modrate, modamount; | |
freq = \freq.kr(440); | |
attack = \attack.kr(0.0001); | |
decay = \decay.kr(1); | |
spread = \spread.kr(0.1); | |
spreadTo = \spreadTo.kr(0.003); | |
modrate = \modrate.kr(0.4); | |
modamount = \modamount.kr(0); | |
modSpread = Line.kr(1, spreadTo, decay) + (LFNoise2.kr(modrate).linlin(-1.0, 1.0, 0.0, 1.0) * modamount); | |
num = 8; | |
snd = (1..num).collect({|i| | |
var f = freq * i.linlin( | |
1, | |
num, | |
spread.linlin(0.0, 1.0, 0.99, 1/4), | |
spread.linlin(0.0, 1.0, 1.01, 4.0), | |
3) * modSpread; | |
freqs = [0.495,0.505,0.9965, 1, 1.0035,1.9975,2.0025] * f + f; | |
amps = (1..7) - (7 / 3).floor * 0.6 + 1; | |
LFSaw.ar(freqs, 0.5, amps).sum * 1/7; | |
}).sum * 1/num; | |
snd = RLPF.ar(snd, 6000, 0.9) + RHPF.ar(snd, 800, 0.8) + snd * 1/8; | |
snd = snd * Env.perc(attack, decay, 1, 4).kr(doneAction: Done.freeSelf); | |
snd = LeakDC.ar(snd); | |
Out.ar(\out.kr(0), Pan2.ar(snd * \amp.kr(1), \pan.kr(0))); | |
}).add; | |
SynthDef(\kick1, { | |
var snd, pitchenv, filterenv, ampenv, dur; | |
pitchenv = Env.perc(0.0001, \pitchdecay.kr(0.4), 1, -12).ar(Done.none); | |
filterenv = Env.perc(0.0001, \filterdecay.kr(0.4), 1, -12).ar(Done.none); | |
ampenv = Env.perc(0.0001, \decay.kr(0.8), 1, 1).ar(doneAction: Done.freeSelf); | |
snd = LFSaw.ar(pitchenv * \freq.kr(300) + \lofreq.kr(30), 0); | |
snd = RLPF.ar(snd, filterenv * 300 + 30, 0.1) * 0.1; | |
snd = snd + LFPulse.ar(0,0,0.2,1.3); | |
snd = snd * ampenv * 0.5; | |
Out.ar(\out.kr(0), Pan2.ar(snd * \amp.kr(1), \pan.kr(0))); | |
}).add; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment