DEV Community

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

Posted on

13 4 5 7 6

Happy Pi Day! I made a Pi-ano 😆

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!

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (42)

Collapse
 
rollcode22 profile image
Roll Code

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

Collapse
 
best_codes profile image
Best Codes

🤣

Collapse
 
best_codes profile image
Best Codes

What are you all doing for Pi day?

Collapse
 
bretbernhoft profile image
Bret Bernhoft

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

Collapse
 
best_codes profile image
Best Codes

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

Happy π day!

Thread Thread
 
bretbernhoft profile image
Bret Bernhoft

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!

Thread Thread
 
best_codes profile image
Best Codes

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

Thread Thread
 
bretbernhoft profile image
Bret Bernhoft

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.

Thread Thread
 
best_codes profile image
Best Codes

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

Thread Thread
 
bretbernhoft profile image
Bret Bernhoft

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.

Thread Thread
 
best_codes profile image
Best Codes

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 😂

Thread Thread
 
bretbernhoft profile image
Bret Bernhoft

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!

Thread Thread
 
best_codes profile image
Best Codes

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 🙃

Collapse
 
alt_exist profile image
Alternate Existance

eating pi

Collapse
 
best_codes profile image
Best Codes

😂

Collapse
 
robbenzo24 profile image
Rob Benzo

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

Collapse
 
best_codes profile image
Best Codes

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

Collapse
 
robbenzo24 profile image
Rob Benzo

lol

Collapse
 
adrian_11444490b66513360d profile image
Tnt kaboom

Guess this makes you a pi-grammer

Collapse
 
best_codes profile image
Best Codes

I hope not, pi is irrational

Collapse
 
amtrakguy2 profile image
AmtrakGuy2

To be, fair the song is pi-rational 😅

Thread Thread
 
best_codes profile image
Best Codes

Ins-pi-rational 💀

Thread Thread
 
amtrakguy2 profile image
AmtrakGuy2

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

Thread Thread
 
best_codes profile image
Best Codes

You really went off on a tangent there.

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

Thread Thread
 
amtrakguy2 profile image
AmtrakGuy2

I hate algebra 😅

Thread Thread
 
best_codes profile image
Best Codes

Aren't tangents trigonometry though 🧐

Thread Thread
 
amtrakguy2 profile image
AmtrakGuy2

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

Thread Thread
 
best_codes profile image
Best Codes

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

Thread Thread
 
amtrakguy2 profile image
AmtrakGuy2

I actually learned about pi in pre-algebra!

Thread Thread
 
best_codes profile image
Best Codes

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

Collapse
 
pengeszikra profile image
Peter Vivo

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:

Collapse
 
best_codes profile image
Best Codes

Interesting.
Happy late π day! 😀

Collapse
 
mileswk profile image
MilesWK

Awesome! I love this!

Collapse
 
best_codes profile image
Best Codes

Thank you for reading, glad you enjoyed it! 🙌

Collapse
 
amtrakguy2 profile image
AmtrakGuy2

Broooooo the title of the posttttttttttt 💀

Collapse
 
best_codes profile image
Best Codes

😆
Thanks for reading

Collapse
 
alt_exist profile image
Alternate Existance

the pi-ano is cool haha :)

Collapse
 
best_codes profile image
Best Codes

Glad you liked it 🤓

Collapse
 
shricodev profile image
Shrijal Acharya

This is cool, buddy. Love it. 🔥

Collapse
 
best_codes profile image
Best Codes • Edited

Thank you! Happy π day ❤️

Collapse
 
inshot_pro profile image
inshot video editor

what can be starting price of pi on binanace

Collapse
 
best_codes profile image
Best Codes • Edited

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

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay