Last active
November 9, 2015 22:25
-
-
Save colinbdclark/504367dd05859f8d4731 to your computer and use it in GitHub Desktop.
Using a ConvolverNode with Flocking
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
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