MACCHINA I
August 2012 | By 5013
Collection:
An infinitely random music box. Built using the latest and greatest Web Audio API technologies! ... which means that it only works on Chrome/Chromium. Sorry, Mozilla guys! Also it won't work on Safari either --even on nightlies-- as Safari can't play OGG files. I'm working on all this.
When MACCHINA I starts, it will choose a musical scale at random, and compose a short song with it, using 8 patterns with 8 voices. When it has played the song 8 times, it will compose another song, and play it again 8 times, while showing a visualisation of the currently played pattern.
It can work that way forever, or you can move the mouse over the window to make a little overlay slide down, and click over the 'randomise' option, which will then make MACCHINA I choose another scale and compose a song again.
Technically speaking, the core of this experiment is Sorollet.js, an [unfinished] port of my C++ VSTi instrument Sorollet which I have carefully handcrafted into Javascript code. No automatic conversions! It's then embellished with a little bit of reverb thanks to the built in convolution engine in the Web Audio API. The visualisation uses a mix of plain HTML elements and Canvas.
Several additional libraries/polyfills are used too:
- EventTarget.js by mr.doob (for creating and using custom events, DOM events style)
- Tween.js by me and a lot more of people (for tweening!)
- and the mighty famous RequestAnimationFrame.js script