Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

Purpose

To define a note to play on the buzzer.

When to use

When you want to play something.

Where to use

Typically at the top of the file, in a color pattern, or when calling SetColor.

Main prototype and parameters

Notes are defined using their frequency in Hertz, as you would with a simple int.

Constants

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

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 Note::END at the end of your pattern, else very weird tune will be played.

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 };
  • No labels