// title: Colby's 115 modulations // author: cmoeller // description: // https://soundcloud.com/user-52183734/project-2115modulations // code: ( SynthDef("am1", {arg freq = 10, modfreq = 2, amp = 0.2, att = 0.01, rel = 3; var carrier, modulator, env; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(2); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = SinOsc.ar(freq: freq, mul: env * modulator); Out.ar(0, carrier ! 2); }).add; SynthDef("am2", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, sus = 0.2, rel = 3, gate = 1, pos = 0; var carrier, modulator, env; env = Env.asr( attackTime: att, sustainLevel: sus, releaseTime: rel ).kr(doneAction: 2, gate: gate, mul: amp); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = SinOsc.ar(freq: freq, mul: env * modulator); Out.ar(0, Pan2.ar(carrier, pos)); }).add; SynthDef("am3", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, sus = 0.2, rel = 3, gate = 1, pos = 0; var carrier, modulator, env; env = Env.asr( attackTime: att, sustainLevel: sus, releaseTime: rel ).kr(doneAction: 2, gate: gate, mul: amp); modulator = SinOsc.ar(modfreq).range(0, 1); freq = freq * LFNoise2.kr([2, 1/2, 1/3, 1/4, 1]).range(0.98, 1.01); carrier = Pulse.ar(freq: freq, mul: env * modulator); carrier = Mix.ar(carrier); carrier = LPF.ar(carrier, Line.kr(10000, 1000, att)); Out.ar(0, Pan2.ar(carrier, pos)); }).add; SynthDef("fm1", {arg freq = 440, modfreq = 5, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3; var carrier, modulator, freqdev, env; freqdev = modfreq * modindex; modulator = SinOsc.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: freq + modulator); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * 0.5); }).add; SynthDef("fm2", {arg freq = 440, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3; var carrier, modulator, freqdev, env, modfreq; modindex = Line.kr(modindex, 1, att); modfreq = freq / 2; freqdev = modfreq * modindex; modulator = SinOsc.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: freq + modulator); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * 0.5); }).add; ) ( ~snd1 = Pbind( \instrument, "am1", \midinote, Prand([ [72, 77, 79], [79, 82, 86], [87, 86, 84], [82, 84, 79], ], 8), \ctranspose, Prand([-12, 0], inf), \dur, Prand([0.5, 1.5], inf), \amp, Pwhite(0.1, 0.2), \att, Pwhite(0.1, 0.2), \rel, Pwhite(1, 3.0), \modfreq, Prand([2.5, 5, 7.5, 10, 15], inf), \pos, Prand([-0.5, 0, 0.5], inf) ); ~snd2 = Pbind( \instrument, "am2", \midinote, Prand([72, 79, 77, 79, 82, 79, 87, 86, 84, 82, 84, 79], 12), \ctranspose, [-24, -19], \dur, Pseq([Pn(0.1, 5), 0.2], inf), \amp, Pwhite(0.15, 0.2), \att, 0.01, \rel, 0.1, \modfreq, Pwhite(10, 30), \pos, 0 ); ~snd3 = Pbind( \instrument, "am1", \degree, Pseq([0, 2], inf), \modfreq, Pseq([1, 5, 10, 50, 100], inf), \amp, 0.4, \dur, 0.2, \att, 0.01, \rel, Pwhite(0.3, 0.5), \pos, Pwhite(-1, 1.0) ); ~snd4 = Pbind( \instrument, "fm1", \midinote, Prand([72, 79, 77, 79, 82, 79, 87, 86, 84, 82, 84, 79], 20), \ctranspose, [-12, 0, 4], \dur, Pseq([Pn(0.2, 5), 0.3], inf), \amp, Pwhite(0.05, 0.1), \att, Pwhite(0.5, 1.8), \rel, Pwhite(0.3, 3), \modfreq, Pwhite(20, 100), \pos, Pwhite(-0.5, 0.5) ); ~snd5 = Pbind( \instrument, "fm2", \freq, Pseries(100, 50, 20), \modfreq, Pseq([1, 500, 10, 50, 100], inf), \amp, 0.2, \att, 0.02, \rel, 4, \pos, Pwhite(-1, 1), \dur, 0.1 ); ) // testing ~snd1.play; ~snd2.play; ~snd3.play; ~snd4.play; ~snd5.play; ( { ~player1=~snd1.play; 4.wait; ~player2=~snd2.play; 3.wait; ~player1.stop; 2.wait; ~player5=~snd3.play; 1.wait; ~player1.play; 1.wait; ~player3=~snd4.play; 1.wait; ~player4=~snd5.play; 2.wait; ~player5.stop; 3.wait; ~player1=~snd1.play; ~player2.stop; ~player3.stop; 2.wait; ~player3=~snd4.play; 1.wait; ~player3.stop; ~player1.stop; ~player2=~snd2.play; 1.wait; ~player2.stop; ~player5=~snd3.play; 1.wait; ~player1=~snd1.play; ~player2=~snd2.play; ~player4=~snd5.play; 7.wait; ~player3=~snd4.play; ~player1.stop; ~player2.stop; 1.wait; ~player2=~snd2.play; 3.wait; ~player2.stop; 7.wait; ~player3=~snd4.play; 2.wait; ~player5.stop; ~player1=~snd1.play; 2.wait; ~player2=~snd2.play; 1.wait; ~player5=~snd3.play; 6.wait; ~player5.stop; ~player4=~snd5.play; 2.wait; ~player4.stop; ~player3=~snd4.play; 4.wait; ~player3.stop; }.fork; )