soundbank
A collection of triggerable Web Audio API audio slots, supporting audio routing, midi input and value providers.
For helping create grid based (launchpad/monome) sound launchers.
Used as the sound engine in Loop Drop.
Install
$ npm install soundbank
API
var Soundbank =
Soundbank(audioContext)
Returns a soundbank AudioNode instance that can be connected to other AudioNodes.
soundbank.update(descriptor)
Update the slot with the specified descriptor.id
to match the specified params. Use this to add or update slots (to remove slot, just wipe out all of its attributes with soundbank.update({id: 'SLOT_ID'})
)
soundbank.triggerOn(id, at)
soundbank.triggerOff(id, at)
soundbank.choke(id, at)
soundbank.getDescriptor(id)
Return the slot descriptor at specified id
.
soundbank.getDescriptors(
Returns an array of all slot descriptors.
Example
var Soundbank = var Bopper = var audioContext = // choose your nodes: audioContextproviders = inherit: scale: audioContextsources = oscillator: sample: audioContextprocessors = gain: audioContextcreateGain filter: audioContextcreateBiquadFilter delay: dipper: overdrive: audioContextmodulators = lfo: adsr: // add a scheduler - required for 'lfo'audioContextscheduler = // initialize soundbankvar soundbank = soundbank // add some sounds to the slotssoundbank // distribute an oscillator across a musical scalesoundbanksoundbanksoundbank // now if any changes are made to the original slot, they will // also be applied to any slots that inherit from it