├── pool ├── cheappiano.scd ├── oneclap_thor.scd ├── snare_stein.scd ├── cymbal808_ryan.scd ├── forest_bird_pj.scd ├── babblingbrook_jmc.scd ├── kick_chrp.scd ├── ping_mh.scd ├── apad_mh.scd ├── acid_oto309.scd ├── kick_oto309.scd ├── clap_oto309.scd ├── snare_oto309.scd ├── sos_bell.scd ├── cs80lead_mh.scd └── cymbalic_mcld.scd ├── SynthDefPool.quark ├── SynthDefPool.html └── SynthDefPool.sc /pool/cheappiano.scd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supercollider-quarks/SynthDefPool/HEAD/pool/cheappiano.scd -------------------------------------------------------------------------------- /pool/oneclap_thor.scd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supercollider-quarks/SynthDefPool/HEAD/pool/oneclap_thor.scd -------------------------------------------------------------------------------- /pool/snare_stein.scd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supercollider-quarks/SynthDefPool/HEAD/pool/snare_stein.scd -------------------------------------------------------------------------------- /pool/cymbal808_ryan.scd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supercollider-quarks/SynthDefPool/HEAD/pool/cymbal808_ryan.scd -------------------------------------------------------------------------------- /SynthDefPool.quark: -------------------------------------------------------------------------------- 1 | ( 2 | \name: "SynthDefPool", 3 | \path: "SynthDefPool", // path relative to the root Quarks folder 4 | \summary: "a public library of handy SynthDefs", 5 | \author: "Dan Stowell. Feel free to contribute to this thematic library", 6 | \helpdoc: "SynthDefPool.html", 7 | \since: "2009" 8 | ) -------------------------------------------------------------------------------- /pool/forest_bird_pj.scd: -------------------------------------------------------------------------------- 1 | SynthDef(\forest_bird_pj, { |out=0, amp=0.1, pan=0| 2 | Out.ar(out, Pan2.ar( 3 | BPF.ar(BrownNoise.ar,SinOsc.kr(LFNoise2.kr(50,50,50),0,100,2000),0.001,10) 4 | * amp, pan))}, 5 | metadata: ( 6 | credit: "by Paul Jones, posted to sc-users mailing list 2007-04-07", 7 | tags: [\forest, \bird] 8 | ) 9 | ) 10 | -------------------------------------------------------------------------------- /pool/babblingbrook_jmc.scd: -------------------------------------------------------------------------------- 1 | SynthDef(\babblingbrook_jmc, { |out=0, amp=0.1| 2 | var son; 3 | 4 | son = ({RHPF.ar(OnePole.ar(BrownNoise.ar, 0.99), LPF.ar(BrownNoise.ar, 14) 5 | * 400 + 500, 0.03, 0.003)}!2) 6 | + ({RHPF.ar(OnePole.ar(BrownNoise.ar, 0.99), LPF.ar(BrownNoise.ar, 20) 7 | * 800 + 1000, 0.03, 0.005)}!2) * 4; 8 | Out.ar(out, son * (amp * 20)) 9 | }, 10 | metadata: ( 11 | credit: "based on code posted to sc-users 2007-04-07 by james mccartney", 12 | tags: [\babbling, \brook] 13 | ) 14 | ) 15 | -------------------------------------------------------------------------------- /pool/kick_chrp.scd: -------------------------------------------------------------------------------- 1 | // a kick made using what radio folks would call a "chirp" 2 | SynthDef(\kick_chrp, { |out=0, amp=0.1, pan=0| 3 | 4 | var ampenv, pitchenv; 5 | 6 | ampenv = EnvGen.ar(Env.perc(0, 0.2, curve: 0), doneAction: 2); 7 | pitchenv = EnvGen.ar(Env.perc(0, 0.1, curve: -20).exprange(0, 1000), doneAction: 0); 8 | 9 | Out.ar(out, Pan2.ar(SinOsc.ar(pitchenv) * amp, pan)) 10 | 11 | 12 | }, 13 | metadata: ( 14 | credit: "by dan stowell. public domain", 15 | tags: [\kick, \drum, \percussion, \chirp] 16 | ) 17 | ) 18 | -------------------------------------------------------------------------------- /pool/ping_mh.scd: -------------------------------------------------------------------------------- 1 | SynthDef(\ping_mh,{arg freq=440,amp=0.2,dur=1,attack=0.001,pan=0,out=0; 2 | var sig,freq2; 3 | freq=freq*rrand(1,1.01); 4 | freq2=freq*rrand(1,1.01); 5 | e=EnvGen.ar(Env.perc(attack,dur,curve:-4),doneAction:2); 6 | sig=SinOsc.ar([freq,freq2],0,amp*e); 7 | sig=Pan2.ar(sig,pan); 8 | Out.ar(out,sig) 9 | }, 10 | metadata: ( 11 | credit: "Your basic percussive synth instrument, a good default sound for testing patterns, etc.", 12 | tags: [\percussive, \ping, \default, \simple, \stereo, \detuned, \tuned] 13 | ) 14 | ) -------------------------------------------------------------------------------- /pool/apad_mh.scd: -------------------------------------------------------------------------------- 1 | 2 | SynthDef(\apad_mh, {arg freq=880, amp=0.5, attack=0.4, decay=0.5, sustain=0.8, release=1.0, gate=1.0, out=0; 3 | var env,sig,mod1,mod2,mod3; 4 | env=EnvGen.kr(Env.adsr(attack,decay,sustain,release),gate,levelScale:amp,doneAction:2); 5 | mod1=SinOsc.kr(6).range(freq*0.99,freq*1.01); 6 | mod2=LFNoise2.kr(1).range(0.2,1); 7 | mod3=SinOsc.kr(rrand(4.0,6.0)).range(0.5,1); 8 | sig=SinOsc.ar([freq,mod1],0,env).distort; 9 | sig=sig*mod2*mod3; 10 | Out.ar(out,sig); 11 | }, 12 | metadata:( 13 | credit: "A simple sustained sound with vibrato --Mike Hairston", 14 | tags: [\pad,\vibrato,\sustained] 15 | ) 16 | ) -------------------------------------------------------------------------------- /pool/acid_oto309.scd: -------------------------------------------------------------------------------- 1 | SynthDef("acid_oto309", { 2 | arg out=0, gate=1, freq=440, amp=0.1, pan=0; 3 | var env1, env2, son, pitch; 4 | pitch = freq.cpsmidi; 5 | pitch = Lag.kr(pitch, 0.12 * (1-Trig.kr(gate, 0.001)) * gate); 6 | env1 = EnvGen.ar(Env.new([0, 1.0, 0, 0], [0.001, 2.0, 0.04], [0, -4, -4], 2), gate, amp); 7 | env2 = EnvGen.ar(Env.adsr(0.001, 0.8, 0, 0.8, 70, -4), gate); 8 | son = LFPulse.ar(pitch.midicps, 0.0, 0.51, 2, -1); 9 | 10 | son = RLPF.ar(son, (pitch + env2).midicps, 0.3); 11 | son = son * env1; 12 | 13 | Out.ar(out, Pan2.ar(son, pan)); 14 | }, 15 | metadata: ( 16 | credit: "from 08091500Acid309 by_otophilia", 17 | tags: [\pitched, \acid, \phat, \subtractive] 18 | ) 19 | ) 20 | -------------------------------------------------------------------------------- /pool/kick_oto309.scd: -------------------------------------------------------------------------------- 1 | SynthDef("kick_oto309", { 2 | arg out=0, amp=0.1, pan=0; 3 | var env0, env1, env1m, son; 4 | 5 | env0 = EnvGen.ar(Env.new([0.5, 1, 0.5, 0], [0.005, 0.06, 0.26], [-4, -2, -4]), doneAction:2); 6 | env1 = EnvGen.ar(Env.new([110, 59, 29], [0.005, 0.29], [-4, -5])); 7 | env1m = env1.midicps; 8 | 9 | son = LFPulse.ar(env1m, 0, 0.5, 1, -0.5); 10 | son = son + WhiteNoise.ar(1); 11 | son = LPF.ar(son, env1m*1.5, env0); 12 | son = son + SinOsc.ar(env1m, 0.5, env0); 13 | 14 | son = son * 1.2; 15 | son = son.clip2(1); 16 | 17 | Out.ar(out, Pan2.ar(son * amp)); 18 | }, 19 | metadata: ( 20 | credit: "from 08091500Acid309 by_otophilia", 21 | tags: [\kick, \drum, \percussion] 22 | ) 23 | ) 24 | -------------------------------------------------------------------------------- /pool/clap_oto309.scd: -------------------------------------------------------------------------------- 1 | SynthDef("clap_oto309", { 2 | arg out=0, amp = 0.1, pan=0; 3 | var env1, env2, son, noise1, noise2; 4 | 5 | env1 = EnvGen.ar(Env.new([0, 1, 0, 1, 0, 1, 0, 1, 0], [0.001, 0.013, 0, 0.01, 0, 0.01, 0, 0.03], [0, -3, 0, -3, 0, -3, 0, -4])); 6 | env2 = EnvGen.ar(Env.new([0, 1, 0], [0.02, 0.3], [0, -4]), doneAction:2); 7 | 8 | noise1 = WhiteNoise.ar(env1); 9 | noise1 = HPF.ar(noise1, 600); 10 | noise1 = BPF.ar(noise1, 2000, 3); 11 | 12 | noise2 = WhiteNoise.ar(env2); 13 | noise2 = HPF.ar(noise2, 1000); 14 | noise2 = BPF.ar(noise2, 1200, 0.7, 0.7); 15 | 16 | son = noise1 + noise2; 17 | son = son * 2; 18 | son = son.softclip * amp; 19 | 20 | Out.ar(out, Pan2.ar(son, pan)); 21 | }, 22 | metadata: ( 23 | credit: "from 08091500Acid309 by_otophilia", 24 | tags: [\clap, \percussion] 25 | ) 26 | ) 27 | -------------------------------------------------------------------------------- /pool/snare_oto309.scd: -------------------------------------------------------------------------------- 1 | SynthDef("snare_oto309", { 2 | arg out=0, amp=0.1, pan=0; 3 | var env0, env1, env2, env1m, oscs, noise, son; 4 | 5 | env0 = EnvGen.ar(Env.new([0.5, 1, 0.5, 0], [0.005, 0.03, 0.10], [-4, -2, -4])); 6 | env1 = EnvGen.ar(Env.new([110, 60, 49], [0.005, 0.1], [-4, -5])); 7 | env1m = env1.midicps; 8 | env2 = EnvGen.ar(Env.new([1, 0.4, 0], [0.05, 0.13], [-2, -2]), doneAction:2); 9 | 10 | oscs = LFPulse.ar(env1m, 0, 0.5, 1, -0.5) + LFPulse.ar(env1m * 1.6, 0, 0.5, 0.5, -0.25); 11 | oscs = LPF.ar(oscs, env1m*1.2, env0); 12 | oscs = oscs + SinOsc.ar(env1m, 0.8, env0); 13 | 14 | noise = WhiteNoise.ar(0.2); 15 | noise = HPF.ar(noise, 200, 2); 16 | noise = BPF.ar(noise, 6900, 0.6, 3) + noise; 17 | noise = noise * env2; 18 | 19 | son = oscs + noise; 20 | son = son.clip2(1) * amp; 21 | 22 | Out.ar(out, Pan2.ar(son, pan)); 23 | }, 24 | metadata: ( 25 | credit: "from 08091500Acid309 by_otophilia", 26 | tags: [\snare, \drum, \percussion] 27 | ) 28 | ) -------------------------------------------------------------------------------- /pool/sos_bell.scd: -------------------------------------------------------------------------------- 1 | SynthDef(\sos_bell, { |freq=440, out=0, amp=0.1, pan=0| 2 | var son, strike, hum; 3 | 4 | // Stretched harmonic series 5 | son = SinOsc.ar(#[2, 3, 4.1, 5.43, 6.8, 8.21] * freq, 0, 6 | #[1, 0.9, 0.8, 0.7, 0.6, 0.5] * 0.1); 7 | 8 | son = son * EnvGen.ar(Env.new([0,1,0.3, 0.2, 0], [0, 0.3, 0.3, 0.3])); 9 | 10 | // A bit of FM adds 'warble' 11 | son = son * LFTri.ar({Rand(1.0, 1.8)}.dup(6), 1, 0.3, 0.7); 12 | 13 | // Mix down the partials in the main sound 14 | son = son.mean; 15 | 16 | strike = SinOsc.ar(LFNoise1.ar(freq * 36, 100, freq*8), 1, 0.1) * 17 | EnvGen.ar(Env.new([0,1,0.2, 0.1, 0], [0, 0.01, 0, 0.04])); 18 | 19 | hum = SinOsc.ar([freq*1.01, freq*0.47], 0, EnvGen.ar(Env.new([0,0.05,0.05,0], [0.5,0.5,1]), doneAction:2)).mean; 20 | 21 | Out.ar(out, Pan2.ar((son + strike + hum) * 4 * amp, pan)); 22 | 23 | 24 | }, 25 | metadata: ( 26 | credit: "by dan stowell. based on a sound-on-sound 'synth secrets' tutorial", 27 | tags: [\bell, \percussion, \pitched, \additive] 28 | ) 29 | ) -------------------------------------------------------------------------------- /pool/cs80lead_mh.scd: -------------------------------------------------------------------------------- 1 | SynthDef("cs80lead_mh", { 2 | arg freq=880, amp=0.5, att=0.75, decay=0.5, sus=0.8, rel=1.0, fatt=0.75, fdecay=0.5, fsus=0.8, frel=1.0, 3 | cutoff=200, pan=0, dtune=0.002, vibrate=4, vibdepth=0.015, gate=1.0, ratio=1,out=0,cbus=1; 4 | var env,fenv,vib,ffreq,sig; 5 | cutoff=In.kr(cbus); 6 | env=EnvGen.kr(Env.adsr(att,decay,sus,rel),gate,levelScale:1,doneAction:2); 7 | fenv=EnvGen.kr(Env.adsr(fatt,fdecay,fsus,frel,curve:2),gate,levelScale:1,doneAction:2); 8 | vib=SinOsc.kr(vibrate).range(-1*vibdepth,vibdepth)+1; 9 | freq=Line.kr(freq,freq*ratio,5); 10 | freq=freq*vib; 11 | sig=Mix.ar(Saw.ar([freq,freq*(1+dtune)],mul:env*amp)); 12 | // keep this below nyquist!! 13 | ffreq=max(fenv*freq*12,cutoff)+100; 14 | sig=LPF.ar(sig,ffreq); 15 | Out.ar(out, Pan2.ar(sig,pan) ); 16 | }, 17 | metadata: ( 18 | credit: "Vangelis/Blade Runner lead sound, based on tutorial by meastempo @ http://www.youtube.com/watch?v=Fne0oIEv-WI", 19 | tags: [\lead, \modulation, \analog, \cs80, \vangelis, \bladerunner] 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /pool/cymbalic_mcld.scd: -------------------------------------------------------------------------------- 1 | /* 2 | Based on the example at 3 | http://www.mcld.co.uk/cymbalsynthesis/ 4 | published 2008 by Dan Stowell 5 | 6 | Synth(\cymbalic_mcld) 7 | */ 8 | SynthDef(\cymbalic_mcld, { |out=0, pan=0, amp=0.1| 9 | var lodriver, locutoffenv, hidriver, hicutoffenv, freqs, res, thwack; 10 | 11 | locutoffenv = EnvGen.ar(Env.perc(0.5, 5)) * 20000 + 10; 12 | lodriver = LPF.ar(WhiteNoise.ar(0.1), locutoffenv); 13 | 14 | hicutoffenv = 10001 - (EnvGen.ar(Env.perc(1, 3)) * 10000); 15 | hidriver = HPF.ar(WhiteNoise.ar(0.1), hicutoffenv); 16 | hidriver = hidriver * EnvGen.ar(Env.perc(1, 2, 0.25)); 17 | 18 | thwack = EnvGen.ar(Env.perc(0.001,0.001,1)); 19 | 20 | // This bit will regenerate new freqs every time you evaluate the SynthDef! 21 | freqs = {exprand(300, 20000)}.dup(100); 22 | 23 | res = Ringz.ar(lodriver + hidriver + thwack, freqs).mean; 24 | 25 | Out.ar(out, Pan2.ar(((res * 1) + (lodriver * 2) + thwack) * amp, pan)); 26 | }, 27 | metadata: ( 28 | credit: "Based on the example at http://www.mcld.co.uk/cymbalsynthesis/ published 2008 by Dan Stowell", 29 | tags: [\percussion, \cymbal, \gong, \inharmonic, \additive, \subtractive] 30 | ) 31 | ) 32 | -------------------------------------------------------------------------------- /SynthDefPool.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 21 | 22 | 23 |

SynthDefPool a public library of handy SynthDefs

24 |


25 |

Run this line:

26 |


27 |

SynthDefPool.gui

28 |


29 |

The main purpose of this quark is as a public pool for SynthDefs that are useful/instructive/cool. Please feel free to contribute to it.

30 |


31 |


32 |

HOW TO ADD A NEW SYNTHDEF TO THE POOL:

33 |

As with all other Quarks files, to publish you need to have write access to the quarks repository. If you don't have that, try posting your code on the sc-users mailing list, I'm sure someone would be willing to add it if it's a nice synthdef!

34 |


35 |

If you do have write access to the repository, then the procedure is very simple:

36 |

Just create a new file inside the "pool" subfolder (located at 

37 |

SynthDefPool.global.poolpath

38 |

), where the filename is the SynthDef's name followed by .scd. Then use your favourite Subversion client to commit that file to the repository.

39 |


40 |

The contents of the file should be the code to create a SynthDef instance (do NOT .load or .store or .memStore or whatever, the quark code will handle this for you). Please give the synthdef a distinctive name - many people probably already have a synthdef called "kick" or "drone" or whatever. Also it'd be a good idea to make sure you follow conventions for argument names, such as "freq" "out" "gate" where relevant.

41 | 42 | 43 | -------------------------------------------------------------------------------- /SynthDefPool.sc: -------------------------------------------------------------------------------- 1 | /* 2 | SynthDefPool - a quark to facilitate sharing SynthDefs in a structured way 3 | Created by Dan Stowell 2009 4 | SynthDefPool.gui 5 | */ 6 | SynthDefPool { 7 | 8 | classvar ", Rect(0, 0, 600, 100).center_(GUI.window.screenBounds.center)); 55 | list = dict.keys(Array); 56 | list.sort; 57 | 58 | wrect = w.view.bounds; 59 | listview = GUI.popUpMenu.new(w, wrect.copy.width_(wrect.width/2 - 75).height_(50).insetBy(5, 15)).items_(list); 60 | 61 | // add a button to start and stop the sound. 62 | startButton = GUI.button.new(w, Rect(listview.bounds.right+10, listview.bounds.top, 65, listview.bounds.height)) .states_([ 63 | ["Start", Color.black, Color(0.5, 0.7, 0.5)], 64 | ["Stop", Color.white, Color(0.7, 0.5, 0.5)] 65 | ]).action_{|widg| 66 | if(widg.value==0){ 67 | if(aSynth.notNil){aSynth.free; aSynth=nil }; 68 | }{ 69 | aSynth = Synth(listview.item); 70 | OSCresponderNode(Server.default.addr, '/n_end', { |time, resp, msg| 71 | if(aSynth.notNil and: {msg[1]==aSynth.nodeID}){ 72 | // Synth has freed (itself?) so ensure button state is consistent 73 | {startButton.value=0}.defer; 74 | }; 75 | }).add.removeWhenDone; 76 | } 77 | }; 78 | cmdPeriodFunc = { startButton.value = 0; }; 79 | CmdPeriod.add(cmdPeriodFunc); 80 | // stop the sound when window closes and remove cmdPeriodFunc. 81 | w.onClose = { 82 | if(aSynth.notNil) { 83 | aSynth.free; 84 | }; 85 | CmdPeriod.remove(cmdPeriodFunc); 86 | }; 87 | 88 | GUI.button.new(w, wrect.copy.left_(wrect.width*3/6).width_(wrect.width/6).height_(50).insetBy(5, 15)) 89 | .states_([["makeWindow"]]) 90 | .action_{ SynthDescLib.at(listview.item).makeWindow }; 91 | GUI.button.new(w, wrect.copy.left_(wrect.width*4/6).width_(wrect.width/6).height_(50).insetBy(5, 15)) 92 | .states_([["usage"]]) 93 | .action_{ Document.new(string:"s.boot; 94 | SynthDefPool.at(\\"++listview.item++").memStore; // ensure the server knows about it 95 | x = Synth(\\"++listview.item++", [\\freq, 440]); 96 | x.set(\\freq, 330); 97 | " 98 | ).syntaxColorize.promptToSave_(false) }; 99 | GUI.button.new(w, wrect.copy.left_(wrect.width*5/6).width_(wrect.width/6).height_(50).insetBy(5, 15)) 100 | .states_([["source"]]) 101 | .action_{ Document.open(poolpath +/+ listview.item ++ ".scd") }; 102 | 103 | metadataview = GUI.staticText.new(w, wrect.copy.top_(50).height_(50).insetBy(5)); 104 | mdv_updater = { 105 | var desc = SynthDescLib.global[listview.item]; 106 | metadataview.string = 107 | if(desc.metadata[\credit].notNil){"Credit: %\n".format(desc.metadata[\credit])}{""} 108 | ++ 109 | if(desc.metadata[\tags].notNil){"Tags: %\n".format(desc.metadata[\tags].join(", "))}{""} 110 | ; 111 | }; 112 | mdv_updater.value; 113 | listview.action = mdv_updater; 114 | 115 | w.front; 116 | }; 117 | 118 | } 119 | 120 | *defnames { 121 | ^global.defnames 122 | } 123 | defnames { 124 | ^dict.keys 125 | } 126 | 127 | // Conveniences to load/store/etc all our defs 128 | *writeDefFile { |dir| 129 | ^global.writeDefFile(dir) 130 | } 131 | writeDefFile { |dir| 132 | this.scanAll; 133 | dict.do{|def| def.writeDefFile(dir)}; 134 | } 135 | *load { |server| 136 | ^global.load(server) 137 | } 138 | load { |server| 139 | this.scanAll; 140 | dict.do{|def| def.load(server)}; 141 | } 142 | *store { |libname=\global, completionMsg, keepDef = true, mdPlugin| 143 | ^global.store(libname, completionMsg, keepDef, mdPlugin) 144 | } 145 | store { |libname=\global, completionMsg, keepDef = true, mdPlugin| 146 | this.scanAll; 147 | dict.do{|def| def.store(libname, completionMsg, keepDef, mdPlugin)}; 148 | } 149 | *memStore { |libname=\global, completionMsg, keepDef = true| 150 | ^global.memStore(libname, completionMsg, keepDef) 151 | } 152 | memStore { |libname=\global, completionMsg, keepDef = true| 153 | this.scanAll; 154 | dict.do{|def| def.memStore(libname, completionMsg, keepDef)}; 155 | } 156 | 157 | 158 | } // end class 159 | --------------------------------------------------------------------------------