Last active
January 1, 2024 21:59
-
-
Save kindohm/a782bae1a43788c1651e8672c89e9d95 to your computer and use it in GitHub Desktop.
DMK's synthdef "no value without utility"
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.new(\DFM1ping, { |out, freq = 440, attack = 1, release = 1, gain = 1, pan = 0, | |
| resonance = 0, sustain = 2, transitionTime = 0.875, | |
| disProb = 0, disMult =0, ringzAmp = 1, pulseAmp = 0 | | |
| var sig, env, resonanceEnv ; | |
| freq = freq.clip(20, 20000); | |
| env = EnvGen.kr(Env.new([0, 1, 1, 0], [attack, sustain, release], \sine)) ; // An envelope for some stuff. Mostly amplitude. It goes up, then holds there, then goes down again. | |
| resonanceEnv = EnvGen.ar(Env.new([resonance, resonance, resonance, 0.9], [attack, sustain, release], curve: \sine)) ; // An envelope for the resonance. | |
| sig = DFM1.ar(BrownNoise.ar(1)*Decay.ar(Impulse.ar(0.01),0.1),freq,resonanceEnv) ; // This filter is a special treat. It has character. Get the SC3 plugins now. | |
| sig = sig + (Ringz.ar(Dust2.ar(freq.range(0.0,0.0009765625)),freq,attack+sustain+release,ringzAmp) * 0.00025) ; // Ringz is a ringing filter. | |
| sig = sig + (DFM1.ar(VarSaw.ar(freq, width: 3.125e-08),freq*5,0)* pulseAmp) ; // A variable saw with a fancy low pass filter after it. | |
| sig = Disintegrator.ar(sig, Line.ar(disProb.clip(0.0, 1.0), 0, attack), disMult.clip(0.0, 1.0), 1) * env ; // This makes clicks n pops. | |
| sig = sig * AmpCompA.kr(freq,17.323914436055); // AmpComp does a kind of compensation that follows your hearing. I found it very useful. | |
| sig = Pan2.ar(sig, Line.ar(0, pan, transitionTime), gain) ; // Panning. | |
| sig = (sig * 140) ; // Turn it up a notch ok 'cause otherwise it won't be loud enough. | |
| sig = LeakDC.ar(sig) ; // This protects against DC offset. | |
| sig = HPF.ar( sig, 100 ) ; // This is a high pass filter. | |
| OffsetOut.ar(out, DirtPan.ar(sig, ~dirt.numChannels, pan, env)) | |
| }).add; |
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
| let | |
| disProb = pF "disProb" | |
| disMult = pF "disMult" | |
| ringzAmp = pF "ringzAmp" | |
| pulseAmp = pF "pulseAmp" | |
| transitionTime = pF "transitionTime" | |
| d2 | |
| $ slow 1 | |
| $ (slow ((448729 <~) $ choose [1, 0.25, 2, 1.5, 0.75, 2.5, 0.5, 1])) | |
| $ (|+ note ((3344 <~) $ choose [0,12,24,-12,-24])) | |
| $ (|+ note ((32344 <~) $ choose [0])) | |
| $ gain 0.9 | |
| # note (scale "[major major major major]/16" ((131 <~) $ choose [0,1,2,3,4,5,6,7,8,10])) | |
| # s "DFM1ping" | |
| # attack ((11 <~) $ choose [2,3,4,5]) | |
| # release ((11 <~) $ choose [2,3,4,5]) | |
| # sustain ((2*) $ (11 <~) $ choose [2,3,4,5]) | |
| # resonance (range 0.997 0.9999 $ slow 3179 rand) | |
| # transitionTime (range 1 6 $ slow 33 rand) | |
| # pulseAmp (range 0.0001 0.0003 $ slow 32849 rand) | |
| # disProb 0.005 | |
| # disMult 0.0001 | |
| # ringzAmp (range 0 0.9 $ slow 88829 rand) | |
| # pan rand | |
| # room 0.4 | |
| # size 0.97 | |
| # cps 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment