// title: Skyline by Bobby Macdonald // author: Bruno Ruviaro // description: // "Skyline" by Bobby Macdonald. Created as a Final Project for the course MUSC 115 - Experimental Sound Design, Santa Clara University, Fall 2019. // code: // ============================= // "Skyline" by Bobby Macdonald (composition and code) // // Final Project for MUSC 115 - Experimental Sound Design // Bruno Ruviaro, instructor // Santa Clara University // Fall 2019 // // ============================= ( s.waitForBoot({ //KEYS SynthDef("keyMod", { arg freq = 440, amp = 0.2, gate = 1, pan = 0, att = 0.01, rel = 0.1; var snd, env; // variables snd, env env = Env.adsr( attackTime: att, decayTime: 0.3, sustainLevel: 0.5, releaseTime: rel ).kr(gate: gate); snd = SinOsc.ar(freq: freq, mul: amp); snd = snd * env; snd = FreeVerb.ar( in: snd, mix: 0.3, room: 0.6, damp: 0.6 ); snd = Pan2.ar(snd, pan); Out.ar(0, snd); // 'doneAction: 2' here DetectSilence.ar(snd, 0.001, 0.2, doneAction: 2); }).add; //LEAD SynthDef("melody", { arg amp, att, rel, pan = 0, freq, ffreq, verbMix = 0.5; var env, snd; env = Env.perc(att, rel, amp).kr; snd = LFTri.ar(freq, mul: amp); snd = LPF.ar(snd, ffreq, 1); snd = snd * env; snd = FreeVerb.ar( in: snd, mix: verbMix, room: 0.5, damp: 0.5, mul: 1 ); snd = Mix.ar(snd); snd = Limiter.ar(snd); snd = Pan2.ar(snd, pan); Out.ar(0, snd); DetectSilence.ar(snd, doneAction: 2); }).add; //KICK SynthDef("kick1", {arg out = 0, amp = 0.3, sinFreq = 60, glissf = 0.9, att = 0.01, rel = 0.45, pan = 0; var gliss = XLine.kr(sinFreq, sinFreq*glissf, rel); var snd = SinOsc.ar(gliss); var env = Env.perc(att, rel).kr(doneAction: 2); snd = snd * env * amp; Out.ar(out, Pan2.ar(snd, pan)); }).add; //SNARE - snareElectro SynthDef("snare", { arg //Standard Values out = 0, pan = 0, amp = 0.4, att = 0.001, rel = 0.15, curve = -4, //Other Controls, blend ranges from 0 to 1 popfreq = 160, sweep = 0.01, noisefreq = 810, rq = 1.6, blend = 0.41; var pop, popEnv, popSweep, noise, noiseEnv, snd; // pop makes a click coming from very high frequencies // slowing down a little and stopping in mid-to-low popSweep = Env.new(levels: [20.4, 2.6, 1] * popfreq, times: [sweep / 2, sweep], curve: \exp).ar; popEnv = Env.perc(attackTime: att, releaseTime: 0.73 * rel, level: blend, curve: curve).kr; pop = SinOsc.ar(freq: popSweep, mul: popEnv); // bandpass-filtered white noise noiseEnv = Env.perc(attackTime: att, releaseTime: rel, level: 1 - blend, curve: curve).kr(doneAction: 2); noise = BPF.ar(in: WhiteNoise.ar, freq: noisefreq, rq: rq, mul: noiseEnv); snd = Mix.ar(pop + noise) * amp; Out.ar(out, Pan2.ar(snd, pan)); }).add; SynthDef("hihat1", { arg out = 0, amp = 0.5, att = 0.01, rel = 0.2, ffreq = 6000, pan = 0; var snd = WhiteNoise.ar(amp); var env = Env.perc(att, rel).kr(doneAction: 2); snd = HPF.ar(snd * env, ffreq); Out.ar(out, Pan2.ar(snd, pan)); }).add; // PBINDS // ~bpm = TempoClock.new(125/60).permanent_(true); ~keyMotif = Pbind( \instrument, "keyMod", \degree, Pseq([Pn(4, 12), 5, 5, 5, 5, Pn(4, 16)], inf), \dur, 1/2, \att, 0.02, \rel, 2, \amp, 0.2, \ctranspose, 2 ).play.stop; ~keyBuild = Pbind( \instrument, "keyMod", \degree, Pseq([0, 1, 2, 1], inf), \dur, 8, \att, 0.02, \rel, 2, \amp, 0.2, \ctranspose, -10 ).play.stop; ~keyMoreBuild = Pbind( \instrument, "keyMod", \degree, Pseq([[-4 ,0], [-3, 1], [-2, 2], [-3, 1]], inf), \dur, 8, \att, 0.02, \rel, 2, \amp, 0.2, \ctranspose, -10 ).play.stop; ~firstLead = Pbind( \instrument, "melody", \degree, Pseq([7, 4, 8, 4, 8, 7, 9, 6], inf), \dur, Pseq([3/2, 13/2], inf), \att, 0.1, \rel, 2, \amp, 0.6, \ffreq, 3800, \ctranspose, 2 ).play.stop; ~leadInterlude = Pbind( \instrument, "melody", \degree, Pseq([7, 6, 4, 6, 7, 6, 4, 6, Prand([8, 9], 1), 6, 4, 6, 11, 6, 4, 6], inf), \dur, 1/4, \att, 0.01, \rel, 1.5, \amp, 0.6, \ffreq, 3800, \ctranspose, 2 ).play.stop; ~kickDrum = Pbind( \instrument, "kick1", \dur, 1, \att, 0.01, \rel, 0.3, \glissf, Pwrand([0.9, 0.5], [0.9, 0.1], inf), \amp, 1 ).play.stop; ~snareBuild = Pbind( \instrument, "snare", \dur, 1/4, \att, 0.01, \rel, 0.1, \amp, 0.2 ).play.stop; ~snareDrop = Pbind( \instrument, "snare", \dur, Pseq([1/4, 1/2], 5), \att, 0.01, \rel, 0.1, \amp, 0.2 ).play.stop; ~snareMain = Pbind( \instrument, "snare", \dur, Pseq([Rest(1), 1], inf), \att, 0.01, \rel, 0.1, \amp, 0.3 ).play.stop; ~hihatMain = Pbind( \instrument, "hihat1", \dur, 1/4, \att, 0.01, \rel, Pwrand([0.1, 0.3], [0.95, 0.05], inf), \ffreq, 10000, \pan, Pwhite(-0.5, 0.5), \amp, 0.6 ).play.stop; // SCORE { ~keyMotif.reset.play(~bpm); 32.wait; ~keyBuild.reset.play(~bpm); 32.wait; ~keyBuild.stop; ~keyMoreBuild.reset.play(~bpm); 32.wait; ~kickDrum.reset.play(~bpm); 64.wait; ~kickDrum.stop; ~firstLead.reset.play(~bpm); 32.wait; ~snareBuild.reset.play(~bpm); 28.wait; ~snareBuild.stop; ~snareDrop.reset.play(~bpm); 4.wait; ~snareMain.reset.play(~bpm); ~kickDrum.reset.play(~bpm); ~hihatMain.reset.play(~bpm); 64.wait; ~snareMain.stop; ~kickDrum.stop; ~hihatMain.stop; ~firstLead.stop; ~keyMotif.stop; ~leadInterlude.reset.play(~bpm); 32.wait; ~keyMotif.reset.play(~bpm); 32.wait; ~snareBuild.reset.play(~bpm); 28.wait; ~snareBuild.stop; ~snareDrop.reset.play(~bpm); 4.wait; ~snareMain.reset.play(~bpm); ~kickDrum.reset.play(~bpm); ~hihatMain.reset.play(~bpm); 32.wait; ~snareMain.stop; ~kickDrum.stop; ~hihatMain.stop; ~leadInterlude.stop; 32.wait; ~keyMoreBuild.stop; 32.wait; ~keyMotif.stop; }.fork(~bpm); }); // end of waitForBoot ); /* ~keyMotif.reset.play(~bpm); //~keyBuild.reset.play(~bpm); ~keyMoreBuild.reset.play(~bpm); ~kickDrum.reset.play(~bpm); ~firstLead.reset.play(~bpm); ~snareMain.reset.play(~bpm); ~hihatMain.reset.play(~bpm); ~leadInterlude.reset.play(~bpm); ~snareDrop.reset.play(~bpm); */