Macchina I

Generative music box. Experience endless algorithmically built textures, right in your browser!

In exclusive for DemoJS 2012 (Paris, 29-30th June)

Flattr this

Some background and nifty technical details

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

Fallback video, in case you cannot run it in your browser:

Please note that the compositions are generated each time the machine is started, and as such the video is just a sample of what you could get.