// title: Herbie Hancock's Chameleon // author: Bruno Ruviaro // description: // SynthDef & Pbind bass line demo made for SCLOrk in 2021 // code: // Herbie Hancock's Chameleon // SynthDef and Pbind // made for SCLOrk in 2021 ( SynthDef("bassy", {arg out=0, freq=440, amp=0.1, att = 0.01, rel = 0.01, gate=1, pan=0; var snd, env, saw, sine; env = Env.asr(attackTime: att, sustainLevel: amp, releaseTime: rel).kr(gate: gate); saw = Saw.ar(freq: freq * Array.rand(16, 0.99, 1.01), mul: env / 3); sine = SinOsc.ar( freq: freq * [0.5, 1, 2], mul: env * [1, 0.5, 0.4] ).tanh.distort / 4; snd = saw + sine; snd = FreeVerb.ar(snd, 0.3, 0.4, 0.9); snd = LPF.ar(snd, XLine.kr(15000, 700, 0.3)); snd = Pan2.ar(Mix(snd), pan); snd = Limiter.ar(snd); DetectSilence.ar(snd, doneAction: 2); Out.ar(out, snd); }).add; ) ~bpm = TempoClock.new(90/60).permanent_(true); ( p = Pbind( \instrument, "bassy", \dur, Pseq([ 0.25, Rest(0.5), 0.25, // beat 1 Rest(0.5), 0.25, Rest(0.25), // beat 2 Rest(0.5), 0.5, // beat 3 0.5, 0.5 // beat 4 ], inf), \midinote, Pseq([ 34, \rest, 44, // 1 \rest, 46, \rest, // 2 \rest, 36, // 3 37, 38, // 4 39, \rest, 46, // 1 \rest, 49, \rest, // 2 \rest, 31, // 3 32, 33 // 4 ], inf), \amp, Pseq([ 1, \rest, 1, // 1 \rest, 1, \rest, // 2 \rest, 1, // 3 1, 1, // 4 1, \rest, 1, // 1 \rest, 1, \rest, // 2 \rest, 1, // 3 1, 1 // 4 ], inf) * 0.2, \att, 0.001, \rel, 0, \legato, 0.9, ).play(~bpm); ) p.stop;