// title: Navigations SC code // author: arievvdv // description: // Performance patch for my piece for viola and transducers "Navigations" // code: Server.default.options.outDevice_("External Headphones") s.boot ( (SynthDef(\pulse, { arg atk=0.1, sus=0, rel=0.5, c1=1, c2=(-1), detune=0.2, freq=500, cf=400, rq=0.1, pan=0, amp=0.25, out=0; var sig, env; env = EnvGen.kr(Env.perc(0.01, rel), doneAction:2); sig = Pulse.ar(freq, 0.3, mul: amp) + Saw.ar(freq * 2, amp / 2); sig = RLPF.ar(sig, cf * env); sig = Pan2.ar(sig, pan); sig = sig * env * amp * 0.5; Out.ar(out, sig); }).add; ); ( SynthDef(\fm, { arg carHz=500, modHz=100, modAmp=200, atk=0.01, rel=1, amp=0.2, pan=0; var car, mod, env; env = EnvGen.kr(Env.perc(atk, rel), doneAction: 2); mod = SinOsc.ar(modHz, mul:modAmp); car = SinOsc.ar(carHz + mod) * env * amp; car = FreeVerb.ar(car, 0.3, 0.8); car = Pan2.ar(car, pan); Out.ar(0, car) }).add; ); (SynthDef(\sine, { arg atk=0.1, sus=0, rel=0.5, c1=1, c2=(-1), detune=0.2, freq=500, cf=1500, rq=0.1, pan=0, amp=0.25, out=0; var sig, env; env = EnvGen.kr(Env.perc(0.01, rel), doneAction:2); sig = SinOsc.ar(freq, mul: amp); sig = Pan2.ar(sig, pan); sig = sig * env * amp; Out.ar(out, sig); }).add; ); (SynthDef(\saw, { arg atk=0.1, sus=0, rel=1, c1=1, c2=(-1), detune=0.2, freq=500, cf=1500, rq=0.1, pan=1, amp=0.25, out=0; var sig, env; env = EnvGen.kr(Env([0, 1,1, 0], [atk, sus, rel]), doneAction:2); sig = Saw.ar(freq, mul: amp); sig = Pan2.ar(sig, pan); sig = sig * env * amp; Out.ar(out, sig); }).add; ); (SynthDef(\sinepad, { arg atk=0.1, sus=0, rel=1, c1=1, c2=(-1), detune=0.2, freq=500, cf=1500, rq=0.1, pan=1, amp=0.25, out=0; var sig, env; env = EnvGen.kr(Env([0, 1,1, 0], [atk, sus, rel]), doneAction:2); sig = SinOsc.ar(freq, mul: amp); sig = Pan2.ar(sig, pan); sig = sig * env * amp; Out.ar(out, sig); }).add; ); (SynthDef(\sawbpf, { arg atk=2, sus=0, rel=3, c1=1, c2=(-1), detune=0.2, freq=500, cf=1500, rq=0.1, pan=1, amp=0.25, out=0; var sig, env; env = EnvGen.kr(Env([0,1,1,0],[atk,sus,rel],[c1,0,c2]),doneAction:2); sig = Saw.ar(freq * {LFNoise1.kr(0.5,detune).midiratio}); sig = BPF.ar(sig, cf, rq); sig = Pan2.ar(sig, pan); sig = sig * env * amp; Out.ar(out, sig); }).add; ); ( (SynthDef.new(\blip, { arg out, fund=300, dens=1, decay=0.2, amp=0.5, width = 0.5, pan=0; var freq, trig, sig; freq = LFNoise0.kr(3).exprange(fund,fund*3).round([fund, fund * 1.5, fund * 2, fund * 3, (fund * 3)/2,]); sig = Pulse.ar(freq, width * {LFNoise1.kr(0.5!8)}); trig = Dust.kr(dens); sig = RLPF.ar(sig, amp * 500 * EnvGen.kr(Env.perc(0.01, decay), trig), 2); sig = sig * EnvGen.kr(Env.perc(0.01, decay), trig, doneAction: 2) * amp; sig = Pan2.ar(sig, pan); sig = HPF.ar(sig, 80); Out.ar(out, sig); })).add; ) ) s.boot ( ( ~p = Pbind( \instrument, \sine, \sus, 1, \freq, 62, \dur, 1/1, \amp, Pseq([0.1, 0, 0, 0, 0.1, 0.2, 0.3, 0.5, 0.6, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7, 0.5, 0.3, 0.2], inf), \pan, -1 ); ); ( ~s2 = Pbind( \instrument, \sawbpf, \dur, Prand([ 5, 4, 6, 2], inf), \freq, Pseq([ [124, 186, 313, 325], [157.5, 232.5, 469.5, 325, 313], [20, 30, 626, 650, 634], [3,5,7], [626,650,634,630,680], [4,5,6,7,8,9,10,11,12,13,14]] / 2, inf), \cf, Pexprand(100, 10000), \detune, Pwhite(0.1,0.6), \rq, Pwhite(0.1, 1), \atk, Pwhite(2, 9), \rel, Pwhite(6, 20), \amp, Pwhite(0.05, 0.1) ); ); (~s = Pbind(\instrument, \sawbpf, \freq, Pseq([[124, 186, 313, 325], [62, 93, 156, 162], [31, 48, 78, 81, 313, 186]], inf), \atk, Pwhite(2, 15, inf), \rq, Pwhite(0.1, 0.7, inf), \cf, Pexprand(100, 3000), \dur, Pwhite(10, 40, inf), \rel, Pkey(\dur, inf), \amp, 0.10, \pan, 1, ) ); ( ~c = Pbind( \instrument, \sawbpf, \dur, Prand([ 5, 4, 6, 2], 30), \freq, Pseq([ [2, 3, 5, 7], [3,5], [12, 15]], inf), \detune, Pwhite(0.1,0.6), \rq, Pwhite(0.1, 1), \cf, Pexprand(100, 3000), \atk, Pwhite(2, 9), \rel, Pwhite(6, 20), \amp, Pwhite(0.01, 0.1), \pan, -1, ) ); ( ~b = (Pbind(\instrument, \blip, \width, Prand([0.2, 0.4, 0.5, 0.6, 0.8], inf), \decay, Pwhite(0.1, 1, inf), \fund, Pseq([[124,186], [186,313], [313,325], [124, 313, 325], [124, 186, 313, 325, 252, 158, ]] * 3, inf), \dur, Prand([ 5, 4, 6, 2], inf), \dens, Pwhite(Env([0.5, 1, 1], [200, 300]), Env([0.2, 8, 2], [200, 300])), \amp, Pbrown(0.5, 0.8, 0.05, inf), ))); ( ~f = Pbind( \instrument, Pwrand([\pulse, \sine, \fm],[3,2,5].normalizeSum, inf), \dur, Pbrown(0.03,0.2, 0.2, 40), \freq, 63 * Pxrand([20, 21, 22], inf), \carHz, 63, \modHz, 63 * Pxrand([5, 4, 3, 19, 20, 21, 22, 48, 49, 40], inf), \modAmp, Pexprand(200, 1000), \rel, Pwhite(0.05, 0.7, inf), \cf, Pexprand(Pkey(\freq), Pkey(\freq) * 4), \atk, 0.001, \amp, Penv([0.01,0.3,0.01], [0.001, 4], 'exp') ); ); ( Pbind( \instrument, Pwrand([\pulse, \sine, \sawbpf, \fm],[1,2,1,5].normalizeSum, inf), \dur, Pwrand([Pbrown(0.5, 2, 0.3, 13), Pbrown(0.87, 10, 0.4, 6), Pbrown(0.2, 1.5, 0.4, 4), Pseq([2, 4, 2], 4)], [8, 4, 2, 6].normalizeSum, inf), \freq, 63 * Pxrand([0.5,1, 3, 6, 4, 5, 6, 7, 11, 12, 14, 20], inf), \carHz, 63 * Pxrand([0.5, 1, 3, 6, 4, 5, 6, 7, 11, 12, 14, 20], inf), \modHz, 63 * Pxrand([3, 6, 4, 5, 6, 7, 11, 12, 14, 20], inf), \modAmp, Pexprand(200, 1000), \rel, Pwrand([1, 2, 8], [4, 2, 1], inf), \cf, Pexprand(Pkey(\freq), Pkey(\freq) * 4), \atk, 0.001, \amp, Pwrand([Pwhite(0.02, 0.40, 50), Pseq([0], 20)], [1, 3], inf), ); ) ) s.reboot //clicks - one minute //Explore instrument with FM //explore strings with FM, transition to saw //bring in Pulse //Rhythmic saw bits, slowly incorporate pizz and bow //switch to saw2, continue //turn off pulses, turn on clicks, start QT player //Phase out saw2 //listen to clicks w qt player - eventually join in ~fmenv = ~f.play ~blips = ~b.play ~pulses = ~p.play ~clicks = ~c.play ~saw = ~s.play ~saw2 = ~s2.play ~saw2.stop ~saw.stop ~blips.stop ~clicks.stop ~pulses.stop s.meter s.reboot