Last active
January 28, 2016 22:32
-
-
Save colinbdclark/7a6115f840274b722ea4 to your computer and use it in GitHub Desktop.
Using Flocking entirely with Infusion IoC
This file contains hidden or 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("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