Happy Pi Day! I made a Pi-ano 😆
Best Codes

Best Codes @best_codes

About: I love coding, 3D designing, and listening to music. I'm currently a fanatic about Rust, TypeScript, and Next.js. Christian, Coder, Creator

Location:
Earth
Joined:
Oct 24, 2023

Happy Pi Day! I made a Pi-ano 😆

Publish Date: Mar 14
37 49

Happy Pi Day! 🥳
March 14th (3/14) is the day we celebrate everyone's favorite never-ending number: π. To celebrate, I made a Pi-ano. You're probably wondering what that is. Well, let's see! 🎹

Introducing the Pi-ano 🎶

The Pi-ano does exactly what it sounds like — it calculates digits of pi and plays a note for each one; it's a piano controlled by pi! Each digit (0-9) is mapped to a different note, so as Pi unfolds, it creates a completely unique melody.

How It Works

  • The program continuously computes digits of Pi.
  • Each digit corresponds to a note, and the note is played on your speaker.
  • It's basically a never-ending, math-powered concert.

Here's a quick demo. Don't get your hopes up, the song isn't that great:

Try It Yourself!

Want to hear Pi sing? You can check out the code and play around with it here:

https://github.com/The-Best-Codes/bestcodes-react-site/tree/main/app/math/pi-ano

More Pi Day Fun

Of course, Pi Day isn't just about weird musical experiments. It's a great excuse to eat pie. 🥧
What's your favorite kind of pie? (I don't have a favorite, I like all of them!)

How are you celebrating Pi Day? Let me know in the comments!

Comments 49 total

  • Best Codes
    Best CodesMar 14, 2025

    What are you all doing for Pi day?

    • Alternate Existance
      Alternate ExistanceMar 14, 2025

      eating pi

    • Bret Bernhoft
      Bret BernhoftMar 14, 2025

      Working on a Raspberry Pi quantified-self project. Building electronics has been a lot of fun and eye-opening.

      • Best Codes
        Best CodesMar 14, 2025

        Yep, I've got a Raspberry Pi too! Do you have a Pi 5? I've heard they're awesome!

        Happy π day!

        • Bret Bernhoft
          Bret BernhoftMar 14, 2025

          I do have a RPi 5, which is a true computing powerhouse. It processes updates and Python instructions like a champ.

          Happy π day do you as well!

          • Best Codes
            Best CodesMar 14, 2025

            Wow, do you have the 16 GB RAM one? I was just looking on the website and they seem to have improved a lot since the Pi 3

            • Bret Bernhoft
              Bret BernhoftMar 14, 2025

              I have the 8 GB model, and rarely use more than 10% of the available RAM. The advertised use case for the 16 GB model is as a tool among top power users. It would be interesting to see the types of applications which require that much RAM on the RPi 5. I would think those users would primarily be business and industrial customers?

              And indeed, these little computers have been transformed since the Raspberry Pi 3 model was released. Model 5 includes hyper-optimization and a bunch of new hardware features.

              • Best Codes
                Best CodesMar 14, 2025

                I can see where 16 GB would be good for running AI models locally and stuff. It would be nice to have a local mini-AI server. I wonder if the Pi 5 has a GPU...

                • Bret Bernhoft
                  Bret BernhoftMar 14, 2025

                  I could see that as well. The requirements for running an AI model on one's computer are dropping fast. Right alongside a growth in computing power and capacity.

                  I know from having recently updated my RPi 5, there is NVIDIA code running on the computer. So my guess would be yes, the Raspberry Pi 5 has a GPU of some sort.

                  • Best Codes
                    Best CodesMar 14, 2025

                    Even on the Pi 3, I can already run Gemma 3 with Ollama. I bet it's really fast on the Pi 5.
                    Also, I did some research, and it looks like there is a GPU on the Pi 5, but I don't think it's a dedicated one. Apparently you can connect an external one somehow?

                    Now I want a Pi 5 😂

                    • Bret Bernhoft
                      Bret BernhoftMar 14, 2025

                      You can indeed connect an external GPU to the RPi 5. Such as in this YouTube video from Jeff Geerling. It is difficult to imagine what will be possible with the Raspberry Pi 6!

                      • Best Codes
                        Best CodesMar 14, 2025

                        Wow, thanks for sharing! You should make a DEV post about Pis, you know so much about them haha. I would read it for sure 🙃

  • Rob Benzo
    Rob BenzoMar 14, 2025

    I have one thing to say:

    o

    Let me show you my reasoning:
    pi = 3.141592
    Leviticus = 3rd book
    So look in Leviticus 14:15. Find the 9th word in the verse and get its 2nd letter.

    15: And the priest shall take some of the log of oil...

    and you get o, so thats what i have to say.


    just kidding, great post as always :P

    • Best Codes
      Best CodesMar 14, 2025

      You had me confused for a second 🤣
      Glad you enjoyed it!

  • Alternate Existance
    Alternate ExistanceMar 14, 2025

    the pi-ano is cool haha :)

  • Tnt kaboom
    Tnt kaboomMar 14, 2025

    Guess this makes you a pi-grammer

    • Best Codes
      Best CodesMar 14, 2025

      I hope not, pi is irrational

      • AmtrakGuy2
        AmtrakGuy2Mar 14, 2025

        To be, fair the song is pi-rational 😅

        • Best Codes
          Best CodesMar 14, 2025

          Ins-pi-rational 💀

          • AmtrakGuy2
            AmtrakGuy2Mar 14, 2025

            God dammit I didn't think anybody would get it 😂

            • Best Codes
              Best CodesMar 14, 2025

              You really went off on a tangent there.

              (I hope you know something about pi, circles, and tangents, or you won't get it)

              • AmtrakGuy2
                AmtrakGuy2Mar 15, 2025

                I hate algebra 😅

                • Best Codes
                  Best CodesMar 15, 2025

                  Aren't tangents trigonometry though 🧐

                  • AmtrakGuy2
                    AmtrakGuy2Mar 15, 2025

                    Fun fact: They apply to both trigonometry AND algebra! 🤓

                    • Best Codes
                      Best CodesMar 15, 2025

                      I think it's most relevant in trig, but okay 🤓

                      • AmtrakGuy2
                        AmtrakGuy2Mar 16, 2025

                        I actually learned about pi in pre-algebra!

                        • Best Codes
                          Best CodesMar 16, 2025

                          I was talking about tangents, not pi. I don't remember when I learned pi, probably before algebra

                          • AmtrakGuy2
                            AmtrakGuy2Mar 17, 2025

                            Ahhh yes tangents. I talked about those in geometry

                            • AmtrakGuy2
                              AmtrakGuy2Mar 18, 2025

                              We really went full circumference there! (I know I know I am terrible 😂)

  • AmtrakGuy2
    AmtrakGuy2Mar 14, 2025

    Broooooo the title of the posttttttttttt 💀

  • Shrijal Acharya
    Shrijal AcharyaMar 14, 2025

    This is cool, buddy. Love it. 🔥

    • Best Codes
      Best CodesMar 14, 2025

      Thank you! Happy π day ❤️

  • Roll Code
    Roll CodeMar 14, 2025

    Fun post! Don't eat too much pie, though, or you'll end up with a big circumference. 🫠

  • MilesWK
    MilesWKMar 14, 2025

    Awesome! I love this!

    • Best Codes
      Best CodesMar 14, 2025

      Thank you for reading, glad you enjoyed it! 🙌

  • Peter Vivo
    Peter VivoMar 15, 2025

    Thx for a music experiment of π!

    My music about PI is based on a small sci-fi theory: Based on a series of 42 marker distances in π lead a groundbreaking theoretical exploration.
    There is a song about this theory:

    • Best Codes
      Best CodesMar 15, 2025

      Interesting.
      Happy late π day! 😀

  • RheaLarson01
    RheaLarson01Mar 15, 2025

    This is a really simple method to keep making money. There are a lot of ways I can earn money from home richjob2.com

  • RheaLarson01
    RheaLarson01Mar 15, 2025

    Fun post! Don't eat too much pie, though, or you'll end up with a big circumference. 🫠

  • АнонимMar 16, 2025

    [hidden by post author]

    • Best Codes
      Best CodesMar 16, 2025

      I have no clue what this means. ChatGPT says it's a trading network? 🤷

  • sara
    saraMar 17, 2025

    best website for my math teacher XD i think its her fav XD but good tho i love it as a beginner

    • Best Codes
      Best CodesMar 17, 2025

      Thanks for reading, glad you liked it 🙌

Add comment