

M  A  C  C  H  I  N  A    I

A generative music experiment - right in your browser!



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.

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 (http://5013.es/p/3) 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

I've left the code uncompressed and unpacked just so you can have a look at it, see how it works and maybe learn something (either bad or good), which I guess it's the whole point of the demojs event!

Also, to run this offline you'll need to either enable Chrome's local file access, or copy the contents to a local web server, as it uses XMLHttpRequest for loading data. To launch Chrome with local file access use the --allow-file-access-from-files command line switch.

The online version is here:
http://5013.es/toys/macchina/


Hope you like it!

5013 (also known as sole/xplsv ;-))

http://5013.es
http://xplsv.com
