Rotary Phone Dials 10,000 Digits of Pi 
Saturday, August 23, 2014, 06:33
I've been spending most of my spare time lately working on my Youtube channel and creating 12 hour videos of looped sounds. Usually I'll go with space ship noise, or ambient sounds from SciFi movies, but this time I wanted to do something a little different.

I first had the idea for this when I started noticing that old rotary phones are becoming very nostalgic for people. Most everyone has now switched to using cellphones and it is only a distant memory to use a landline telephone. Rotary phones have officially entered the good-old-memory phase for a lot of people and that is clearly evident in the price a nice working rotary phone will pull on a site like Ebay (40+ bucks).

I recently found an old brown rotary phone at Goodwill and decided it would be perfect for playing all the digits of pi. I took the phone apart so that I could get a microphone closer to its internal dialing mechanism and then I made a series of recordings of playing each digit in a row. After quite a bit of trial and error I got a recording of each digit that I liked.

Next up I split each digit into .wav files so that I could feed them into this short and simple python script that I wrote:

# This script creates all the file ordering for ffmpeg
# First set up our variables

# The numbers file to read in character by character
file = 'pi1k.txt'

# The path that we want to create the files list
path = 'file \'/home/nrg/pi/\''

# The video extension that we decide upon
ext = '.mp3'

# Read in all the characters in the text file in a loop
with open(file) as f:
while True:

# Get the next character and set it to c
c = f.read(1)

# If there is no character to read break
if not c:
break

# There is no switch/cast statement in python
# So lets just be extra lazy and use if statements
if c == '1':
print path + '1' + ext
elif c == '2':
print path + '2' + ext
elif c == '3':
print path + '3' + ext
elif c == '4':
print path + '4' + ext
elif c == '5':
print path + '5' + ext
elif c == '6':
print path + '6' + ext
elif c == '7':
print path + '7' + ext
elif c == '8':
print path + '8' + ext
elif c == '9':
print path + '9' + ext
elif c == '0':
print path + '0' + ext


I fed the script a long list of digits of pi ( with the period removed ) and generated a long text file where each line specifies a wav file location corresponding to that lines digit in pi.

The only thing left to do at this point was to concatenate all the files together. Luckily ffmpeg does this quite easily with a command such as the one below:

ffmpeg -f concat -i pilines.txt -c copy 10000.wav


I then took the wav file which was produced and generated the following Youtube video with a combination of Openshot and Avidemux:

Image Removed

Pretty satisfied with how this all came out especially since it was so easy to complete this project. The hardest part by far was getting some good audio samples of the rotary mechanism on the phone.

I was beyond pleasantly shocked to see that I was featured on vice.com for this video in the following article: What the First 10,000 Digits of Pi Sound Like Dialed on a Rotary Phone

If you have any ideas for the next project I should work on please leave them in a comment below. Thanks for reading!

Comments

Administrator (Spike Snell) 
Saturday, August 22, 2015, 06:46
Actually yes James, I put up the first 10,000 digits of pi in morse code with a three hour and 14 minute video here: https://www.youtube.com/watch?v=XxQWqjGpY1Q

And then for more audible pi check out the audible pi playlist: https://www.youtube.com/playlist?list=PLsO8fxO6PnRdvbGvGbSQZUvbt9-KVlK2y

This contains such things as Count Von Count from Sesame Street reciting pi and pi being performed using the DTMF tones that are created from cellphone buttonpresses.
James 
Sunday, November 30, 2014, 22:01
So, will we be seeing the digits of Pi in Morse code soon?

Add Comment
Fill out the form below to add your own comments.









Insert Special:






Moderation is turned on for this blog. Your comment will require the administrators approval before it will be visible.