C# Computer Beeps – Mary Had A Little Lamb

While playing around in class we found out you could do computer beeps with C#. It’s actually pretty easy, all you do is a simple Console.beep(int frequency, int length).

After some playing around we managed to come up with mary had a little lamb. It wasnt that hard because someone knew the actual notes for the tune, so we just googled note frequencies, and it was easy. The only hard part was coming up with the timing, which I still dont think is perfect, but whatever.

littlelamb

All I made was a simple form with 1 button that plays the song when you press it. I have included the entire source code (solution file) which also has an .exe file in the \bin\Debug folder. So if you dont have Microsoft Visual Studio, you still should be able to hear it :)

Any comments are appreciated, ENJOY!

Download link:

killerblog-computer_beeps-Mary_had_a_little_lamb

2 Responses

  1. Jenny Says:

    What exactly is c#? Is it exactly the same as c++ or something?

  2. Alex Says:

    It’s easier than c++. You should definitely check it out.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.