{
   "code" : "(\r\nNdef(\\a, {\r\n\tvar fundFreqs, ratios, levels, snd;\r\n\r\n\tfundFreqs = [730, 150];\r\n\r\n\tratios = [\r\n\t\t// carrier(modulator_1(modulator_2))\r\n\t\t[1, 3, 5], // one layer\r\n\t\t[2, 3, 9]  // independent other layer\r\n\t];\r\n\tlevels = [\r\n\t\t[1, 0.5, 0.3],\r\n\t\t[0.8, 0.5, 0.3]\r\n\t];\r\n\t\r\n\tsnd = [fundFreqs, ratios, levels].flop.collect{|v|\r\n\t\tvar fundFreq, ratios, levels;\r\n\t\t#fundFreq, ratios, levels = v;\r\n\t\t\r\n\t\t// create stacked modulators\r\n\t\t// start with innermost modulator\r\n\t\tratios = ratios.reverse;\r\n\t\tlevels = levels.reverse;\r\n\t\t\r\n\t\t[ratios, levels].flop.inject(0, {|prev, vals|\r\n\t\t\tvar ratio, level;\r\n\t\t\t#ratio, level = vals;\r\n\t\t\t\r\n\t\t\t// \"r: % \\t l: % \\t %\".format(ratio, level, prev).postln;\r\n\t\t\tSinOsc.ar((fundFreq * ratio) + (prev * fundFreq), mul: level)\r\n\t\t}).postln\r\n\t};\r\n\tsnd = Mix(snd);\r\n\t\r\n\tsnd!2\r\n})\r\n)\r\n\r\nNdef(\\a).edit",
   "is_private" : null,
   "id" : "1-5cU",
   "labels" : [
      "fm",
      "template"
   ],
   "ancestor_list" : [],
   "description" : "Template to create a 2x3 FM Synth. There are two independent FM synths, of type `car(mod1(mod2))`.\r\nThis is intended to be a starting point for further exploration.",
   "author" : "LFSaw",
   "name" : "Simple FM template"
}
