Created
June 14, 2014 01:55
-
-
Save colinbdclark/7dcd5fd6ba5470fa72b0 to your computer and use it in GitHub Desktop.
Minimal declarative MIDI example
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
window.midiBand = flock.band({ | |
components: { | |
synth: { | |
type: "flock.synth", | |
options: { | |
synthDef: { | |
id: "carrier", | |
ugen: "flock.ugen.sinOsc", | |
freq: 440, | |
mul: { | |
id: "mod", | |
ugen: "flock.ugen.sinOsc", | |
freq: 1.0, | |
mul: 0.25 | |
} | |
} | |
} | |
}, | |
midiConnection: { | |
type: "flock.midi.connection", | |
options: { | |
openImmediately: true, | |
ports: { | |
input: { | |
name: "slider/knob" | |
} | |
}, | |
listeners: { | |
control: { | |
func: "{synth}.set", | |
args: { | |
"carrier.freq": "@expand:flock.midiFreq({arguments}.0.value)" | |
} | |
} | |
} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment