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.

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.


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......


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?