This repository was archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
output folder
pit edited this page Feb 22, 2021
·
7 revisions
cd output/buzzer/buzzer_on_off
Test the buzzer my making "blink" it.
cd output/buzzer/play_melody
Assuming a base time of 4/4, the notes' names and time are:
| American | British | time |
|---|---|---|
| whole note | semibreve | 4/4 |
| half note | minim | 2/4 |
| quarter note | crotchet | 1/4 |
| eighth note | quaver | 1/8 |
| sixteenth note | semiquaver | 1/16 |
| thirty-second note | demisemiquaver | 1/32 |
| sixty-fourth note | hemidemisemiquaver | 1/64 |
Please Note: the hemidemisemiquaver is also known as semidemisemiquaver
Play the melody you want by specifying the note (from the constants in musical-notes.h) and the length.
Assuming that:
- the base time of
4/4 -
4'000 ms = 4 seconds = 1 second * 4 musical measures = 60 BMP(Beats per Minutes)
Then, the notes' length are:
| type | computations | length |
|---|---|---|
| whole note | 4000 * 1 = 4000 / 1 |
4000 |
| half note | 4000 * (1/2) = 4000 / 2 |
2000 |
| quarter note | 4000 * (1/4) = 4000 / 4 |
1000 |
| eighth note | 4000 * (1/8) = 4000 / 8 |
500 |
| sixteenth note | 4000 * (1/16) = 4000 / 16 |
250 |
| thirty-second note | 4000 * (1/32) = 4000 / 32 |
125 |
| sixty-fourth note | 4000 * (1/64) = 4000 / 64 |
62.5 |
Notes with dot:
| type | computations | length |
|---|---|---|
| dotted whole note | 4000 * 3/2 = 4000 / (2/3) = (4000 / 1) + (4000 / 2) |
6000 |
| dotted half note | 4000 * 3/4 = 4000 / (4/3) = (4000 / 2) + (4000 / 4) |
3000 |
| dotted quarter note | 4000 * 3/8 = 4000 / (8/3) = (4000 / 4) + (4000 / 8) |
1500 |
| dotted eighth note | 4000 * 3/16 = 4000 / (16/3) = (4000 / 8) + (4000 / 16) |
750 |
| dotted sixteenth note | 4000 * 3/32 = 100 / (32/3) = (4000 / 16) + (4000 / 32) |
375 |
| dotted thirty-second note | 4000 * 3/64 = 4000 / (64/3) = (4000 / 32) + (4000 / 64) |
187.5 |
| dotted sixty-fourth note | 4000 * 3/128 = 4000 / (128/3) = (4000 / 64) + (4000 / 128) |
93.75 |
Arduino MKR WiFi 1010 is proudly made by PitPietro