Once in the Turbo C++ , running on dos, which they still use to teach C in colleges, I came across this functions in
sound(<freq>): to make sound of a specified frequency
delay(<time>): delay in milliseconds
nosound(): stop sound
These could be used to make my own tunes!
I had learned to play the guitar in school years. Even though I suck at it big time, I do remember how to read and understand sheet music.
And thus, I sat down transcoding simple tunes like :
Then one day I learned that in windows.h, in C++ there is function called
beep(<freq>,<time>) which replaces 4 lines of old codes each, and it works in modern PCs. So I changed it all again and this time I added a resource file with icon for the program, which builds to a
I had determined the frequency of the notes on the guitar and gave them as inputs to the
sound function in C and later the
beep functions in C++.
Then I figured out a beat duration. In sheet music notes:
Accordingly I used the note freqency and beat duration and with a combination of for loops I made the program make the sounds as needed to play different tunes.
The following tunes are hardcoded into the program:
You get to select the tune in the beginning. When the tune is playing, a starry background plays using the
I had fun doing this project as I could finally use my musical knowlegde, in my own way..