I’ve done a little bit of work making sure Gibber can play nice with p5.js. Mostly refactoring Gibber.lib and then wrapping it to support both the global and “instance mode” styles of programming found in p5.
Examples:
- simple template
- FFT music visualization
- cellular automata
- modulation + waveform viz
- modulation ii
- simple instance mode template
These sketches are also organized in a collection on the p5.editor website. You can also
download examples and library to play with.
Below is the first example listed, a completesketch.js
file that starts a drum loop playing and changes the background color based on current amplitude.
function setup() { createCanvas( windowWidth, windowHeight ) drums = EDrums('x*o*x*o-') follow = Follow( drums ) } function draw() { background( follow.getValue() * 255 ) }
You can also find p5.gibber.js on github and on npm.
Note that Gibber’s manual was written for the coding environment, not this standalone library. However, all the audio code in chapters 3 and 4 and all code in chapters 5-7 will still work with the standalone library. One note is that currently the Drums object (which uses samples) is not supported in the library; use the EDrums object (which uses synthesis) instead.