Skip to content

Instantly share code, notes, and snippets.

@colinbdclark
Last active January 28, 2016 22:32
Show Gist options
  • Save colinbdclark/7a6115f840274b722ea4 to your computer and use it in GitHub Desktop.
Save colinbdclark/7a6115f840274b722ea4 to your computer and use it in GitHub Desktop.
Using Flocking entirely with Infusion IoC
fluid.defaults("flock.test.muzak", {
gradeNames: "fluid.component",
components: {
enviro: {
type: "flock.enviro"
},
scheduler: {
type: "flock.scheduler.async",
options: {
components: {
synthContext: "{muzak}.rock"
},
score: [
{
interval: "repeat",
time: 1.0,
change: {
values: {
"osc.freq": {
synthDef: {
ugen: "flock.ugen.lfNoise",
freq: 1,
mul: 220,
add: 260
}
}
}
}
}
]
}
},
rock: {
type: "flock.synth",
options: {
enviro: "{muzak}.enviro",
synthDef: {
id: "osc",
ugen: "flock.ugen.sinOsc",
freq: 220
}
}
}
},
listeners: {
onCreate: [
"{that}.enviro.play()",
"{that}.scheduler.once(10, {that}.destroy)"
]
}
});
var muzak = flock.test.muzak();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment