Skip to content

Instantly share code, notes, and snippets.

@colinbdclark
Created July 5, 2013 16:46
Show Gist options
  • Save colinbdclark/5935779 to your computer and use it in GitHub Desktop.
Save colinbdclark/5935779 to your computer and use it in GitHub Desktop.
Synth and orchestra sharing and making IoC references within a synthDef.
fluid.defaults("colin.sinSynth", {
gradeNames: ["flock.synth", "autoInit"],
synthDef: {
ugen: "flock.ugen.sinOsc",
freq: 440,
mul: 0.25
}
});
fluid.defaults("nanook.grainSynth", {
gradeNames: ["flock.synth", "autoInit"],
synthDef: {
ugen: "flock.ugen.granulator",
numGrains: {
ugen: "flock.ugen.line",
start: 1,
end: 10,
duration: 20
},
grainDur: 0.05,
delayDur: 5,
mul: 0.5
}
});
fluid.defaults("colin.orchestra", {
gradeNames: ["fluid.littleComponent", "autoInit"],
components: {
synth1: {
type: "colin.sinSynth"
},
synth2: {
type: "colin.sinSynth",
options: {
synthDef: {
freq: 640
}
}
}
}
});
fluid.defaults("nanook.orchestra", {
gradeNames: ["colin.orchestra", "autoInit"],
components: {
grain: {
type: "nanook.grainSynth",
options: {
synthDef: {
source: "{sinSynth}.synthDef"
}
}
}
}
});
var orc = nanook.orchestra();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment