// title: Rough Draft Final // author: kkomers // description: // code: ( Pbind( \instrument, "hihat", \degree, Pseq([0.1, 0.1, 0.2, 0.4, 0.7, 1, 1.5, 2], inf), \dur, Pseq([0.2, Rest(0.2), 0.2, Rest(0.2), 0.2, Rest(0.4), 0.2], inf);, \attackTime, 0.34, \amp, 0.75, ).play; ) ( Pbind( \instrument, "guitar3", \degree, Pseq([1, 1, 1, 2, 2, 2, 3, 3, 4, 3, 3, 3, 2, 2, 1, 1,1], inf), \dur, Pseq([0.19, 0.22], inf), \attackTime, 0.4, \amp, 0.75, ).play; ) ( SynthDef("alien", { arg freq = 500, amp = 4; var env, snd; env = Env.perc(level: amp).kr(2); snd = BPF.ar( in: LFPulse.ar( freq: LFNoise0.kr([8,19]).range(freq, freq*2), mul: env), freq: MouseY.kr(500, 2500), rq: 0.1 ); Out.ar(0, snd); }).add; ) ( SynthDef("hihat", {arg out = 0, amp = 0.5, att = 0.01, rel = 0.2, freq = 1000, pan = 0; var env, snd; env = Env.perc(attackTime: 0.3, releaseTime: 2, level: 0.2).kr(2); snd = BPF.ar( in: LFPulse.ar( freq: LFNoise0.kr([8,19]).range(freq)), ); Out.ar(out, Pan2.ar(snd, pan)); }).add; ) // example 1 ( { BPF.ar( in: LFPulse.ar( freq: LFNoise0.kr(10).range(100, 1000), mul: 0.3), freq: MouseY.kr(100, 4000), rq: 0.1 ) }.play; ) // example 2 ( SynthDef("wow", { arg freq = 500, amp = 1; var env, snd; env = Env.perc(level: amp).kr(2); snd = BPF.ar( in: LFPulse.ar( freq: LFNoise0.kr([8,19]).range(freq, freq*2), mul: env), freq: MouseY.kr(500, 2500), rq: 0.1 ); Out.ar(0, snd); }).add; ) // test it (single "note") Synth("wow"); // using it in a Pbind ( Pbind( \instrument, "wow", \freq, Pwhite(50, 2000), \dur, Pwhite(0.5, 2), \amp, 1 ).play; ) ( SynthDef("guitar2", { arg freq, amp, pan = 0; var out, pluck, period, string; freq = freq * [0.99,1,2,0.98]; pluck = PinkNoise.ar(Decay.kr(Line.kr(1, 0, 0.05), 0.05)); period = freq.reciprocal; string = CombL.ar(pluck, period, period, 4); out = LeakDC.ar(LPF.ar(string, 12000)); out = Splay.ar(out, XLine.ar(0.1,1,0.3)); out = out * XLine.ar(1,1/1000,4, doneAction:2); Out.ar(0, Pan2.ar(out, pan, amp) * 0.4); } ).send(s); ) ( SynthDef("guitar3", { arg freq = 100, amp, pan = 0; var out, pluck, period, string; freq = freq * [0.99,1,2,0.98]; pluck = PinkNoise.ar(Decay.kr(Line.kr(1, 0, 0.05), 0.05)); period = freq.reciprocal; string = CombL.ar(pluck, period, period, 4); out = LeakDC.ar(LPF.ar(string, 12000)); out = Splay.ar(out, XLine.ar(0.1,1,0.3)); out = out * XLine.ar(1,1/1000,4, doneAction:2); Out.ar(0, Pan2.ar(out, pan, amp) * 0.4); } ).send(s); ) ( SynthDef("guitar1", { arg freq, amp, pan = 0; var out, pluck, period, string; freq = freq * [0.98]; out = SinOsc.ar(freq); out = Splay.ar(out, XLine.ar(0.1,1,0.3)); out = out * XLine.ar(1,1/1000,2, doneAction:2); Out.ar(0, Pan2.ar(out, pan, amp) * 0.4); } ).send(s); ) ( SynthDef("symbals", { | decay = 3, amp = 1, freq = 440 | f = WhiteNoise.ar; f = LPF.ar(f, 12000); //f = f+ DelayC.ar(f, 0.1,LFNoise2.ar(1/2).range(0.001,0.01)); f = HPF.ar(f, 4000, 0.05); f = f * EnvGen.kr(Env.perc(0.01,decay*0.8), doneAction:2); Out.ar(0, 15 * f.dup * amp); }).store; ) ( SynthDef("kick", { | decay = 0.03, amp = 1, freq = 40 | var f = SinOsc.ar(freq*XLine.ar(2.4,1/4,0.4)); f = f * EnvGen.kr(Env.perc(0.0001,decay), doneAction:2); Out.ar(0,f.dup * amp * 1); }).store; ) TempoClock.default.tempo = 90/60 ( Ppar([ Pbind( \instrument, \guitar, \strum, 2/Pstep([32,16,3,12],2,inf), \degree, Pseq([ [0,2,4,6], [-1,2,4,6], [0,2,4,6], [0,2,4,6]-2, ],inf), \octave, 5, \dur, 1, \decay, Pseq([1],inf), ), Ppar([ Pbind(\instrument, \kick, \dur, 1/4, \decay, Pstep([2,0.3],1/4,inf) * 0.7, \octave, 4, \amp, Pstep([1,0,0,1, 0,0,1,0, 0,0.2,1,0, 0,0,0,0],1/4,inf)), Pbind(\instrument, \ch, \decay, 0.3, \dur, 1/Pstep([8,4,4,4,1,1,6,1],1,inf), \decay, Pn(Pseg([0.3,0.1],1)) / 2, \amp, Pstep([0,0,0,0, 1,0,0,0, 0,0,0,0, 1,0,0,0],1/4,inf) + (0.1*Pn(Pseg([0,0.4],1))) ) ]) ]).play; ) // Add Bjorn's Patented Dub Echo: ~echo = Synth(\dubecho, [\length, TempoClock.default.beatDur*(3/4), \fb, 0.7, \sep, 0.0012], addAction: \addToTail); ~echo.free