I get Make Magazine and from time to time find something that peaks my (software related) curiosity. This time it was an article about making synthesized music from data using the algorithms from Dr Jonathan Middleton’s Music Algorithms website – http://musicalgorithms.ewu.edu/
Basically this takes a sequence of numbers, scales it to a pitch range you select, gives you options for translating pitch – e.g. scale backwards, replace specific notes with another note, use division or modulo arithmetic, etc – and then gives you options for applying a duration to each note – either a fixed duration or using a scaling formula.
Finally you have the option to play it, download it as a MIDI file or see it in a crude representation of notation.
There are a number of ‘preset’ options to get you going – I experimented listening to pi, the Fibonacci sequence and their ‘chaos algorithm‘ using ranges of 0 to 88 (a full piano range) and 40 to 52 (basically an octave starting from middle C). I tended to use a fixed duration of 0 or 1 as it went by suitably quickly and kept things interesting.
Then I thought I’d try something a little different. Using the option to ‘import your own sequence’ I took a wander over to Google Trends. This plots the frequency of people searching for specific terms over time. If you login with your Google account you can download the results as a CSV and then its trivial to open it in a spreadsheet, select the column of results and paste it into the Music Algorithms form and listen to what something sounds like.
For my own entertainment, I had a listen to the following:
- Default ‘swine flu‘ search that Google Trends offers. This works well scaled 0 to 88, as the pitch then mirrors the graph quite well. I didn’t paste in all the zeros, just the portion with the shape and got a nice quickly peaking and decaying piece.
- Facebook is a good one … it goes from continuous low through a slowly rising scale, increasing in pitch and frequency of change as time moves on, finally tinkling along in the high register as search frequency fluctuates. This would be a really interesting one to do with number of users, scaling from Mark Zuckerberg as #1 up to user 1 billion …
- Considering the date, Halloween was an interesting one – you get a random sounding very quickly rising and falling scale and then silence … the ration of silence to scale is around 1 in 12 funnily enough and the pattern repeats 8 times (for 2004 to the present day) … this works well with a duration of 0 across the full piano range – nice and quick.
- The text ‘music algorithms‘ generated a curious pattern – reasonably random around a specific value, but that value has slowly decayed over time.
- Then I tried a whole range of whatever came into my head looking for an interesting graph – seeing fluctuating searches, lots of rising trends – then finally settled on Tim Berners-Lee. Not sure why! But that gives a nice, angry sounding (especially on duration zero) left-hand piano line for the majority of the data set, generally getting slightly lower, adding to the angry nature, until there is a quick high flourish representing him appearing in the Olympics opening ceremony!
I only played the MIDI files back using the standard instrument, i.e. a basic piano sound. It would be really interesting to actually use some of these data sets to define a synthesized timbre too. Could be the start of a very interesting musical piece.
What would be really interesting is to hook it up live to some Google or other Internet stats and then allow you to hear what is going on, say on Twitter. A bit like a musical version of The Listening Post. Maybe that could be a job for my Raspberry Pi …