// title: SynthDEFaults // author: unknown // description: // SynthDEFaults // - A Collection of Tradicional SynthDefs- // //under GNU GPL 3 as per SuperCollider license // //Organized by Zé Craum // // //This is the first scratch, ASAP it will be avaible in a more organized form. // // //Some Guidelines from uploading contributiong or helping organizing existing stuff: // 1.Executing code should return a SynthDef; // 2.The SynthDEFaults should have ControlSpecs for every parameter to define an acceptable range; // 3.The SynthDEFaults should not depend on things outside of the core lib or sc3-plugins; // 4.The SynthDEFaults should have reasonable defaults that allow it to make a representative sound with no arguments; // 5. SynthDEFaults symbol should be always be like \Piano_BabyGrandPiano; \Guitar_FDBEletric... // 6. SynthDEFaults must be written using NamedControl Style (Still being updated); // 6.1. Additional arguments besides from amp/dur/pitch default events must be written as local variables and must have comments; // 7. All the SynthDef should be designed for working with the main scope of Patterns // // Examples at: // // Contribuitions, comments, advises, criticisms, etc are very welcome: zecraum at gmail com // code: //\\##//\\##//\\##//\\##//\\##//\\##//\\##//\\ //\\##//\\## //\\##//\\##//\\ //\\##//\\## SynthDEFaults //\\##//\\##//\\ //\\##//\\## //\\##//\\##//\\ //\\##//\\##//\\##//\\##//\\##//\\##//\\##//\\ /* - A Collection of Tradicional SynthDefs- //under GNU GPL 3 as per SuperCollider license //Organized by Zé Craum //This is the first scratch, ASAP it will be avaible in a more organized form. //Some Guidelines from uploading contributiong or helping organizing existing stuff: 1.Executing code should return a SynthDef; 2.The SynthDEFaults should have ControlSpecs for every parameter to define an acceptable range; 3.The SynthDEFaults should not depend on things outside of the core lib or sc3-plugins; 4.The SynthDEFaults should have reasonable defaults that allow it to make a representative sound with no arguments; 5. SynthDEFaults symbol should be always be like \Piano_BabyGrandPiano; \Guitar_FDBEletric... 6. SynthDEFaults must be written using NamedControl Style (Still being updated); 6.1. Additional arguments besides from amp/dur/pitch default events must be written as local variables and must have comments; 7. All the SynthDef should be designed for working with the main scope of Patterns Examples at: http://sccode.org/1-5aE Contribuitions, comments, advises, criticisms, etc are very welcome: zecraum at gmail com // */ ( // // // // // // //// Pianos //// // // // // // // SynthDef(\piano_MDA, { //Piano synth based on Mda Plugin |out = 0, freq= 440, gate= 1, vel= 80, decay= 0.8, release= 0.8, hard= 0.4, velhard= 0.8, muffle= 0.8, velmuff= 0.8, velcurve= 0.8, stereo= 0.2, tune= 0.5, random= 0.1, stretch= 0.1, sustain= 0, mul= 1, add= 0, amp = 0.5| var snd; snd = MdaPiano.ar(freq, gate, vel, decay, release, hard, velhard, muffle, velmuff, velcurve, stereo, tune, random, stretch, sustain, mul, add); snd = snd * EnvGen.kr(Env.asr(0, 1, 0.1), gate, doneAction: 2); Out.ar(out, snd * amp); //by ???? }).add; // // // // // // // // // //// Electric Pianos //// // // // // // // // // // SynthDef(\Piano_rhodeySC, { //FM Rhodes Synthethizer | // standard meanings out = 0, freq = 440, gate = 1, pan = 0, amp = 0.1, // all of these range from 0 to 1 vel = 0.8, modIndex = 0.2, mix = 0.2, lfoSpeed = 0.4, lfoDepth = 0.1 | var env1, env2, env3, env4; var osc1, osc2, osc3, osc4, snd; lfoSpeed = lfoSpeed * 12; freq = freq * 2; env1 = EnvGen.ar(Env.adsr(0.001, 1.25, 0.0, 0.04, curve: \lin)); env2 = EnvGen.ar(Env.adsr(0.001, 1.00, 0.0, 0.04, curve: \lin)); env3 = EnvGen.ar(Env.adsr(0.001, 1.50, 0.0, 0.04, curve: \lin)); env4 = EnvGen.ar(Env.adsr(0.001, 1.50, 0.0, 0.04, curve: \lin)); osc4 = SinOsc.ar(freq * 0.5) * 2pi * 2 * 0.535887 * modIndex * env4 * vel; osc3 = SinOsc.ar(freq, osc4) * env3 * vel; osc2 = SinOsc.ar(freq * 15) * 2pi * 0.108819 * env2 * vel; osc1 = SinOsc.ar(freq, osc2) * env1 * vel; snd = Mix((osc3 * (1 - mix)) + (osc1 * mix)); snd = snd * (SinOsc.ar(lfoSpeed) * lfoDepth + 1); // using the doneAction: 2 on the other envs can create clicks (bc of the linear curve maybe?) snd = snd * EnvGen.ar(Env.asr(0, 1, 0.1), gate, doneAction: 2); snd = Pan2.ar(snd, pan, amp); Out.ar(out, snd); //By Nathan Ho aka Snappizz //http://sccode.org/1-522 }).add; SynthDef(\everythingrhodes,{|out= 0 freq = 440 amp = 0.1 gate=1 lforate = 4.85 lfowidth= 0.5 cutoff= 2000 rq=0.5 pan = 0.0| //Electric Piano var pulse, filter, env; pulse = Pulse.ar(freq*[1,33.5.midiratio],[0.2,0.1],[0.7,0.3]); env = EnvGen.ar(Env.adsr(0.0,1.0,0.8,3.0),gate,doneAction:2); //keyboard tracking filter cutoff filter = BLowPass4.ar(pulse,(cutoff*(env.squared))+200+freq,rq); Out.ar(out,Pan2.ar(Mix(filter)*env*amp,pan)); //By Nick Collins, from Mitchell Sigman (2011) Steal this Sound //http://www.sussex.ac.uk/Users/nc81/index.html }).add; // // // // // // // // //// Harpsichord //// // // // // // // // // SynthDef(\harpsichord_simple, { arg out = 0, freq = 440, amp = 0.1, pan = 0; var env, snd; env = Env.perc(level: amp).kr(doneAction: 2); snd = Pulse.ar(freq, 0.25, 0.75); snd = snd * env; Out.ar(out, Pan2.ar(snd, pan)); //Simple and light harpsichord //By Bruno Ruviaro //https://github.com/brunoruviaro/SynthDefs-for-Patterns/blob/master/harpsichord.scd }).add; SynthDef(\harpsichord_pluck, { |amp=0.1, freq=440, pan=0, atk=0, rel=0, trig= 1, maxdelaytime= 0.2, decaytime= 7, coef= 0.1| var env, sig, delay; env = EnvGen.kr(Env.linen(atk, decaytime, rel), doneAction: Done.freeSelf); sig = PinkNoise.ar(amp); //Can use white noise here, but Pink is more realistic delay = freq.reciprocal; sig = Pluck.ar(sig, trig, maxdelaytime , delay , decaytime , coef ) //fundamental + Pluck.ar(sig, trig, maxdelaytime , delay/2 , decaytime , coef ); //octave higher Out.ar(0, Pan2.ar(sig , pan)); //Harpsichord based on Pluck Ugen //By Zé Craum }).add; // // // // // // //// Organs //// // // // // // // SynthDef(\organ_tonewheel0, { //additive tonewheel organ with few CPU usage arg freq = 440, amp = 0.7, atk = 0.001, sus = 0.2, rel = 0.01, pan = 0, bass = 1, quint = 1, fundamental = 1, oct = 1, nazard = 1, blockFlute = 1, tierce = 1, larigot = 1, sifflute = 1, //organ voices (drawbars) amplitudes vrate = 3, vdepth = 0.008; //vibrato arguments var sig, env, vibrato; vibrato = SinOsc.kr(DC.kr(vrate)).range(1 - DC.kr(vdepth), 1+ DC.kr(vdepth)); env = EnvGen.ar(Env.linen(atk, sus, rel), doneAction: Done.freeSelf); sig = DynKlang.ar(`[[1/12, 1/7, 1, 12, 19, 24, 28, 31, 36].midiratio, ([DC.ar(bass) , DC.ar(quint), DC.ar(fundamental), DC.ar(oct), DC.ar(nazard), DC.ar(blockFlute), DC.ar(tierce), DC.ar(larigot), DC.ar(sifflute)].normalizeSum), nil], vibrato * freq); sig = sig * env; Out.ar(0, Pan2.ar(sig, pan, amp)); //By Zé Craum }).add; SynthDef(\organ_tonewheel1, { //additive tonewheel organ with more CPU usage arg freq = 440, amp = 0.7, atk = 0.001, sus = 0.2, rel = 0.01, pan = 0, bass = 1, quint = 1, fundamental = 1, oct = 1, nazard = 1, blockFlute = 1, tierce = 1, larigot = 1, sifflute = 1, //organ voices (drawbars) amplitudes vrate = 3, vdepth = 0.008, vdelay = 0.1, vonset = 0, vrateVariation = 0.1, vdepthVariation = 0.1; //vibrato arguments var sig, env, vibrato; vibrato = Vibrato.kr(DC.kr(freq), DC.kr(vrate), DC.kr(vdepth), DC.kr(vdelay), DC.kr(vonset), DC.kr(vrateVariation), DC.kr(vdepthVariation)); env = EnvGen.ar(Env.linen(atk, sus, rel), doneAction: Done.freeSelf); sig = DynKlang.ar(`[[1/12, 1/7, 1, 12, 19, 24, 28, 31, 36].midiratio, ([DC.ar(bass) , DC.ar(quint), DC.ar(fundamental), DC.ar(oct), DC.ar(nazard), DC.ar(blockFlute), DC.ar(tierce), DC.ar(larigot), DC.ar(sifflute)].normalizeSum), nil], vibrato); sig = sig * env; Out.ar(0, Pan2.ar(sig, pan, amp)); //By Zé Craum }).add; SynthDef(\organ_tonewheel2, { //subtractive tonewheel organ with cheap CPU usage arg freq = 440, amp = 0.9, atk = 0.001, sus = 0.4, rel = 0.1, tune = 0.29, tuneRate = 6.0, rq = 1; var sig, env, vibrato; env = EnvGen.ar(Env.linen(atk, sus, rel, 0.5), doneAction: Done.freeSelf); vibrato = SinOsc.ar(tuneRate).range(freq, freq * (tune.midiratio)); sig = LFPulse.ar(freq, 0, 0.5, 0.2) + LFPulse.ar(freq + vibrato, 0, 0.18); sig = RLPF.ar(sig /*+ PinkNoise.ar(20/freq) */, ((28.midiratio) * (freq)) , rq) ; sig = sig * env; sig = sig * amp; sig = LeakDC.ar(sig); Out.ar(0, sig!2); //By Zé Craum }).add; SynthDef(\organ_tonewheel3, { //subtractive tonewheel organ with more CPU usage arg freq = 440, amp = 0.9, atk = 0.001, sus = 0.4, rel = 0.1, vrate = 6, vdepth = 0.02, vdelay = 0.1, vonset = 0, vrateVariation = 0.1, vdepthVariation = 0.1, rq =1; var sig, env, vibrato; env = EnvGen.ar(Env.linen(atk, sus, rel, 0.5), doneAction: Done.freeSelf); vibrato = Vibrato.kr(DC.kr(freq), DC.kr(vrate), DC.kr(vdepth), DC.kr(vdelay), DC.kr(vonset), DC.kr(vrateVariation), DC.kr(vdepthVariation)); sig = LFPulse.ar(freq, 0, 0.5, 0.2) + LFPulse.ar(freq + vibrato, 0, 0.18); sig = BLowPass4.ar(sig, ((28.midiratio) * (freq)) , rq) ; sig = sig * env; sig = sig * amp; sig = LeakDC.ar(sig); Out.ar(0, sig!2); //By Zé Craum }).add; SynthDef(\organ_tonewheel4,{|out= 0 freq = 440 amp = 0.1 gate=1 lforate = 4.85 lfowidth= 0.1 cutoff= 5000 rq=0.25 pan = 0.0| //Subtractive tonewheel organ from Steal this Sound example var lfo, pulse, filter, env; lfo = LFTri.kr(lforate*[1,1.01],Rand(0,2.0)!2); pulse = Pulse.ar( (((freq*[1,3]).cpsmidi) + (lfo*lfowidth)).midicps,[0.5,0.51],[0.4,0.6]); env = EnvGen.ar(Env.adsr(0.0,0.0,1.0,0.1),gate,doneAction:2); filter = BLowPass4.ar(pulse,cutoff,rq); filter= BPeakEQ.ar(filter,500,1.0,3); Out.ar(out,Pan2.ar(Mix(filter)*env*amp,pan)); //By Nick Collins, from Mitchell Sigman (2011) Steal this Sound //http://www.sussex.ac.uk/Users/nc81/index.html }).add; SynthDef(\organ_donor,{|out= 0 freq = 440 amp = 0.2 gate=1 lforate = 10 lfowidth= 0.0 cutoff= 100 rq=0.5 pan=0.0| //Simulation of transistor organ from Steal This Sound var vibrato, pulse, filter, env; vibrato = SinOsc.ar(lforate,Rand(0,2.0)); //up octave, detune by 4 cents //11.96.midiratio = 1.9953843530485 //up octave and a half, detune up by 10 cents //19.10.midiratio = 3.0139733629359 //Pulse version //pulse = Mix(Pulse.ar(([1,1.9953843530485,3.0139733629359]*freq)*(1.0+(lfowidth*vibrato)),Rand(0.4,0.6)!3,[1.0,0.7,0.3]))*0.5; //better alternative pulse = Mix(VarSaw.ar(([1,1.9953843530485,3.0139733629359]*freq)*(1.0+(lfowidth*vibrato)),Rand(0.0,1.0)!3,Rand(0.3,0.5)!3,[1.0,0.7,0.3]))*0.5; filter = RLPF.ar(pulse,cutoff,rq); env = EnvGen.ar(Env.adsr(0.01,0.5,1.0,0.5),gate,doneAction:2); Out.ar(out,Pan2.ar(filter*env*amp,pan)); //By Nick Collins, from Mitchell Sigman (2011) Steal this Sound //http://www.sussex.ac.uk/Users/nc81/index.html }).add; SynthDef(\organ_reed, { //Reed Organ Simulation |out = 0, freq = 440, amp = 0.1, gate = 1, attack = 0.3, release = 0.3| var snd, blow; // pulse with modulating width snd = Pulse.ar((Rand(-0.03, 0.05) + freq.cpsmidi).midicps, 0.48 + LFNoise1.kr(0.06, 0.1), 0.2); // add a little "grit" to the reed snd = Disintegrator.ar(snd, 0.5, 0.7); // a little ebb and flow in volume snd = snd * LFNoise2.kr(5, 0.05, 1); // use the same signal to control both the resonant freq and the amplitude blow = EnvGen.ar(Env.asr(attack, 1.0, release), gate, doneAction: 2); snd = snd + BPF.ar(snd, blow.linexp(0, 1, 2000, 2442), 0.3, 3); // boost the high end a bit to get a buzzier sound snd = BHiShelf.ar(snd, 1200, 1, 3); snd = snd * blow; Out.ar(out, Pan2.ar(snd, 0, amp)); //By Nathan Ho aka Snappizz //http://sccode.org/1-51m }).add; // // // // // // // // //// Woodwinds //// // // // // // // // // SynthDef("flute_waveguide", { arg scl = 0.2, freq = 440, ipress = 0.9, ibreath = 0.09, ifeedbk1 = 0.4, ifeedbk2 = 0.4, dur = 1, gate = 1, amp = 0.4; var kenv1, kenv2, kenvibr, kvibr, sr, cr, block; var poly, signalOut, ifqc; var aflow1, asum1, asum2, afqc, atemp1, ax, apoly, asum3, avalue, atemp2, aflute1; var fdbckArray; sr = SampleRate.ir; cr = ControlRate.ir; block = cr.reciprocal; ifqc = freq; // noise envelope kenv1 = EnvGen.kr(Env.new( [ 0.0, 1.1 * ipress, ipress, ipress, 0.0 ], [ 0.06, 0.2, dur - 0.46, 0.2 ], 'linear' ) ); // overall envelope kenv2 = EnvGen.kr(Env.new( [ 0.0, amp, amp, 0.0 ], [ 0.1, dur - 0.02, 0.1 ], 'linear' ), doneAction: 2 ); // vibrato envelope kenvibr = EnvGen.kr(Env.new( [ 0.0, 0.0, 1, 1, 0.0 ], [ 0.5, 0.5, dur - 1.5, 0.5 ], 'linear') ); // create air flow and vibrato aflow1 = LFClipNoise.ar( sr, kenv1 ); kvibr = SinOsc.ar( 5, 0, 0.1 * kenvibr ); asum1 = ( ibreath * aflow1 ) + kenv1 + kvibr; afqc = ifqc.reciprocal - ( asum1/20000 ) - ( 9/sr ) + ( ifqc/12000000 ) - block; fdbckArray = LocalIn.ar( 1 ); aflute1 = fdbckArray; asum2 = asum1 + ( aflute1 * ifeedbk1 ); //ax = DelayL.ar( asum2, ifqc.reciprocal * 0.5, afqc * 0.5 ); ax = DelayC.ar( asum2, ifqc.reciprocal - block * 0.5, afqc * 0.5 - ( asum1/ifqc/cr ) + 0.001 ); apoly = ax - ( ax.cubed ); asum3 = apoly + ( aflute1 * ifeedbk2 ); avalue = LPF.ar( asum3, 2000 ); aflute1 = DelayC.ar( avalue, ifqc.reciprocal - block, afqc ); fdbckArray = [ aflute1 ]; LocalOut.ar( fdbckArray ); signalOut = avalue; OffsetOut.ar( 0, [ signalOut * kenv2, signalOut * kenv2 ] ); // Originally found at http://ecmc.rochester.edu/ecmc/docs/supercollider/scbook/Ch21_Interface_Investigations/ixi%20SC%20tutorial/ixi_SC_tutorial_10.html //by Wilson, Cottle and Collins //also available at Bruno Ruviaro Collection https://github.com/brunoruviaro/SynthDefs-for-Patterns/blob/master/flute.scd }).add; // // // // // // // // //// Strings //// // // // // // // // // SynthDef(\strings, { arg out, freq=440, amp=0.8, gate=1, pan, freqLag=0.2; var env, in, delay, f1, f2; f1 = freq.lag(freqLag); f2 = freq.lag(freqLag * 0.5); delay = 0.25 / f2; env = Env.asr(0, 1, 0.3); in = WhiteNoise.ar(180); in = CombL.ar(in, delay, delay, 1); in = Resonz.ar(in, f1, 0.001).abs; in = in * EnvGen.kr(env, gate, doneAction:2); Out.ar(out, Pan2.ar(in, pan, amp)); //From SC Examples Folder // some small pieces // Julian Rohrhuber, 2007 }).add; SynthDef(\violin, { | midinote=60, gate=1, amp=0.8 | var env = EnvGen.kr(Env.asr(0.1, 1, 0.1), gate, doneAction:2); var sig = VarSaw.ar( midinote.midicps, width:LFNoise2.kr(1).range(0.2, 0.8)*SinOsc.kr(5, Rand(0.0, 1.0)).range(0.7,0.8))*0.25; sig = sig * env * amp; Out.ar(0, sig!2); //It is also used for simulating Farfisa organ and flutes //by nicolaariutti //http://sccode.org/1-5as }).add; // // // // // // // // //// Percussion //// // // // // // // // // SynthDef(\kalimba, { //Kalimba based on bank of ressonators |out = 0, freq = 440, amp = 0.1, mix = 0.1, relMin = 2.5, relMax = 3.5| var snd; // Basic tone is a SinOsc snd = SinOsc.ar(freq) * EnvGen.ar(Env.perc(0.005, Rand(relMin, relMax), 1, -8), doneAction: 2); // The "clicking" sounds are modeled with a bank of resonators excited by enveloped pink noise snd = (snd * (1 - mix)) + (DynKlank.ar(`[ // the resonant frequencies are randomized a little to add variation // there are two high resonant freqs and one quiet "bass" freq to give it some depth [240*ExpRand(0.9, 1.1), 2020*ExpRand(0.9, 1.1), 3151*ExpRand(0.9, 1.1)], [-7, 0, 3].dbamp, [0.8, 0.05, 0.07] ], PinkNoise.ar * EnvGen.ar(Env.perc(0.001, 0.01))) * mix); Out.ar(out, Pan2.ar(snd, 0, amp)); //By Nathan Ho aka Snappiz //http://sccode.org/1-51l }).add; SynthDef("marimba1", {arg freq = 440, amp = 0.4; var snd, env; env = Env.linen(0.015, 1, 0.5, amp).kr(doneAction: 2); snd = BPF.ar(Saw.ar(0), freq, 0.02); snd = BLowShelf.ar(snd, 220, 0.81, 6); snd = snd * env; Out.ar(0, Splay.ar(snd)); //By Bruno Ruviaro //https://github.com/brunoruviaro/SynthDefs-for-Patterns/blob/master/marimba.scd }).add; SynthDef(\bell_tubular, { |freq = 440, t60=9, pitchy=1, amp=0.25, gate=1, pan = 0| var sig, exciter; exciter = WhiteNoise.ar() * EnvGen.ar(Env.perc(0.001, 0.05), gate) * 0.25; sig = DynKlank.ar( `[ [1, 2, 2.803, 3.871, 5.074, 7.81, 10.948, 14.421], // freqs [1, 0.044, 0.891, 0.0891, 0.794, 0.1, 0.281, 0.079], // amplitudes [1, 0.205, 1, 0.196, 0.339, 0.047, 0.058, 0.047]*t60 // ring times ], exciter, freqscale: freq); DetectSilence.ar(sig, 0.001, 0.5, doneAction:2); Out.ar(0, Pan2.ar(sig, pan, amp)); //This is the same used for glockenspiel, xylophone, marimba and regular bell, what changes is only the ring time t60 //By nicolaariutti and edited by Zé Craum // http://sccode.org/1-5ay#c835 }).add; SynthDef(\glockenspiel, { |freq = 440, t60=6, pitchy=1, amp=0.25, gate=1, pan = 0| var sig, exciter; exciter = WhiteNoise.ar() * EnvGen.ar(Env.perc(0.001, 0.05), gate) * 0.25; sig = DynKlank.ar( `[ [1, 2, 2.803, 3.871, 5.074, 7.81, 10.948, 14.421], // freqs [1, 0.044, 0.891, 0.0891, 0.794, 0.1, 0.281, 0.079], // amplitudes [1, 0.205, 1, 0.196, 0.339, 0.047, 0.058, 0.047]*t60 // ring times ], exciter, freqscale: freq); DetectSilence.ar(sig, 0.001, 0.5, doneAction:2); Out.ar(0, Pan2.ar(sig, pan, amp)); //This is the same used for glockenspiel, xylophone, marimba and regular bell, what changes is only the ring time t60 //By nicolaariutti and edited by Zé Craum // http://sccode.org/1-5ay#c835 }).add; SynthDef(\xilophone, { |freq = 440, t60=1, pitchy=1, amp=0.25, gate=1, pan = 0| var sig, exciter; exciter = WhiteNoise.ar() * EnvGen.ar(Env.perc(0.001, 0.05), gate) * 0.25; sig = DynKlank.ar( `[ [1, 2, 2.803, 3.871, 5.074, 7.81, 10.948, 14.421], // freqs [1, 0.044, 0.891, 0.0891, 0.794, 0.1, 0.281, 0.079], // amplitudes [1, 0.205, 1, 0.196, 0.339, 0.047, 0.058, 0.047]*t60 // ring times ], exciter, freqscale: freq); DetectSilence.ar(sig, 0.001, 0.5, doneAction:2); Out.ar(0, Pan2.ar(sig, pan, amp)); //This is the same used for glockenspiel, xylophone, marimba and regular bell, what changes is only the ring time t60 //By nicolaariutti and edited by Zé Craum // http://sccode.org/1-5ay#c835 }).add; SynthDef(\marimba, { |freq = 440, t60=0.5, pitchy=1, amp=0.25, gate=1, pan = 0| var sig, exciter; exciter = WhiteNoise.ar() * EnvGen.ar(Env.perc(0.001, 0.05), gate) * 0.25; sig = DynKlank.ar( `[ [1, 2, 2.803, 3.871, 5.074, 7.81, 10.948, 14.421], // freqs [1, 0.044, 0.891, 0.0891, 0.794, 0.1, 0.281, 0.079], // amplitudes [1, 0.205, 1, 0.196, 0.339, 0.047, 0.058, 0.047]*t60 // ring times ], exciter, freqscale: freq); DetectSilence.ar(sig, 0.001, 0.5, doneAction:2); Out.ar(0, Pan2.ar(sig, pan, amp)); //This is the same used for glockenspiel, xylophone, marimba and regular bell, what changes is only the ring time t60 //By nicolaariutti and edited by Zé Craum // http://sccode.org/1-5ay#c835 }).add; SynthDef(\prayer_bell, { |outbus, t_trig = 1, sing_switch = 0, freq = 2434, amp = 0.5, decayscale = 1, lag = 10, i_doneAction = 0| var sig, input, first, freqscale, mallet, sing; freqscale = freq / 2434; freqscale = Lag3.kr(freqscale, lag); decayscale = Lag3.kr(decayscale, lag); mallet = LPF.ar(Trig.ar(t_trig, SampleDur.ir)!2, 10000 * freqscale); sing = LPF.ar( LPF.ar( { PinkNoise.ar * Integrator.kr(sing_switch * 0.001, 0.999).linexp(0, 1, 0.01, 1) * amp } ! 2, 2434 * freqscale ) + Dust.ar(0.1), 10000 * freqscale ) * LFNoise1.kr(0.5).range(-45, -30).dbamp; input = mallet + (sing_switch.clip(0, 1) * sing); sig = DynKlank.ar(`[ [ (first = LFNoise1.kr(0.5).range(2424, 2444)) + Line.kr(20, 0, 0.5), first + LFNoise1.kr(0.5).range(1,3), LFNoise1.kr(1.5).range(5435, 5440) - Line.kr(35, 0, 1), LFNoise1.kr(1.5).range(5480, 5485) - Line.kr(10, 0, 0.5), LFNoise1.kr(2).range(8435, 8445) + Line.kr(15, 0, 0.05), LFNoise1.kr(2).range(8665, 8670), LFNoise1.kr(2).range(8704, 8709), LFNoise1.kr(2).range(8807, 8817), LFNoise1.kr(2).range(9570, 9607), LFNoise1.kr(2).range(10567, 10572) - Line.kr(20, 0, 0.05), LFNoise1.kr(2).range(10627, 10636) + Line.kr(35, 0, 0.05), LFNoise1.kr(2).range(14689, 14697) - Line.kr(10, 0, 0.05) ], [ LFNoise1.kr(1).range(-10, -5).dbamp, LFNoise1.kr(1).range(-20, -10).dbamp, LFNoise1.kr(1).range(-12, -6).dbamp, LFNoise1.kr(1).range(-12, -6).dbamp, -20.dbamp, -20.dbamp, -20.dbamp, -25.dbamp, -10.dbamp, -20.dbamp, -20.dbamp, -25.dbamp ], [ 20 * freqscale.pow(0.2), 20 * freqscale.pow(0.2), 5, 5, 0.6, 0.5, 0.3, 0.25, 0.4, 0.5, 0.4, 0.6 ] * freqscale.reciprocal.pow(0.5) ], input, freqscale, 0, decayscale); DetectSilence.ar(sig, doneAction: i_doneAction); Out.ar(outbus, sig); // Tibetan prayer bells acoustically modeled //by wondersluyter //http://sccode.org/wondersluyter }).add; // // // // // // // // //// Drum Kits //// // // // // // // // // SynthDef(\snare909,{ |out=0,mul=1,velocity=1| var excitation, membrane; excitation = LPF.ar(WhiteNoise.ar(1), 7040, 1) * (0.1 + velocity); membrane = ( /* Two simple enveloped oscillators represent the loudest resonances of the drum membranes */ (LFTri.ar(330,0,1) * EnvGen.ar(Env.perc(0.0005,0.055),doneAction:0) * 0.25) +(LFTri.ar(185,0,1) * EnvGen.ar(Env.perc(0.0005,0.075),doneAction:0) * 0.25) /* Filtered white noise represents the snare */ +(excitation * EnvGen.ar(Env.perc(0.0005,0.4),doneAction:2) * 0.2) +(HPF.ar(excitation, 523, 1) * EnvGen.ar(Env.perc(0.0005,0.283),doneAction:0) * 0.2) ) * mul; Out.ar(out, membrane!2) }).add; SynthDef(\neurosnare, { var snd; // a percussive click to give it some attack snd = LPF.ar(HPF.ar(WhiteNoise.ar, 300), 8000) * Env.linen(0.001, 0.01, 0.001).ar; // sine sweep body. very important! snd = snd + (SinOsc.ar(Env([400, 196, 160], [0.04, 0.2], \exp).ar) * Env.perc(0.04, 0.2).ar * 6.dbamp).tanh; // sound of snare coils rattling snd = snd + (HPF.ar(BPeakEQ.ar(WhiteNoise.ar, 4000, 0.5, 3), 300) * Env.perc(0.05, 0.2).delay(0.01).ar(2) * -3.dbamp); // another sound sweep to improve the attack, optional snd = snd + (SinOsc.ar(XLine.kr(3000, 1500, 0.01)) * Env.perc(0.001, 0.02).ar); // distortion helps glue everything together and acts as a compressor snd = (snd * 1.4).tanh; snd = Pan2.ar(snd, \pan.kr(0), \amp.kr(0.1)); Out.ar(\out.kr(0), snd); //By Snapizz //http://sccode.org/1-57f }).add; // Basic drum kit SynthDef("hihat", {arg out = 0, amp = 0.5, att = 0.01, rel = 0.2, ffreq = 6000, pan = 0; var env, snd; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd = WhiteNoise.ar; snd = HPF.ar(in: snd, freq: ffreq, mul: env); Out.ar(out, Pan2.ar(snd, pan)); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; SynthDef("snare", {arg out = 0, amp = 0.1, sinfreq = 180, att = 0.01, rel = 0.2, ffreq = 2000, pan = 0; var env, snd1, snd2, sum; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd1 = HPF.ar( in: WhiteNoise.ar, freq: ffreq, mul: env ); snd2 = SinOsc.ar(freq: sinfreq, mul: env); sum = snd1 + snd2; Out.ar(out, Pan2.ar(sum, pan)); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; SynthDef("kick", {arg out = 0, amp = 0.3, sinfreq = 60, glissf = 0.9, att = 0.01, rel = 0.45, pan = 0; var env, snd, ramp; env = Env.perc(att, rel, amp).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq * glissf, dur: rel ); snd = SinOsc.ar(freq: ramp, mul: env); snd = Pan2.ar(snd, pan); Out.ar(out, snd); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; SynthDef(\kick1, { var snd; snd = DC.ar(0); snd = snd + (SinOsc.ar(XLine.ar(800, 400, 0.01)) * Env.perc(0.0005, 0.01).ar); snd = snd + (BPF.ar(Hasher.ar(Sweep.ar), XLine.ar(800, 100, 0.01), 0.6) * Env.perc(0.001, 0.02).delay(0.001).ar); snd = snd + (SinOsc.ar(XLine.ar(172, 50, 0.01)) * Env.perc(0.0001, 0.3, 1, \lin).delay(0.005).ar(2)); snd = snd.tanh; Out.ar(\out.kr(0), Pan2.ar(snd, \pan.kr(0), \amp.kr(0.1))); //By Nathan Ho aka Snappizz //http://sccode.org/1-57g }).add; SynthDef(\kick2, { var snd; snd = DC.ar(0); snd = snd + (HPF.ar(Hasher.ar(Sweep.ar), 1320) * Env.perc(0.003, 0.03).ar * 0.5); snd = snd + (SinOsc.ar(XLine.ar(750, 161, 0.02)) * Env.perc(0.0005, 0.02).ar); snd = snd + (SinOsc.ar(XLine.ar(167, 52, 0.04)) * Env.perc(0.0005, 0.3).ar(2)); snd = snd.tanh; Out.ar(\out.kr(0), Pan2.ar(snd, \pan.kr(0), \amp.kr(0.1))); //By Nathan Ho aka Snappizz //http://sccode.org/1-57g }).add; SynthDef(\kick3, { var snd; snd = DC.ar(0); snd = snd + (SinOsc.ar(XLine.ar(1500, 800, 0.01)) * Env.perc(0.0005, 0.01, curve: \lin).ar); snd = snd + (BPF.ar(Impulse.ar(0) * SampleRate.ir / 48000, 6100, 1.0) * 3.dbamp); snd = snd + (BPF.ar(Hasher.ar(Sweep.ar), 300, 0.9) * Env.perc(0.001, 0.02).ar); snd = snd + (SinOsc.ar(XLine.ar(472, 60, 0.045)) * Env.perc(0.0001, 0.3, curve: \lin).delay(0.005).ar(2)); snd = snd.tanh; Out.ar(\out.kr(0), Pan2.ar(snd, \pan.kr(0), \amp.kr(0.1))); //By Nathan Ho aka Snappizz //http://sccode.org/1-57g }).add; SynthDef("kick_808", {arg out = 0, freq1 = 240, freq2 = 60, amp = 1, ringTime = 10, rel = 1, dist = 0.5, pan = 0; var snd, env; snd = Ringz.ar( in: Impulse.ar(0), // single impulse freq: XLine.ar(freq1, freq2, 0.1), decaytime: ringTime); env = EnvGen.ar(Env.perc(0.001, rel, amp), doneAction: 2); snd = (1.0 - dist) * snd + (dist * (snd.distort)); snd = snd * env; Out.ar(0, Pan2.ar(snd, pan)); // //By Bruno Ruviaro //https://github.com/brunoruviaro/SynthDefs-for-Patterns/blob/master/kick808.scd }).add; SynthDef(\SOSkick, { arg out = 0, freq = 50, mod_freq = 5, mod_index = 5, sustain = 0.4, amp = 0.8, beater_noise_level = 0.025; var pitch_contour, drum_osc, drum_lpf, drum_env; var beater_source, beater_hpf, beater_lpf, lpf_cutoff_contour, beater_env; var kick_mix; pitch_contour = Line.kr(freq*2, freq, 0.02); drum_osc = PMOsc.ar( pitch_contour, mod_freq, mod_index/1.3, mul: 1, add: 0); drum_lpf = LPF.ar(in: drum_osc, freq: 1000, mul: 1, add: 0); drum_env = drum_lpf * EnvGen.ar(Env.perc(0.005, sustain), 1.0, doneAction: 2); beater_source = WhiteNoise.ar(beater_noise_level); beater_hpf = HPF.ar(in: beater_source, freq: 500, mul: 1, add: 0); lpf_cutoff_contour = Line.kr(6000, 500, 0.03); beater_lpf = LPF.ar(in: beater_hpf, freq: lpf_cutoff_contour, mul: 1, add: 0); beater_env = beater_lpf * EnvGen.ar(Env.perc, 1.0, doneAction: 2); kick_mix = Mix.new([drum_env, beater_env]) * 2 * amp; Out.ar(out, [kick_mix, kick_mix]) } //DrumSynths SC Example - SOS Drums by Renick Bell, renick_at_gmail.com // recipes from Gordon Reid in his Sound on Sound articles // SOSkick ------- // http://www.soundonsound.com/sos/jan02/articles/synthsecrets0102.asp // increase mod_freq and mod_index for interesting electronic percussion ).add; SynthDef(\SOSsnare, {arg out = 0, sustain = 0.1, drum_mode_level = 0.25, snare_level = 40, snare_tightness = 1000, freq = 405, amp = 0.8; var drum_mode_sin_1, drum_mode_sin_2, drum_mode_pmosc, drum_mode_mix, drum_mode_env; var snare_noise, snare_brf_1, snare_brf_2, snare_brf_3, snare_brf_4, snare_reson; var snare_env; var snare_drum_mix; drum_mode_env = EnvGen.ar(Env.perc(0.005, sustain), 1.0, doneAction: 2); drum_mode_sin_1 = SinOsc.ar(freq*0.53, 0, drum_mode_env * 0.5); drum_mode_sin_2 = SinOsc.ar(freq, 0, drum_mode_env * 0.5); drum_mode_pmosc = PMOsc.ar( Saw.ar(freq*0.85), 184, 0.5/1.3, mul: drum_mode_env*5, add: 0); drum_mode_mix = Mix.new([drum_mode_sin_1, drum_mode_sin_2, drum_mode_pmosc]) * drum_mode_level; // choose either noise source below // snare_noise = Crackle.ar(2.01, 1); snare_noise = LFNoise0.ar(20000, 0.1); snare_env = EnvGen.ar(Env.perc(0.005, sustain), 1.0, doneAction: 2); snare_brf_1 = BRF.ar(in: snare_noise, freq: 8000, mul: 0.5, rq: 0.1); snare_brf_2 = BRF.ar(in: snare_brf_1, freq: 5000, mul: 0.5, rq: 0.1); snare_brf_3 = BRF.ar(in: snare_brf_2, freq: 3600, mul: 0.5, rq: 0.1); snare_brf_4 = BRF.ar(in: snare_brf_3, freq: 2000, mul: snare_env, rq: 0.0001); snare_reson = Resonz.ar(snare_brf_4, snare_tightness, mul: snare_level) ; snare_drum_mix = Mix.new([drum_mode_mix, snare_reson]) * 5 * amp; Out.ar(out, [snare_drum_mix, snare_drum_mix]) } ).add; //DrumSynths SC Example - SOS Drums by Renick Bell, renick_at_gmail.com // recipes from Gordon Reid in his Sound on Sound articles // SOSsnare ------- // http://www.soundonsound.com/sos/Mar02/articles/synthsecrets0302.asp SynthDef(\SOShats, {arg out = 0, freq = 6000, sustain = 0.1, amp = 0.8; var root_cymbal, root_cymbal_square, root_cymbal_pmosc; var initial_bpf_contour, initial_bpf, initial_env; var body_hpf, body_env; var cymbal_mix; root_cymbal_square = Pulse.ar(freq, 0.5, mul: 1); root_cymbal_pmosc = PMOsc.ar(root_cymbal_square, [freq*1.34, freq*2.405, freq*3.09, freq*1.309], [310/1.3, 26/0.5, 11/3.4, 0.72772], mul: 1, add: 0); root_cymbal = Mix.new(root_cymbal_pmosc); initial_bpf_contour = Line.kr(15000, 9000, 0.1); initial_env = EnvGen.ar(Env.perc(0.005, 0.1), 1.0); initial_bpf = BPF.ar(root_cymbal, initial_bpf_contour, mul:initial_env); body_env = EnvGen.ar(Env.perc(0.005, sustain, 1, -2), 1.0, doneAction: 2); body_hpf = HPF.ar(in: root_cymbal, freq: Line.kr(9000, 12000, sustain),mul: body_env, add: 0); cymbal_mix = Mix.new([initial_bpf, body_hpf]) * amp; Out.ar(out, [cymbal_mix, cymbal_mix]) }).add; //DrumSynths SC Example - SOS Drums by Renick Bell, renick_at_gmail.com // recipes from Gordon Reid in his Sound on Sound articles // SOShats ------- // http://www.soundonsound.com/sos/Jun02/articles/synthsecrets0602.asp SynthDef(\SOStom, {arg out = 0, sustain = 0.4, drum_mode_level = 0.25, freq = 90, drum_timbre = 1.0, amp = 0.8; var drum_mode_sin_1, drum_mode_sin_2, drum_mode_pmosc, drum_mode_mix, drum_mode_env; var stick_noise, stick_env; var drum_reson, tom_mix; drum_mode_env = EnvGen.ar(Env.perc(0.005, sustain), 1.0, doneAction: 2); drum_mode_sin_1 = SinOsc.ar(freq*0.8, 0, drum_mode_env * 0.5); drum_mode_sin_2 = SinOsc.ar(freq, 0, drum_mode_env * 0.5); drum_mode_pmosc = PMOsc.ar( Saw.ar(freq*0.9), freq*0.85, drum_timbre/1.3, mul: drum_mode_env*5, add: 0); drum_mode_mix = Mix.new([drum_mode_sin_1, drum_mode_sin_2, drum_mode_pmosc]) * drum_mode_level; stick_noise = Crackle.ar(2.01, 1); stick_env = EnvGen.ar(Env.perc(0.005, 0.01), 1.0) * 3; tom_mix = Mix.new([drum_mode_mix, stick_env]) * 2 * amp; Out.ar(out, [tom_mix, tom_mix]) } ).add; //DrumSynths SC Example - SOS Drums by Renick Bell, renick_at_gmail.com // recipes from Gordon Reid in his Sound on Sound articles // SOStom ------- // http://www.soundonsound.com/sos/Mar02/articles/synthsecrets0302.asp SynthDef(\kick_electro, { |out = 0, pan = 0, amp = 0.3| var body, bodyFreq, bodyAmp; var pop, popFreq, popAmp; var click, clickAmp; var snd; // body starts midrange, quickly drops down to low freqs, and trails off bodyFreq = EnvGen.ar(Env([261, 120, 51], [0.035, 0.08], curve: \exp)); bodyAmp = EnvGen.ar(Env.linen(0.005, 0.1, 0.3), doneAction: 2); body = SinOsc.ar(bodyFreq) * bodyAmp; // pop sweeps over the midrange popFreq = XLine.kr(750, 261, 0.02); popAmp = EnvGen.ar(Env.linen(0.001, 0.02, 0.001)) * 0.15; pop = SinOsc.ar(popFreq) * popAmp; // click is spectrally rich, covering the high-freq range // you can use Formant, FM, noise, whatever clickAmp = EnvGen.ar(Env.perc(0.001, 0.01)) * 0.15; click = LPF.ar(Formant.ar(910, 4760, 2110), 3140) * clickAmp; snd = body + pop + click; snd = snd.tanh; Out.ar(out, Pan2.ar(snd, pan, amp)); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; SynthDef(\snare_electro, { |out = 0, pan = 0, amp = 0.3| var pop, popAmp, popFreq; var noise, noiseAmp; var snd; // pop makes a click coming from very high frequencies // slowing down a little and stopping in mid-to-low popFreq = EnvGen.ar(Env([3261, 410, 160], [0.005, 0.01], curve: \exp)); popAmp = EnvGen.ar(Env.perc(0.001, 0.11)) * 0.7; pop = SinOsc.ar(popFreq) * popAmp; // bandpass-filtered white noise noiseAmp = EnvGen.ar(Env.perc(0.001, 0.15), doneAction: 2); noise = BPF.ar(WhiteNoise.ar, 810, 1.6) * noiseAmp; snd = (pop + noise) * 1.3; Out.ar(out, Pan2.ar(snd, pan, amp)); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; SynthDef(\hihat_electro, { |out = 0, pan = 0, amp = 0.3| var click, clickAmp; var noise, noiseAmp; var snd; // noise -> resonance -> expodec envelope noiseAmp = EnvGen.ar(Env.perc(0.001, 0.3, curve: -8), doneAction: 2); noise = Mix(BPF.ar(ClipNoise.ar, [4010, 4151], [0.15, 0.56], [1.0, 0.6])) * 0.7 * noiseAmp; snd = noise; Out.ar(out, Pan2.ar(snd, pan, amp)); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; // adapted from a post by Neil Cosgrove (other three are original) SynthDef(\clap_electro, { |out = 0, amp = 0.5, pan = 0, dur = 1| var env1, env2, snd, noise1, noise2; // noise 1 - 4 short repeats env1 = EnvGen.ar( Env.new( [0, 1, 0, 0.9, 0, 0.7, 0, 0.5, 0], [0.001, 0.009, 0, 0.008, 0, 0.01, 0, 0.03], [0, -3, 0, -3, 0, -3, 0, -4] ) ); noise1 = WhiteNoise.ar(env1); noise1 = HPF.ar(noise1, 600); noise1 = LPF.ar(noise1, XLine.kr(7200, 4000, 0.03)); noise1 = BPF.ar(noise1, 1620, 3); // noise 2 - 1 longer single env2 = EnvGen.ar(Env.new([0, 1, 0], [0.02, 0.18], [0, -4]), doneAction:2); noise2 = WhiteNoise.ar(env2); noise2 = HPF.ar(noise2, 1000); noise2 = LPF.ar(noise2, 7600); noise2 = BPF.ar(noise2, 1230, 0.7, 0.7); snd = noise1 + noise2; snd = snd * 2; snd = snd.softclip; Out.ar(out, Pan2.ar(snd,pan,amp)); //By Nathan Ho aka Snappizz //http://sccode.org/1-523 }).add; // // // // // // // // //// Others //// // // // // // // // // SynthDef(\blips1, {arg out = 0, freq = 25, numharm = 10, atk = 0.01, rel = 1, amp = 0.1, pan = 0.5, beatsPercentage = 1.001; var snd, env; env = Env.perc(atk, rel, amp).kr(doneAction: Done.freeSelf); snd = LeakDC.ar(Mix(Blip.ar([freq, freq*beatsPercentage], numharm, env))); Out.ar(out, Pan2.ar(snd, pan)); //80's like synth //By Bruno Ruviaro //https://github.com/brunoruviaro/SynthDefs-for-Patterns/blob/master/blips.scd //Edits by Zé Craum }).add; SynthDef("sawSynth", { arg freq = 440, amp = 0.1, att = 0.1, rel = 2, lofreq = 1000, hifreq = 3000; var env, snd; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(doneAction: 2); snd = Saw.ar(freq: freq * [0.99, 1, 1.001, 1.008], mul: env); snd = LPF.ar( in: snd, freq: LFNoise2.kr(1).range(lofreq, hifreq) ); snd = Splay.ar(snd); Out.ar(0, snd); // Basic saw synth for chords and bass //By Bruno Ruviaro //http://sccode.org/1-54H }).add; SynthDef("noisy", {arg out = 0, freq = 440, amp = 0.2, pan = 0.5; var snd, env; env = Env.perc(0.02, 0.1).kr(doneAction: 2); snd = Mix(LFPulse.ar( freq: freq * [1, 5/2], iphase: 0.0, width: 0.5, mul: amp)); snd = snd * env ; Out.ar(out, Pan2.ar(snd, pan)); //By Bruno Ruviaro //https://github.com/brunoruviaro/SynthDefs-for-Patterns/blob/master/noisy.scd }).add; //INCLUDE A SAMPLER SynthDef(\sampler_PlayBuf, { //A really simple sampler based on PlayBuf and midi ratios |out=0, pan=0, buf=0, midiratio=2, amp=1.0, pos=0.0, atk= 0.001, sus = 0.01 rel=1.0| var sig, rate, start, env; env = EnvGen.ar(Env.linen(atk, sus, rel), doneAction:2); rate = BufRateScale.ir(buf) * (midiratio.midiratio); start = BufFrames.kr(buf) * pos; sig = PlayBuf.ar(1, buf, rate, 1, start); Out.ar(out, Pan2.ar(sig, pan, amp) * env); //By Zé Craum }).add; SynthDef(\sine_simple, { //A really simple sinusoidal sine wave synth |amp=0.1, freq=440, pan=0, atk = 0.001, sus = 1, rel = 0.01| var env, sig; env = EnvGen.kr(Env.linen(atk, sus, rel), doneAction:2); sig = SinOsc.ar(freq); sig = sig * env; Out.ar(0, Pan2.ar(sig, pan, amp)); //By Zé Craum }).add; SynthDef(\sine_vintage, { //Crude simulation of old sinusoidal generators - with vibrato and high noise floor |amp=0.2, freq=440, pan=0, atk = 0.001, sus = 2, rel = 0.01, vrate = 2, vdepth = 0.002, vdelay = 0.1, vonset = 0, vrateVariation = 0.1, vdepthVariation = 0.1 /*vibrato arguments*/, noiseAmp = 0.2| var env, sig, vibrato; env = EnvGen.kr(Env.linen(atk, sus, rel), doneAction:2); vibrato = Vibrato.kr(DC.kr(freq), DC.kr(vrate), DC.kr(vdepth), DC.kr(vdelay), DC.kr(vonset), DC.kr(vrateVariation), DC.kr(vdepthVariation)); sig = SinOsc.ar(vibrato); sig = sig + PinkNoise.ar(noiseAmp); sig = sig * env; Out.ar(0, Pan2.ar(sig, pan, amp)); //By Zé Craum }).add; SynthDef(\prophet5pwmstrings,{|out= 0 freq = 440 amp = 1.0 gate=1 lforate = 10 lfowidth= 0.5 cutoff= 12000 rq=0.5 pan = 0.0| var lfo, pulse, filter, env; lfo = LFTri.kr(lforate*[1,1.01],Rand(0,2.0)!2); pulse = Pulse.ar(freq*[1,1.01],lfo*lfowidth+0.5); filter = RLPF.ar(pulse,cutoff,rq); env = EnvGen.ar(Env.adsr(0.01,0.0,1.0,0.5),gate,doneAction:2); Out.ar(out,Pan2.ar(Mix(filter)*env*amp*0.5,pan)); }).add; // // // // // // // // //// Effects //// // // // // // // // // //Steal This Sound SynthDef(\choruscompresseffect, {|out =0 gate= 1| var source = In.ar(out,2); var chorus; var env = Linen.kr(gate, 0.1, 1, 0.1, 2); chorus= Splay.ar(Array.fill(4,{ var maxdelaytime= rrand(0.005,0.02); DelayC.ar(source[0], maxdelaytime,LFNoise1.kr(Rand(0.1,0.6),0.25*maxdelaytime,0.75*maxdelaytime) ) })); chorus = Compander.ar(4*(source + chorus),source,0.4,1,4); XOut.ar(out,env,chorus); //From Steal This Sound SC Example //By Nick Collins }).add; SynthDef(\reverb, { arg out = 0, gate = 1, roomsize = 100, revtime = 1, damping = 0.6, inputbw = 0.5, spread = 15, drylevel = 1, earlyreflevel = 0.7, taillevel = 0.5, maxroomsize = 300, amp = 0.5; var source = In.ar(out,8); var reverb; var env = Linen.kr(gate, 0.1, 1, 0.1, 2); reverb = GVerb.ar(source, roomsize, revtime, damping, inputbw, spread, drylevel, earlyreflevel, taillevel, maxroomsize); reverb = reverb * amp ; XOut.ar(out,env,reverb); //By Zé Craum }).add; )