40
Picture 4-3-4 The score of Happy birthday song
Here to understand a little knowledge of the score, look at the above score, the score below the score is
a bit of bass, no point is normal, the number is a bit high, and the bass of 5 is 4.5, the treble is 5.5, other
notes are also The corresponding reason.
At the top left of the score, there is “1 F”, and the general score is , which is “1 C”. ote that the
1234567 in the score corresponds to ABCDEFG. It is CDEFGAB Therefore, if the rule here is F, then it
means that 2 will sing G, 3 will sing A, ... 7 will sing E, so the bass 5 here should correspond to the bass
1.5!!!! The so-called corresponding left shift or right shift, if you still don't understand, look at the
following:
1 The original corresponding should be C, 4 should correspond to F and then 1 corresponds to F, which
is equivalent to 4, then 1.5 corresponds to 4.5, 2 corresponds to 5.
In this case, the bass 5 is actually 4.5, so the half cycle is 1803 μs.
As for why it is based on the half-cycle, it is because the microcontroller is set by the loop to the port
connected to the buzzer, reset to make the sound, so it is a half cycle. Because I use a passive buzzer, the
active buzzer is full cycle.
Then follow the above principle, one by one, and use the delay function to achieve, because each note
has a different conversion frequency, or use multiple delay functions to achieve accurate pitch frequency one
by one, but this is too annoying, and the microcontroller itself It is not specifically for singing. We shouldn't
be embarrassed about them, so we will just be able to do it. Therefore, the delay function has a similar
frequency in order to adapt to each tone. This is calculated by itself, and different songs have different
values, so this is a troublesome problem.
After we know the frequency of the tone, the next step is to control the playing time of the note. Each
note will play for a certain period of time, in order to form a beautiful piece of music, instead of a blunt tone,
all the notes are played in one brain, and the note rhythm is divided into one beat, half beat, quarter beat. For
one-eighth shot, we specify a time for a note to be 1; a half beat is 0.5; a 1/4 beat is 0.25; a 1/8 beat is
0.125...