

For those of you who don’t know much about Mathematica all you need to do to create a list of ANYTHING is separate them by commas and wrap the whole thing in curly braces So far so good – I have a way of playing any integer I choose but I need to be able to play a list of notes if I am going to convert Pi to music. So to play a middle C just evaluateĪ little interface appears that looks like the graphic above and when you click the play button (represented by a triangle) you will hear a piano sample at middle C that lasts for one second. The way to do this is by wrapping a SoundNote expression with Sound. So far so good but I don’t want to just represent the notes symbolically – I want to actually play them. You can also use negative numbers so that SoundNote is one semi-tone below middle C for example. Middle C is represented by SoundNote, one semi-tone above middle C is SoundNote, a whole tone above Middle C is SoundNote and so on. This is my first attempt at a tutorial in a blog post so feedback would be welcomed.įrom the help browser I discovered that you can represent a note in Mathematica using SoundNote. I am going to present the rest of this post as a tutorial, with Mathematica commands in bold followed by the output in normal tyle. Although I knew that Mathematica had sound capabilities I had never used them before so the help browser (as usual) was indispensable. So I fired up my copy of Mathematica, plugged in some headphones (I was fairly sure that my fellow commuters would not appreciate the music of Pi as much as I) and set to work.

On the train journey home from work I thought that I might be able to get Mathematica to produce simplified versions of these sort of compositions without too much effort. This was picked up by another blog I discovered recently (thanks to the carnival of mathematics) where the author asked if anyone else would mind producing similar compositions based on other mathematical constants. In a recent post over at 360 the author was discussing how Joe Turner (a prof of musical composition) has formed a musical composition based on the expansion of Pi in base 12 and it sounds pretty good considering the fact that it is based on a random sequence.
