Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Simple FM template
name
code content
( Ndef(\a, { var fundFreqs, ratios, levels, snd; fundFreqs = [730, 150]; ratios = [ // carrier(modulator_1(modulator_2)) [1, 3, 5], // one layer [2, 3, 9] // independent other layer ]; levels = [ [1, 0.5, 0.3], [0.8, 0.5, 0.3] ]; snd = [fundFreqs, ratios, levels].flop.collect{|v| var fundFreq, ratios, levels; #fundFreq, ratios, levels = v; // create stacked modulators // start with innermost modulator ratios = ratios.reverse; levels = levels.reverse; [ratios, levels].flop.inject(0, {|prev, vals| var ratio, level; #ratio, level = vals; // "r: % \t l: % \t %".format(ratio, level, prev).postln; SinOsc.ar((fundFreq * ratio) + (prev * fundFreq), mul: level) }).postln }; snd = Mix(snd); snd!2 }) ) Ndef(\a).edit
code description
Template to create a 2x3 FM Synth. There are two independent FM synths, of type `car(mod1(mod2))`. This is intended to be a starting point for further exploration.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change