An API for building audio-unit-generators in Node.js
ISC License
unitgen is a Node.js powered unit-generator API, built using streams and the speaker bindings.
unitgen was built for a demo being given at Dance.js.
Unit generators are best thought of as a graph of transformations applied to an audio-stream.
This can be used to:
npm install unitgen -g
So that you can get an idea of unitgen in action, we've provided a few sample unit-generator-graphs.
For each example, use a
and s
to pan back and forth.
function
unit-generator to play a sine-wave which can be panned between the left and right speaker.unitgen stereo
combiner
, and two function
unit-generators to play two inverse sine-waves. Pan back and forth to hear them cancel out.unitgen canceling
combiner
, and two sound-file
unit-generators to pan between two songs.unitgen mixer --track1=./foo.wav --track2=./foo2.wav
unitgen is a rough proof of concept. Over time we'd love to see this grow into a full-featured API for building (as a practical example) mixers in JavaScript.
patches welcome!