| ??? 05/03/01 03:56 Read: times |
#11290 - RE: Song in 8051 |
I did this in 1983 using an intel 8748 microcontroller. What you have to do is determine the frequency of each note in the western music scale. I based it on "A" which is 440 Hz exactly.
I wrote a Basic program which used the fractional exponent to extrapolate all the notes in the scale. 440Exp13/12 equals A#, 44^14/12 = B, etc. the next octave is always twice the frequency so the next octave of A is 880Hz. Set up 2 lookup tables in your software and write your code to read the song table which stores the pitch of the note and then uses that pitch to lookup the toggling time for the timer interrupt routine which sets or clears the pin which drives your speaker driver. Its not too bad, it was the second program that I ever wrote for the 8748 and played a christmas song in 3 part harmony. Its really a good learning experience. Buck Stein |
| Topic | Author | Date |
| Song in 8051 | 01/01/70 00:00 | |
| RE: Song in 8051 | 01/01/70 00:00 | |
| RE: Song in 8051 (non seriuos reply) | 01/01/70 00:00 | |
| RE: Song in 8051 (non seriuos reply) | 01/01/70 00:00 | |
| RE: Song in 8051 | 01/01/70 00:00 | |
| RE: Song in 8051 | 01/01/70 00:00 | |
RE: Song in 8051 | 01/01/70 00:00 |



