Gibber.lib is a standalone JavaScript library that lets you use Gibber commands and syntax inside of any webpage. You can also use it inside of Node.js via the excellent web-audio-api module by Sebastien Piquemal.
Below is a simple example using Gibber.lib in a standard HTML page to start a bass line and drum loop playing.
For client-side use with HTML, Gibber.lib uses browserify to wrap everything into a single HTML file. When minimized, this file is ~166 KB in size.
Using with Node.js
You can install it for node using a node packaged module. If you have node installed it only takes a few lines of code to test out the same Gibber code that’s in the the HTML code above:
npm install web-audio-api npm install gibber.lib npm test gibber.lib
To use the libraries, simply place your .js file in the same directory as the node_modules folder containing the web-audio-api and gibber.lib modules. Then start the .js file with the following:
AudioContext = require('web-audio-api').AudioContext Gibber = require('gibber.lib') Gibber.init()
AudioContext and Gibber currently both need to be global objects; I might try to clean this up in the future. Once you have those three lines of code you can start freely gibbering underneath.