WHAT DOES PI SOUND LIKE? What does a mathematical number sound like? Is it musical, does it have a melody? This is what I wanted to explore, how does a famous mathematical number sound. Having worked with the Raspberry Pi at Picademy I was introduced to Sonic Pi 2, it seemed logic to pick Pi as the value. Pi as you will know is and infinite number and although possible to program every value I would never complete it! I decided to limit Pi to 10 decimal places. 3.1415926535.
1. What Does Pi Sound Like?My first step was to assign a musical note to each of the separate digits in Pi. I initially started at note E as this is the first note on the first musical stave, I then assigned the values, E = 1, F = 2, G = 3, A = 4, B =5, C = 6, D = 7, E =8, F = 9. I looked up the MIDI values for each note and then using Sonic Pi 2 I coded each of the notes in the order 3 1415926535. So the note E had a value of 52 and F 53. I added a sleep(1) between each note to ensure that they played separately -
Original Code:
# Welcome to Sonic Pi v2.0 #3.14159265359 first attempt from note E #MIDI E52 F53 G55 A57 B59 C60 D62 E64 F65 #Position 1=52, 2=53, 3=55, 4=57, 5=59, 6=60, 7=62, 8=64, 9=65 use_synth :mod_saw 2.times do play 55 #3 sleep(1) play 52 #1 sleep(1) play 57 #4 sleep(1) play 52 #1 sleep(1) play 59 #5 sleep(1) play 65 #9 sleep(1) play 62 #2 sleep(1) play 60 #6 sleep(1) play 59 #5 sleep(1) play 55 #3 sleep(1) play 59 #5 sleep(1) play 65 #9 sleep(1) end |
|