Skip to content

Instantly share code, notes, and snippets.

@colinbdclark
Last active November 9, 2015 22:25
Show Gist options
  • Save colinbdclark/504367dd05859f8d4731 to your computer and use it in GitHub Desktop.
Save colinbdclark/504367dd05859f8d4731 to your computer and use it in GitHub Desktop.
Using a ConvolverNode with Flocking
var context = flock.environment.audioSystem.context;
var convolver = flock.environment.audioSystem.nativeNodeManager.createOutputNode({
node: "Convolver",
normalize: true
});
flock.synth({
synthDef: {
ugen: "flock.ugen.filter.moog",
source: {
ugen: "flock.ugen.saw",
freq: 220,
mul: {
ugen: "flock.ugen.asr",
attack: 0.1,
release: 0.05,
gate: {
ugen: "flock.ugen.mouse.click"
}
}
}
}
});
flock.audio.decode({
src: "http://thingsinjars.com/lab/web-audio-tutorial/Church-Schellingwoude.mp3",
success: function (bufDesc) {
convolver.buffer = flock.bufferDesc.toAudioBuffer(context, bufDesc);
},
error: function (err) {
console.log("There was an error while trying to load the convolver’s impulse reponse audio file.", err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment