4
$\begingroup$

How do I play the sound of $\pi$?

There is code for the sound of random integers in $(-1,1)$.

Sound[SoundNote[#, 0.12] & /@ Accumulate[RandomInteger[{-1, 1}, 100]]]

enter image description here

I tried:

Sound[SoundNote[#, 0.12] & /@ Accumulate[RealDigits[N[Pi, 100], 2]]]

enter image description here

but it doesn't work.

$\endgroup$
  • 1
    $\begingroup$ To mimic the random integer, you could try ternary digits minus 1: Accumulate[First@RealDigits[Pi, 3, 100] - 1]] $\endgroup$ – wxffles Mar 30 '16 at 21:36
  • 1
    $\begingroup$ Sound[SoundNote[#, 0.12] & /@ Accumulate@First@RealDigits[N[Pi, 10], 2]] $\endgroup$ – Dr. belisarius Mar 30 '16 at 21:37
  • $\begingroup$ Sound[SoundNote[#, 0.12] & /@ First@RealDigits[N[Pi, 100]]] directly turns the digits into MIDI note numbers. $\endgroup$ – bill s Mar 30 '16 at 23:47
10
$\begingroup$

Here's how to "dial" the digits of $\pi$ on a touch tone phone (code adapted and modernized from an old Mathematica demo, but see this as well):

touchToneList = Tuples[{{697, 770, 852, 941}, {1209, 1336, 1477}}];
playTouchTone[phonenumber : {__Integer}] := Play[Evaluate[Piecewise[
    MapIndexed[{Total[Sin[2 π touchToneList[[#1]] t]],
                First[#2]/5 - 0.2 < t < First[#2]/5 - 0.1} &, 
               Mod[phonenumber, 11, 1]]]], {t, 0, Length[phonenumber]/5}]

playTouchTone[First[RealDigits[π, 10, 12]]]

dialing pi

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.