Thursday, March 04, 2010

The Music Of Pi

I have an amazing world first to announce! And even better, one that you can experience!

In the afternoon I modified my music software NoiseStation II, adding to it the facility to import and export notes in text form. There are two formats, the most useful perhaps being the "gap, note, gap, note," where "gap" is the spacing in "ticks" (typically that is 48 for one beat) and "note", the note pitch in cents where 50 is C octave zero, so 150 is C-sharp, 250 is D, 1250 is C octave 1 etc. etc. so a tune of three notes might look like "48,350,48,150,48,850."

That allows me to write software to generate and process music, and quickly import it into my sequencer for high quality rendering. It's something I've planned to do for years but never got round to it. I have developed an elaborate algorithm to analyse existing pop songs and write new ones that are similar to those input. Now that becomes easier.

Now for the premiere!

My impetus for today's programming was an idea to write an album of music based on transcendental numbers, and I wanted to hear the most famous of all, the number pi. My first task will be to convert these numbers into base twelve. Decimal is not appropriate for a musical scale. I don't know enough about maths to do it unfortunately, but some eager scientist has published on the Internet the first few digits of pi in base twelve. With that it was easy to convert it and import it into NoiseStation, and so, for probably the first time, you can hear the first few digits of pi absolutely correctly, in base twelve over one octave played in a sine wave.

http://www.cornutopia.co.uk/temp/MarkSheeky-Pi.mp3

I need mathematical help to produce an algorithm, or even a very long list of digits, for pi, e, and other interesting numbers in base twelve.

This album is on my "to do" list for 2010 and will be highly experimental.

5 comments :

John Salmon said...

Mark, use the WolframAlpha Computational Knowledge Engine to convert pi to base 12. It's an excellent resource for all things mathematical. What you are doing sounds very interesting.

John Salmon said...

I just got this but you can go on and on......

3.184809493b918664573a6211bb151551a05729290a7809a492742140a60a55256a0661a03753a3aa54805646880181a3683083272bbba0a370b12265529a828903b4b256b8403759a71626b8a54687621849b849a8225616b442796a31737b229b2391489853943b8763725616447236b027a421aa17a38b52a18a838b015..._12

Mark Sheeky said...

Brilliant John! Have you got a link to that??

Mark Sheeky said...

Ah yes, got it. I remember trying Wolfram Alpha when it was in beta and I had totally forgotten about it. It seems I can only get the first 1022 digits at most... but that's better than what I had, and I can try other bases. Thanks again for the pointer!

Dan Kent said...

OK, folks, this is all way beyond me, but I like the sound. It sounds Harry Potterish - mysterious.

Now if I just didn't bring this discussion way down into the dirt, hmm?