0.0.2 • Published 8 years ago

@fand/sampler-node v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

sampler-node

An easy sampler AudioNode.

Example

import SamplerNode from '@fand/sampler-node';

const audioContext = new AudioContext();
const samplerNode   = new SampleNode([
    '//example.com/kick.mp3',
    '//example.com/snare.mp3',
]);

sampleNode.connect(audioContext.destination);

// BOOM BOOM POW
setInterval(() => {
    samplerNode.noteOn(0, 0);
    samplerNode.noteOn(0, 250);
    samplerNode.noteOn(1, 500);
}, 1000);

LICENSE

MIT