{
   "is_private" : null,
   "id" : "1-4Ek",
   "code" : "(\r\n////////////////////////////////////////////////////////////////\r\n// EPIC SAX GUY SynthDefs\r\n// http://www.youtube.com/watch?v=KHy7DGLTt8g\r\n// Not yet there... but hearable\r\n\r\n// sounds more like a trumpet/horn after the failure and cheesyness of the stk sax\r\nSynthDef(\\sax, { |out, freq=440, amp=0.1, gate=1|\r\n\tvar num = 16;\r\n\tvar harms = Array.series(num, 1, 1) * Array.exprand(num, 0.995, 1.001);\r\n\tvar snd = SinOsc.ar(freq * SinOsc.kr(Rand(2.0,5.0),0,Rand(0.001, 0.01),1) * harms, mul:Array.geom(num, 1, 0.63));\r\n\tsnd = Splay.ar(snd);\r\n\tsnd = BBandPass.ar(snd, freq * XLine.kr(0.1,4,0.01), 2);\r\n\tsnd = snd * amp * EnvGen.ar(Env.adsr(0.001, 0.2, 0.7, 0.2), gate, doneAction:2);\r\n\tOut.ar(out, snd!2);\r\n}).add;\r\n\r\n// should be more like a gated synth, but this one gives the rhythmic element\r\n// remember to pass the bps from the language tempo!\r\nSynthDef(\\lead, { |out, freq=440, amp=0.1, gate=1, bps=2|\r\n    var snd;\r\n    var seq = Demand.kr(Impulse.kr(bps*4), 0, Dseq(freq*[1,3,2], inf)).lag(0.01);\r\n    snd = LFSaw.ar(freq*{rrand(0.995, 1.005)}!4);\r\n    snd = Splay.ar(snd);\r\n    snd = MoogFF.ar(snd, seq, 0.5);\r\n    snd = snd * EnvGen.ar(Env.asr(0.01,1,0.01), gate, doneAction:2);\r\n    OffsetOut.ar(out, snd * amp);\r\n}).add;\r\n\r\n// yep, an organ with a sub bass tone :D\r\nSynthDef(\\organ, { |out, freq=440, amp=0.1, gate=1|\r\n    var snd;\r\n    snd = Splay.ar(SinOsc.ar(freq*Array.geom(4,1,2), mul:1/4));\r\n    snd = snd + SinOsc.ar(freq/2, mul:0.4)!2;\r\n    snd = snd * EnvGen.ar(Env.asr(0.001,1,0.01), gate, doneAction:2);\r\n    OffsetOut.ar(out, snd * amp);\r\n}).add;\r\n\r\n// from the synth def pool\r\nSynthDef(\\kick, { |out=0, amp=0.1, pan=0|\r\n\tvar env0, env1, env1m, son;\r\n\t\r\n\tenv0 =  EnvGen.ar(Env.new([0.5, 1, 0.5, 0], [0.005, 0.06, 0.26], [-4, -2, -4]), doneAction:2);\r\n\tenv1 = EnvGen.ar(Env.new([110, 59, 29], [0.005, 0.29], [-4, -5]));\r\n\tenv1m = env1.midicps;\r\n\t\r\n\tson = LFPulse.ar(env1m, 0, 0.5, 1, -0.5);\r\n\tson = son + WhiteNoise.ar(1);\r\n\tson = LPF.ar(son, env1m*1.5, env0);\r\n\tson = son + SinOsc.ar(env1m, 0.5, env0);\r\n\t\r\n\tson = son * 1.2;\r\n\tson = son.clip2(1);\r\n\t\r\n\tOffsetOut.ar(out, Pan2.ar(son * amp));\r\n}).add;\r\n\r\n// full of fail:\r\n\r\n//SynthDef(\\sax, { |out, freq=440, amp=0.1, gate=1|\r\n//\tvar r_stiff = 67;\r\n//\tvar r_ap = 63;\r\n//\tvar noise = 10;\r\n//\tvar pos = 20;\r\n//\tvar vibf = 20;\r\n//\tvar vibg = 1;\r\n//\tvar press = 85;\r\n//\tvar snd = StkSaxofony.ar(freq, r_stiff, r_ap, noise, pos, vibf, vibg, press, 1, amp);\r\n//\tsnd = snd * EnvGen.ar(Env.adsr(0.001, 0.2, 0.7, 0.2), gate, doneAction:2);\r\n//\tOut.ar(out, snd!2);\r\n//}).add;\r\n\r\n\r\n)\r\n\r\n////////////////////////////////////////////////////////////////\r\n// EPIC SAX GUY TUNE\r\n// http://www.youtube.com/watch?v=KHy7DGLTt8g\r\n// ... still needs a nice gated pad\r\n\r\n(\r\nTempoClock.default.tempo = 2.1;\r\n\r\nPdef(\\kick).quant = 4;\r\nPdef(\\organ).quant = 4;\r\nPdef(\\sax).quant = 4;\r\nPdef(\\lead).quant = 4;\r\n\r\n////////////////////////////////////////////////////////////////\r\nPdef(\\kick, Pbind(\\instrument, \\kick, \\dur, 1, \\amp, 1)).play;\r\n\r\nPdef(\\organ, Pbind(\r\n\t\\instrument, \\organ,\r\n\t\\octave, [3,4],\r\n\t\\root, 3,\r\n\t\\scale, Scale.minor,\r\n\t\\degree, Pstutter(3, Pseq([0,-2,2,4], inf)),\r\n\t\\amp, 0.3,\r\n\t\\dur, Pseq([1.5,1.5,1], inf)\r\n)).play;\r\n\r\nPdef(\\lead, Pbind(\r\n\t\\instrument, \\lead,\r\n\t\\octave, [5,6],\r\n\t\\root, 3,\r\n\t\\scale, Scale.minor,\r\n\t\\degree, Pseq([0,2,0,4], inf),\r\n\t\\amp, 0.2,\r\n\t\\bps, TempoClock.default.tempo,\r\n\t\\dur, 4\r\n)).play;\r\n\r\n// needs more articulation...\r\nPdef(\\sax, Pbind(\r\n\t\\instrument, \\sax,\r\n\t\\root, 3,\r\n\t\\scale, Scale.minor,\r\n\t\\octave, 5,\r\n\t\\legato, 0.75,\r\n\t\\amp, Pwhite(0.9,1.0, inf),\r\n\t\\degree, Pseq([Pseq([Pn(4,4),3,4],2), Pseq([4,6,4,3,2,0,0,1,2,0])], inf),\r\n\t\\dur, Pseq([Pseq([2,1/2,Pn(1/4,3),3/4],2), Pseq([1.5,1,1,1,1,Pn(0.5,5)])], inf)\r\n)).play;\r\n)",
   "labels" : [
      "epic sax guy",
      "sax",
      "trumpet",
      "pop"
   ],
   "ancestor_list" : [],
   "description" : "Again, just an exercise to get this tune out of my head. I was actually trying out the Stk plugins, but the sax there is quite cheesy. Not it's replaced by a cheap pseudo trumpet.\r\n\r\nEpic Sax Guy:\r\nhttp://www.youtube.com/watch?v=KHy7DGLTt8g",
   "author" : "rukano",
   "name" : "Epic Sax Guy (cheap version)"
}
