Skip to content

Instantly share code, notes, and snippets.

@colinbdclark
Last active August 29, 2015 13:56
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save colinbdclark/9179042 to your computer and use it in GitHub Desktop.
Wiring Flocking up to Web Audio nodes
flock.init();
var as = flock.enviro.shared.audioStrategy;
// Create the new gain node and set some parameters on it.
var gainNode = as.context.createGain();
gainNode.gain.setValueAtTime(0.0, as.context.currentTime);
as.insertOutputNode(gainNode);
// Start up a new synth.
var synth = flock.synth({
synthDef: {
ugen: "flock.ugen.sin",
mul: 0.1
}
});
// And schedule some audio params on the gain node.
gainNode.gain.linearRampToValueAtTime(1.0, as.context.currentTime + 10);
gainNode.gain.linearRampToValueAtTime(0.0, as.context.currentTime + 20);
synth.play();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment