Définir une note à jouer sur le buzzer.
Quand vous voulez jouer quelque chose.
Typiquement en début de fichier, dans une mélodie, ou lors de l’appel de PlayTune.
Notes are defined using their frequency in Hertz, as you would with a simple int.
The CRC defines the following constants, which represents the standard musical notes:
NOTE_B0
NOTE_C1
NOTE_CS1
NOTE_D1
NOTE_DS1
NOTE_E1
NOTE_F1
NOTE_FS1
NOTE_G1
NOTE_GS1
NOTE_A1
NOTE_AS1
NOTE_B1
NOTE_C2
…
NOTE_DS8
The first letter (A, B, C, etc.) defines the note, the optional S denotes if the note is sharp and the number defines the octave
Note
is a type that includes a pitch and a duration, used for a tune played by the CrcDuino. Note::END
indicates the end of the tune.
Make sure to add |
Use it as such:
// Define a tune. Notice the Note::END at the end. const Note TUNE_METRO[] = { { 500, NOTE_FS4 }, { 500, NOTE_B4 }, { 800, NOTE_FS5 }, Note::END }; |