Created
July 5, 2013 16:46
-
-
Save colinbdclark/5935779 to your computer and use it in GitHub Desktop.
Synth and orchestra sharing and making IoC references within a synthDef.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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