{
   "ancestor_list" : [],
   "description" : "https://soundcloud.com/macdaddymase/song-2",
   "name" : "Mason 115 Modulations",
   "author" : "Mason McCormack",
   "is_private" : null,
   "id" : "1-55i",
   "code" : "(\r\nSynthDef(\"am1\", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, rel = 3;\r\n    var carrier, modulator, env;\r\n    env = Env.perc(\r\n        attackTime: att,\r\n        releaseTime: rel,\r\n        level: amp\r\n    ).kr(2);\r\n    modulator = SinOsc.ar(modfreq).range(0, 1);\r\n    carrier = SinOsc.ar(freq: freq, mul: env * modulator);\r\n    Out.ar(0, carrier ! 2);\r\n}).add;\r\n\r\nSynthDef(\"am2\", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, sus = 0.2, rel = 3, gate = 1, pos = 0;\r\n    var carrier, modulator, env;\r\n    env = Env.asr(\r\n        attackTime: att,\r\n\t\tsustainLevel: sus,\r\n        releaseTime: rel\r\n\t).kr(doneAction: 2, gate: gate, mul: amp);\r\n    modulator = SinOsc.ar(modfreq).range(0, 1);\r\n    carrier = SinOsc.ar(freq: freq, mul: env * modulator);\r\n\tOut.ar(0, Pan2.ar(carrier, pos));\r\n}).add;\r\n\r\nSynthDef(\"am3\", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, sus = 0.2, rel = 3, gate = 1, pos = 0;\r\n    var carrier, modulator, env;\r\n    env = Env.asr(\r\n        attackTime: att,\r\n\t\tsustainLevel: sus,\r\n        releaseTime: rel\r\n\t).kr(doneAction: 2, gate: gate, mul: amp);\r\n    modulator = SinOsc.ar(modfreq).range(0, 1);\r\n\tfreq = freq * LFNoise2.kr([2, 1/2, 1/3, 1/4, 1]).range(0.98, 1.01);\r\n    carrier = Pulse.ar(freq: freq, mul: env * modulator);\r\n\tcarrier = Mix.ar(carrier);\r\n\tcarrier = LPF.ar(carrier, Line.kr(10000, 1000, att));\r\n\tOut.ar(0, Pan2.ar(carrier, pos));\r\n}).add;\r\n\r\nSynthDef(\"fm1\", {arg freq = 440, modfreq = 5, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3;\r\n\tvar carrier, modulator, freqdev, env;\r\n\t// i = d/m, so d = m*i\r\n\tfreqdev = modfreq * modindex;\r\n\tmodulator = SinOsc.ar(freq: modfreq, mul: freqdev);\r\n\tcarrier = SinOsc.ar(freq: freq + modulator);\r\n\tenv = Env.asr(\r\n\t\tattackTime: att,\r\n\t\tsustainLevel: amp,\r\n\t\treleaseTime: rel\r\n\t).kr(doneAction: 2, gate: gate);\r\n\tcarrier = Pan2.ar(in: carrier, pos: pos, level: env);\r\n\tOut.ar(0, carrier * 0.5);\r\n}).add;\r\n\r\nSynthDef(\"fm2\", {arg freq = 440, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3;\r\n\tvar carrier, modulator, freqdev, env, modfreq;\r\n\t// i = d/m, so d = m*i\r\n\tmodindex = Line.kr(modindex, 1, att);\r\n\tmodfreq = freq / 2;\r\n\tfreqdev = modfreq * modindex;\r\n\tmodulator = SinOsc.ar(freq: modfreq, mul: freqdev);\r\n\tcarrier = SinOsc.ar(freq: freq + modulator);\r\n\tenv = Env.asr(\r\n\t\tattackTime: att,\r\n\t\tsustainLevel: amp,\r\n\t\treleaseTime: rel\r\n\t).kr(doneAction: 2, gate: gate);\r\n\tcarrier = Pan2.ar(in: carrier, pos: pos, level: env);\r\n\tOut.ar(0, carrier * 0.5);\r\n}).add;\r\n)\r\n\r\n\r\n(\r\n~a = Pbind(\r\n    \\instrument, \"am1\",\r\n    \\midinote, Pseq([50, 55, 60, 70, 75, 69], inf),\r\n    \\dur, Pseq([Pn(0.5, 5),    1.5], inf),\r\n    \\amp, Pwhite(0.15, 0.2),\r\n    \\att, 0.1,\r\n    \\rel, 3,\r\n    \\modfreq, Pseq([12, 9, 7, 5, 3], inf),\r\n\t\\pos, 0\r\n);\r\n\r\n\r\n\r\n~b= Pbind(\r\n\t\\instrument, \"am2\",\r\n\t\\degree, Pseq([0, 2, 6], inf),\r\n\t\\modfreq, Prand([10, 5, 10, 50, 130], inf),\r\n\t\\amp, Pwhite(0.1, 0.9),\r\n\t\\dur, 0.1,\r\n\t\\att, 0.01,\r\n\t\\rel, Pwhite(0.3, 0.9),\r\n\t\\pos, Pseq(series(-1, -0.9, 1), inf)\r\n);\r\n\r\n~c = Pbind(\r\n    \\instrument, \"am3\",\r\n    \\midinote, Prand([72, 79, 77, 79, 82, 79, 87, 86, 84, 82, 84, 79], inf),\r\n\t\\ctranspose, -12,\r\n\t\\dur, Pseq([Pn(0.5, 5), Prand([1.5, 3])], inf),\r\n    \\amp, Pwhite(0.15, 0.5),\r\n\t\\att, Pwhite(0.5, 1),\r\n\t\\rel, Pwhite(1, 3.0),\r\n    \\modfreq, Pseq([7, 9, 10, 11], inf)\r\n);\r\n\r\n\r\n\r\n~d = Pbind(\r\n    \\instrument, \"fm1\",\r\n    \\dur, 0.2,\r\n\t\\degree, Pseq([0, 4, 5, 6], 2),\r\n\t\\ctranspose, [-4, 0, 3, 5, 9],\r\n\t\\modfreq, Pwhite(10, 40),\r\n    \\modindex, 1, //\r\n\t\\amp, Pseq([0.3, 0.2, 0.1, 0.05], inf),\r\n\t\\att, 0.01,\r\n\t\\rel, 0.1,\r\n\t\\pos, Pwhite(-1, 1.0)\r\n);\r\n\r\n\r\n~e = Pbind(\r\n    \\instrument, \"fm2\",\r\n\t\\dur, 0.5,\r\n\t\\degree, Pseq([1, 3, 6, 7], 2),\r\n\t\\ctranspose, [-1, 0, 5, 7, 9],\r\n\t\\modfreq, Pwhite(10, 40),\r\n    \\modindex, 1, \r\n\t\\amp, Pseq([0.3, 0.2, 0.1, 0.05], inf),\r\n\t\\att, 0.01,\r\n\t\\rel, 0.1,\r\n\t\\pos, Pwhite(-1, 1.0)\r\n);\r\n\r\n\r\n~f = Pbind(\r\n    \\instrument, \"am1\",\r\n    \\midinote, Pseq([71, 67, 63, 60, 55, 50], inf),\r\n    \\dur, Pseq([Pn(0.5, 5),    1.5], inf),\r\n    \\amp, Pwhite(0.15, 0.2),\r\n    \\att, 0.1,\r\n    \\rel, 3,\r\n    \\modfreq, Pseq([12, 9, 7, 5, 3], inf),\r\n\t\\pos, 0\r\n);\r\n\r\n)\r\n\r\n~a.play;\r\n~b.play;\r\n~c.play;\r\n~d.play;\r\n~e.play;\r\n~f.play;\r\n\r\n(\r\n\r\n{\r\n\r\n\t~aplay = ~a.play;\r\n\t3.wait;\r\n\t~aplay.stop;\r\n\t1.wait;\r\n\t~aplay = ~a.play;\r\n\t6.wait;\r\n\t~cplay = ~c.play;\r\n\t4.wait;\r\n\t~aplay.stop;\r\n\t6.wait;\r\n\t~cplay.stop;\r\n\t~fplay = ~f.play;\r\n\t4.wait;\r\n\t~fplay.stop;\r\n\t~bplay = ~b.play;\r\n\t5.wait;\r\n\t~bplay.stop;\r\n\t1.wait;\r\n\t~fplay = ~f.play;\r\n\t4.wait;\r\n\t~fplay.stop;\r\n\t~aplay = ~a.play;\r\n\t3.wait;\r\n\t~aplay.stop;\r\n\t~fplay = ~f.play;\r\n\t1.wait;\r\n\t~fplay.stop;\r\n\t~aplay = ~a.play;\r\n\t6.wait;\r\n\t~cplay = ~c.play;\r\n\t4.wait;\r\n\t~aplay.stop;\r\n\t6.wait;\r\n\t~cplay.stop;\r\n\t~fplay = ~f.play;\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n    \r\n\t\r\n\t\r\n\t\r\n}.fork\r\n)",
   "labels" : [
      "115modulations"
   ]
}
