Hum-drum
Little library for generating music using the WebAudio API. Doesn't do anything special (in fact there are a lot better versions of things like this out there) but this was a good learning excerise. I created this for my JS13K 2017 game (which I never finished 😢)
Disclaimer: still a work in progress!
Example usage
; /** * 100 bpm * 16 ticks per look */let track = 100 16; // create the drun tracklet snare = 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0;let bass = 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0;let hh = 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0;let data = snare: snare bass: bass hiHat: hh let midNotes = 'c' '' '' '' '' '' 'a#' 'c' '' 'f' 'g' 'a#' 'c' 'g' '' '';let bassNotes = 'c' 'c' 'c' '' 'c' 'a#' 'a#' 'a#' 'a#' '' 'c' 'a#' 'f' 'f' 'f' 'f'; track // key, data, start, loop // key, data, start, loop, pitch ; window;