Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
buzzer_tunes.c File Reference

Play tunes on a passive piezo buzzer (e.g. More...

#include "modules/sound/buzzer_tunes.h"
#include "modules/sound/buzzer_arch.h"
#include "mcu_periph/sys_time.h"
#include "generated/airframe.h"
+ Include dependency graph for buzzer_tunes.c:

Go to the source code of this file.

Data Structures

struct  buzzer_note
 

Macros

#define BUZZER_TUNES_STARTUP_TUNE   BUZZER_TUNES_STARTUP
 Tune played at startup, BUZZER_TUNES_NONE for silence.
 
#define BUZZER_TUNES_GAP_MS   30
 Silence at the end of each note, so repeated notes are heard separately [ms].
 
#define REST   0
 Note frequencies [Hz], s for sharp, octaves 5 to 7 sound loudest on a piezo.
 
#define C5   523
 
#define Cs5   554
 
#define D5   587
 
#define Ds5   622
 
#define E5   659
 
#define F5   698
 
#define Fs5   740
 
#define G5   784
 
#define Gs5   831
 
#define A5   880
 
#define As5   932
 
#define B5   988
 
#define C6   1047
 
#define Cs6   1109
 
#define D6   1175
 
#define Ds6   1245
 
#define E6   1319
 
#define F6   1397
 
#define Fs6   1480
 
#define G6   1568
 
#define Gs6   1661
 
#define A6   1760
 
#define As6   1865
 
#define B6   1976
 
#define C7   2093
 
#define Cs7   2217
 
#define D7   2349
 
#define Ds7   2489
 
#define E7   2637
 
#define F7   2794
 
#define Fs7   2960
 
#define G7   3136
 
#define Gs7   3322
 
#define A7   3520
 
#define As7   3729
 
#define B7   3951
 
#define BEATS(_b, _bpm)   ((uint16_t)((_b) * 60000.0 / (_bpm)))
 Duration of a number of beats at a tempo [ms].
 
#define TUNE_END   {0, 0}
 
#define BUZZER_TUNES_RTTTL_1   ""
 Custom tunes (Custom 1..3) in RTTTL format ("name:d=4,o=6,b=120:c,e,g"), set in the airframe, empty for none.
 
#define BUZZER_TUNES_RTTTL_2   ""
 
#define BUZZER_TUNES_RTTTL_3   ""
 
#define IT_BPM   112
 Italy, Il Canto degli Italiani, first verse (Novaro 1847, public domain)
 
#define NL_BPM   90
 Netherlands, Wilhelmus, first verse (16th century, public domain)
 
#define FR_BPM   105
 France, La Marseillaise, opening to "l'étendard sanglant est levé" (Rouget de Lisle 1792, public domain)
 

Functions

static uint16_t rtttl_number (const char **p)
 
static bool rtttl_start (const char *str)
 Parse the RTTTL header "name:d=4,o=6,b=120:", false if invalid.
 
static bool rtttl_next (struct buzzer_note *n)
 Parse the next RTTTL note "[duration]note[#][.][octave][.]", false at the end.
 
static bool next_note (struct buzzer_note *n)
 Get the next note of the tune, false at the end.
 
static void start_next_note (void)
 
void buzzer_tunes_play (uint8_t tune)
 Start a tune (BUZZER_TUNES_NONE stops), also the settings handler.
 
void buzzer_tunes_init (void)
 
void buzzer_tunes_periodic (void)
 

Variables

static const struct buzzer_note tune_startup []
 Short rising arpeggio.
 
static const struct buzzer_note tune_ode_to_joy []
 Beethoven, Ode to Joy, full theme (public domain)
 
static const struct buzzer_note tune_twinkle []
 Twinkle Twinkle Little Star, full song (public domain)
 
static const struct buzzer_note tune_anthem_italy []
 
static const struct buzzer_note tune_anthem_netherlands []
 
static const struct buzzer_note tune_anthem_france []
 
static const struct buzzer_note tune_happy_birthday []
 Happy Birthday (public domain)
 
static const struct buzzer_note tune_mushroom []
 Mushroom Song.
 
static const struct buzzer_note tune_gran_vals []
 Tarrega, Gran Vals, the phrase known as the Nokia ringtone (public domain)
 
static const struct buzzer_note tune_fur_elise []
 Beethoven, Fur Elise, first section (public domain)
 
static const struct buzzer_note tune_la_cucaracha []
 La Cucaracha, chorus (traditional, public domain)
 
static const struct buzzer_note tune_william_tell []
 Rossini, William Tell Overture, galop opening, played twice (public domain)
 
static const struct buzzer_note *const buzzer_tunes_list [BUZZER_TUNES_CUSTOM_1]
 
static const char *const buzzer_tunes_custom []
 Custom tunes, RTTTL strings.
 
uint8_t buzzer_tunes_tune = BUZZER_TUNES_NONE
 tune being played, BUZZER_TUNES_NONE when silent
 
static const struct buzzer_note * tune_notes = NULL
 next note of a built-in tune
 
static const char * rtttl = NULL
 next note of a RTTTL tune
 
static uint8_t rtttl_d = 4
 
static uint8_t rtttl_o = 6
 RTTTL default duration and octave.
 
static uint16_t rtttl_bpm = 63
 RTTTL tempo.
 
static struct buzzer_note note
 note being played
 
static bool playing = false
 
static uint32_t note_start_ms = 0
 start time of the note
 
static bool note_gap = false
 in the silent gap at the end of the note
 

Detailed Description

Play tunes on a passive piezo buzzer (e.g.

a startup tune)

Definition in file buzzer_tunes.c.


Data Structure Documentation

◆ buzzer_note

struct buzzer_note

Definition at line 81 of file buzzer_tunes.c.

Data Fields
uint16_t freq [Hz], REST for silence
uint16_t ms duration [ms]

Macro Definition Documentation

◆ A5

#define A5   880

Definition at line 50 of file buzzer_tunes.c.

◆ A6

#define A6   1760

Definition at line 62 of file buzzer_tunes.c.

◆ A7

#define A7   3520

Definition at line 74 of file buzzer_tunes.c.

◆ As5

#define As5   932

Definition at line 51 of file buzzer_tunes.c.

◆ As6

#define As6   1865

Definition at line 63 of file buzzer_tunes.c.

◆ As7

#define As7   3729

Definition at line 75 of file buzzer_tunes.c.

◆ B5

#define B5   988

Definition at line 52 of file buzzer_tunes.c.

◆ B6

#define B6   1976

Definition at line 64 of file buzzer_tunes.c.

◆ B7

#define B7   3951

Definition at line 76 of file buzzer_tunes.c.

◆ BEATS

#define BEATS (   _b,
  _bpm 
)    ((uint16_t)((_b) * 60000.0 / (_bpm)))

Duration of a number of beats at a tempo [ms].

Definition at line 79 of file buzzer_tunes.c.

◆ BUZZER_TUNES_GAP_MS

#define BUZZER_TUNES_GAP_MS   30

Silence at the end of each note, so repeated notes are heard separately [ms].

Definition at line 37 of file buzzer_tunes.c.

◆ BUZZER_TUNES_RTTTL_1

#define BUZZER_TUNES_RTTTL_1   ""

Custom tunes (Custom 1..3) in RTTTL format ("name:d=4,o=6,b=120:c,e,g"), set in the airframe, empty for none.

Definition at line 90 of file buzzer_tunes.c.

◆ BUZZER_TUNES_RTTTL_2

#define BUZZER_TUNES_RTTTL_2   ""

Definition at line 93 of file buzzer_tunes.c.

◆ BUZZER_TUNES_RTTTL_3

#define BUZZER_TUNES_RTTTL_3   ""

Definition at line 96 of file buzzer_tunes.c.

◆ BUZZER_TUNES_STARTUP_TUNE

#define BUZZER_TUNES_STARTUP_TUNE   BUZZER_TUNES_STARTUP

Tune played at startup, BUZZER_TUNES_NONE for silence.

Definition at line 33 of file buzzer_tunes.c.

◆ C5

#define C5   523

Definition at line 41 of file buzzer_tunes.c.

◆ C6

#define C6   1047

Definition at line 53 of file buzzer_tunes.c.

◆ C7

#define C7   2093

Definition at line 65 of file buzzer_tunes.c.

◆ Cs5

#define Cs5   554

Definition at line 42 of file buzzer_tunes.c.

◆ Cs6

#define Cs6   1109

Definition at line 54 of file buzzer_tunes.c.

◆ Cs7

#define Cs7   2217

Definition at line 66 of file buzzer_tunes.c.

◆ D5

#define D5   587

Definition at line 43 of file buzzer_tunes.c.

◆ D6

#define D6   1175

Definition at line 55 of file buzzer_tunes.c.

◆ D7

#define D7   2349

Definition at line 67 of file buzzer_tunes.c.

◆ Ds5

#define Ds5   622

Definition at line 44 of file buzzer_tunes.c.

◆ Ds6

#define Ds6   1245

Definition at line 56 of file buzzer_tunes.c.

◆ Ds7

#define Ds7   2489

Definition at line 68 of file buzzer_tunes.c.

◆ E5

#define E5   659

Definition at line 45 of file buzzer_tunes.c.

◆ E6

#define E6   1319

Definition at line 57 of file buzzer_tunes.c.

◆ E7

#define E7   2637

Definition at line 69 of file buzzer_tunes.c.

◆ F5

#define F5   698

Definition at line 46 of file buzzer_tunes.c.

◆ F6

#define F6   1397

Definition at line 58 of file buzzer_tunes.c.

◆ F7

#define F7   2794

Definition at line 70 of file buzzer_tunes.c.

◆ FR_BPM

#define FR_BPM   105

France, La Marseillaise, opening to "l'étendard sanglant est levé" (Rouget de Lisle 1792, public domain)

Definition at line 163 of file buzzer_tunes.c.

◆ Fs5

#define Fs5   740

Definition at line 47 of file buzzer_tunes.c.

◆ Fs6

#define Fs6   1480

Definition at line 59 of file buzzer_tunes.c.

◆ Fs7

#define Fs7   2960

Definition at line 71 of file buzzer_tunes.c.

◆ G5

#define G5   784

Definition at line 48 of file buzzer_tunes.c.

◆ G6

#define G6   1568

Definition at line 60 of file buzzer_tunes.c.

◆ G7

#define G7   3136

Definition at line 72 of file buzzer_tunes.c.

◆ Gs5

#define Gs5   831

Definition at line 49 of file buzzer_tunes.c.

◆ Gs6

#define Gs6   1661

Definition at line 61 of file buzzer_tunes.c.

◆ Gs7

#define Gs7   3322

Definition at line 73 of file buzzer_tunes.c.

◆ IT_BPM

#define IT_BPM   112

Italy, Il Canto degli Italiani, first verse (Novaro 1847, public domain)

Definition at line 127 of file buzzer_tunes.c.

◆ NL_BPM

#define NL_BPM   90

Netherlands, Wilhelmus, first verse (16th century, public domain)

Definition at line 146 of file buzzer_tunes.c.

◆ REST

#define REST   0

Note frequencies [Hz], s for sharp, octaves 5 to 7 sound loudest on a piezo.

Definition at line 40 of file buzzer_tunes.c.

◆ TUNE_END

#define TUNE_END   {0, 0}

Definition at line 86 of file buzzer_tunes.c.

Function Documentation

◆ buzzer_tunes_init()

void buzzer_tunes_init ( void  )

Definition at line 406 of file buzzer_tunes.c.

References buzzer_arch_init(), buzzer_tunes_play(), and BUZZER_TUNES_STARTUP_TUNE.

+ Here is the call graph for this function:

◆ buzzer_tunes_periodic()

void buzzer_tunes_periodic ( void  )

Definition at line 412 of file buzzer_tunes.c.

References buzzer_arch_tone(), BUZZER_TUNES_GAP_MS, get_sys_time_msec(), buzzer_note::ms, note, note_gap, note_start_ms, playing, and start_next_note().

+ Here is the call graph for this function:

◆ buzzer_tunes_play()

void buzzer_tunes_play ( uint8_t  tune)

Start a tune (BUZZER_TUNES_NONE stops), also the settings handler.

Definition at line 384 of file buzzer_tunes.c.

References buzzer_arch_tone(), buzzer_tunes_custom, BUZZER_TUNES_CUSTOM_1, buzzer_tunes_list, BUZZER_TUNES_NB, BUZZER_TUNES_NONE, buzzer_tunes_tune, foo, playing, rtttl, rtttl_start(), start_next_note(), and tune_notes.

Referenced by buzzer_tunes_init(), and start_next_note().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next_note()

static bool next_note ( struct buzzer_note *  n)
static

Get the next note of the tune, false at the end.

Definition at line 360 of file buzzer_tunes.c.

References foo, buzzer_note::ms, rtttl, rtttl_next(), and tune_notes.

Referenced by start_next_note().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtttl_next()

static bool rtttl_next ( struct buzzer_note *  n)
static

Parse the next RTTTL note "[duration]note[#][.][octave][.]", false at the end.

Definition at line 323 of file buzzer_tunes.c.

References f, foo, buzzer_note::freq, Min, buzzer_note::ms, p, REST, rtttl, rtttl_bpm, rtttl_d, rtttl_number(), and rtttl_o.

Referenced by next_note().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtttl_number()

static uint16_t rtttl_number ( const char **  p)
static

Definition at line 288 of file buzzer_tunes.c.

References p.

Referenced by rtttl_next(), and rtttl_start().

+ Here is the caller graph for this function:

◆ rtttl_start()

static bool rtttl_start ( const char *  str)
static

Parse the RTTTL header "name:d=4,o=6,b=120:", false if invalid.

Definition at line 298 of file buzzer_tunes.c.

References foo, p, rtttl, rtttl_bpm, rtttl_d, rtttl_number(), and rtttl_o.

Referenced by buzzer_tunes_play().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_next_note()

static void start_next_note ( void  )
static

Definition at line 373 of file buzzer_tunes.c.

References buzzer_arch_tone(), BUZZER_TUNES_NONE, buzzer_tunes_play(), buzzer_note::freq, get_sys_time_msec(), next_note(), note, note_gap, and note_start_ms.

Referenced by buzzer_tunes_periodic(), and buzzer_tunes_play().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ buzzer_tunes_custom

const char* const buzzer_tunes_custom[]
static
Initial value:
= {
}
#define BUZZER_TUNES_RTTTL_1
Custom tunes (Custom 1..3) in RTTTL format ("name:d=4,o=6,b=120:c,e,g"), set in the airframe,...
#define BUZZER_TUNES_RTTTL_3
#define BUZZER_TUNES_RTTTL_2

Custom tunes, RTTTL strings.

Definition at line 273 of file buzzer_tunes.c.

Referenced by buzzer_tunes_play().

◆ buzzer_tunes_list

const struct buzzer_note* const buzzer_tunes_list[BUZZER_TUNES_CUSTOM_1]
static
Initial value:
= {
}
static const struct buzzer_note tune_startup[]
Short rising arpeggio.
static const struct buzzer_note tune_twinkle[]
Twinkle Twinkle Little Star, full song (public domain)
static const struct buzzer_note tune_william_tell[]
Rossini, William Tell Overture, galop opening, played twice (public domain)
static const struct buzzer_note tune_anthem_netherlands[]
static const struct buzzer_note tune_la_cucaracha[]
La Cucaracha, chorus (traditional, public domain)
static const struct buzzer_note tune_ode_to_joy[]
Beethoven, Ode to Joy, full theme (public domain)
static const struct buzzer_note tune_gran_vals[]
Tarrega, Gran Vals, the phrase known as the Nokia ringtone (public domain)
static const struct buzzer_note tune_mushroom[]
Mushroom Song.
static const struct buzzer_note tune_anthem_france[]
static const struct buzzer_note tune_fur_elise[]
Beethoven, Fur Elise, first section (public domain)
static const struct buzzer_note tune_anthem_italy[]
static const struct buzzer_note tune_happy_birthday[]
Happy Birthday (public domain)
@ BUZZER_TUNES_TWINKLE
@ BUZZER_TUNES_STARTUP
@ BUZZER_TUNES_MUSHROOM
@ BUZZER_TUNES_FUR_ELISE
@ BUZZER_TUNES_ODE_TO_JOY
@ BUZZER_TUNES_WILLIAM_TELL
@ BUZZER_TUNES_ANTHEM_NETHERLANDS
@ BUZZER_TUNES_HAPPY_BIRTHDAY
@ BUZZER_TUNES_ANTHEM_ITALY
@ BUZZER_TUNES_NONE
@ BUZZER_TUNES_ANTHEM_FRANCE
@ BUZZER_TUNES_GRAN_VALS
@ BUZZER_TUNES_LA_CUCARACHA
uint16_t foo
Definition main_demo5.c:58

Definition at line 256 of file buzzer_tunes.c.

Referenced by buzzer_tunes_play().

◆ buzzer_tunes_tune

uint8_t buzzer_tunes_tune = BUZZER_TUNES_NONE

tune being played, BUZZER_TUNES_NONE when silent

Definition at line 277 of file buzzer_tunes.c.

Referenced by buzzer_tunes_play().

◆ note

struct buzzer_note note
static

note being played

Definition at line 283 of file buzzer_tunes.c.

Referenced by buzzer_tunes_periodic(), and start_next_note().

◆ note_gap

bool note_gap = false
static

in the silent gap at the end of the note

Definition at line 286 of file buzzer_tunes.c.

Referenced by buzzer_tunes_periodic(), and start_next_note().

◆ note_start_ms

uint32_t note_start_ms = 0
static

start time of the note

Definition at line 285 of file buzzer_tunes.c.

Referenced by buzzer_tunes_periodic(), and start_next_note().

◆ playing

bool playing = false
static

Definition at line 284 of file buzzer_tunes.c.

Referenced by buzzer_tunes_periodic(), and buzzer_tunes_play().

◆ rtttl

const char* rtttl = NULL
static

next note of a RTTTL tune

Definition at line 280 of file buzzer_tunes.c.

Referenced by buzzer_tunes_play(), next_note(), rtttl_next(), and rtttl_start().

◆ rtttl_bpm

uint16_t rtttl_bpm = 63
static

RTTTL tempo.

Definition at line 282 of file buzzer_tunes.c.

Referenced by rtttl_next(), and rtttl_start().

◆ rtttl_d

uint8_t rtttl_d = 4
static

Definition at line 281 of file buzzer_tunes.c.

Referenced by rtttl_next(), and rtttl_start().

◆ rtttl_o

uint8_t rtttl_o = 6
static

RTTTL default duration and octave.

Definition at line 281 of file buzzer_tunes.c.

Referenced by rtttl_next(), and rtttl_start().

◆ tune_anthem_france

const struct buzzer_note tune_anthem_france[]
static
Initial value:
= {
{D5, BEATS(0.25, FR_BPM)}, {D5, BEATS(0.75, FR_BPM)}, {D5, BEATS(0.25, FR_BPM)}, {G5, BEATS(1, FR_BPM)},
{G5, BEATS(1, FR_BPM)}, {A5, BEATS(1, FR_BPM)}, {A5, BEATS(1, FR_BPM)}, {D6, BEATS(1.5, FR_BPM)},
{B5, BEATS(0.5, FR_BPM)}, {G5, BEATS(0.75, FR_BPM)}, {G5, BEATS(0.25, FR_BPM)}, {B5, BEATS(0.75, FR_BPM)},
{G5, BEATS(0.25, FR_BPM)}, {E5, BEATS(1, FR_BPM)}, {C6, BEATS(1, FR_BPM)}, {REST, BEATS(1, FR_BPM)},
{A5, BEATS(0.75, FR_BPM)}, {Fs5, BEATS(0.25, FR_BPM)}, {G5, BEATS(1, FR_BPM)}, {REST, BEATS(2, FR_BPM)},
{G5, BEATS(0.75, FR_BPM)}, {A5, BEATS(0.25, FR_BPM)}, {B5, BEATS(1, FR_BPM)}, {B5, BEATS(1, FR_BPM)},
{B5, BEATS(1, FR_BPM)}, {C6, BEATS(0.75, FR_BPM)}, {B5, BEATS(0.25, FR_BPM)}, {B5, BEATS(1, FR_BPM)},
{A5, BEATS(1, FR_BPM)}, {REST, BEATS(1, FR_BPM)}, {A5, BEATS(0.75, FR_BPM)}, {B5, BEATS(0.25, FR_BPM)},
{C6, BEATS(1, FR_BPM)}, {C6, BEATS(1, FR_BPM)}, {C6, BEATS(1, FR_BPM)}, {D6, BEATS(0.75, FR_BPM)},
{C6, BEATS(0.25, FR_BPM)}, {B5, BEATS(1, FR_BPM)}, {REST, BEATS(2, FR_BPM)}, {D6, BEATS(0.75, FR_BPM)},
{D6, BEATS(0.25, FR_BPM)}, {D6, BEATS(1, FR_BPM)}, {B5, BEATS(0.75, FR_BPM)}, {G5, BEATS(0.25, FR_BPM)},
{D6, BEATS(1, FR_BPM)}, {B5, BEATS(0.75, FR_BPM)}, {G5, BEATS(0.25, FR_BPM)}, {D5, BEATS(3, FR_BPM)}, TUNE_END
}
#define G5
#define D5
#define TUNE_END
#define C6
#define Fs5
#define FR_BPM
France, La Marseillaise, opening to "l'étendard sanglant est levé" (Rouget de Lisle 1792,...
#define A5
#define D6
#define E5
#define B5
#define BEATS(_b, _bpm)
Duration of a number of beats at a tempo [ms].
#define REST
Note frequencies [Hz], s for sharp, octaves 5 to 7 sound loudest on a piezo.

Definition at line 164 of file buzzer_tunes.c.

◆ tune_anthem_italy

const struct buzzer_note tune_anthem_italy[]
static
Initial value:
= {
{F5, BEATS(1, IT_BPM)}, {F5, BEATS(0.75, IT_BPM)}, {G5, BEATS(0.25, IT_BPM)}, {F5, BEATS(1, IT_BPM)},
{REST, BEATS(1, IT_BPM)}, {D6, BEATS(1, IT_BPM)}, {D6, BEATS(0.75, IT_BPM)}, {Ds6, BEATS(0.25, IT_BPM)},
{D6, BEATS(1, IT_BPM)}, {REST, BEATS(1, IT_BPM)}, {D6, BEATS(1, IT_BPM)}, {F6, BEATS(0.75, IT_BPM)},
{Ds6, BEATS(0.25, IT_BPM)}, {D6, BEATS(2, IT_BPM)}, {C6, BEATS(1, IT_BPM)}, {D6, BEATS(0.75, IT_BPM)},
{C6, BEATS(0.25, IT_BPM)}, {As5, BEATS(1, IT_BPM)}, {REST, BEATS(1, IT_BPM)}, {D6, BEATS(1, IT_BPM)},
{D6, BEATS(1, IT_BPM)}, {A5, BEATS(2, IT_BPM)}, {As5, BEATS(0.75, IT_BPM)}, {C6, BEATS(0.25, IT_BPM)},
{As5, BEATS(0.75, IT_BPM)}, {A5, BEATS(0.25, IT_BPM)}, {G5, BEATS(1, IT_BPM)}, {REST, BEATS(1, IT_BPM)},
{As5, BEATS(1, IT_BPM)}, {A5, BEATS(0.75, IT_BPM)}, {As5, BEATS(0.25, IT_BPM)}, {C6, BEATS(1, IT_BPM)},
{REST, BEATS(1, IT_BPM)}, {D5, BEATS(1, IT_BPM)}, {D6, BEATS(2, IT_BPM)}, {Ds6, BEATS(1, IT_BPM)},
{F5, BEATS(1, IT_BPM)}, {F5, BEATS(0.75, IT_BPM)}, {G5, BEATS(0.25, IT_BPM)}, {F5, BEATS(0.5, IT_BPM)},
{REST, BEATS(1.5, IT_BPM)}, {D6, BEATS(1, IT_BPM)}, {D6, BEATS(0.75, IT_BPM)}, {Ds6, BEATS(0.25, IT_BPM)},
{D6, BEATS(2, IT_BPM)}, {D6, BEATS(1, IT_BPM)}, {F6, BEATS(0.75, IT_BPM)}, {Ds6, BEATS(0.25, IT_BPM)},
{D6, BEATS(1.5, IT_BPM)}, {F6, BEATS(0.5, IT_BPM)}, {C6, BEATS(0.5, IT_BPM)}, {F6, BEATS(0.5, IT_BPM)},
}
#define F5
#define IT_BPM
Italy, Il Canto degli Italiani, first verse (Novaro 1847, public domain)
#define Ds6
#define As5
#define F6

Definition at line 128 of file buzzer_tunes.c.

◆ tune_anthem_netherlands

const struct buzzer_note tune_anthem_netherlands[]
static
Initial value:
= {
{D5, BEATS(1, NL_BPM)}, {G5, BEATS(1, NL_BPM)}, {G5, BEATS(1, NL_BPM)}, {A5, BEATS(0.5, NL_BPM)},
{B5, BEATS(0.5, NL_BPM)}, {C6, BEATS(0.5, NL_BPM)}, {A5, BEATS(0.5, NL_BPM)}, {B5, BEATS(1, NL_BPM)},
{A5, BEATS(0.5, NL_BPM)}, {B5, BEATS(0.5, NL_BPM)}, {C6, BEATS(1, NL_BPM)}, {B5, BEATS(1, NL_BPM)},
{A5, BEATS(0.5, NL_BPM)}, {G5, BEATS(0.5, NL_BPM)}, {A5, BEATS(1, NL_BPM)}, {G5, BEATS(3, NL_BPM)},
{B5, BEATS(0.5, NL_BPM)}, {C6, BEATS(0.5, NL_BPM)}, {D6, BEATS(2, NL_BPM)}, {E6, BEATS(1, NL_BPM)},
{D6, BEATS(2, NL_BPM)}, {C6, BEATS(1, NL_BPM)}, {B5, BEATS(1, NL_BPM)}, {A5, BEATS(0.5, NL_BPM)},
{B5, BEATS(0.5, NL_BPM)}, {C6, BEATS(1, NL_BPM)}, {B5, BEATS(1, NL_BPM)}, {A5, BEATS(1, NL_BPM)},
{G5, BEATS(1, NL_BPM)}, {A5, BEATS(3, NL_BPM)}, {D5, BEATS(1, NL_BPM)}, {G5, BEATS(0.5, NL_BPM)},
{Fs5, BEATS(0.5, NL_BPM)}, {G5, BEATS(0.5, NL_BPM)}, {A5, BEATS(0.5, NL_BPM)}, {B5, BEATS(1, NL_BPM)},
{A5, BEATS(2, NL_BPM)}, {G5, BEATS(1, NL_BPM)}, {Fs5, BEATS(1, NL_BPM)}, {D5, BEATS(1, NL_BPM)},
{E5, BEATS(0.5, NL_BPM)}, {Fs5, BEATS(0.5, NL_BPM)}, {G5, BEATS(1, NL_BPM)}, {G5, BEATS(1, NL_BPM)},
}
#define NL_BPM
Netherlands, Wilhelmus, first verse (16th century, public domain)
#define E6

Definition at line 147 of file buzzer_tunes.c.

◆ tune_fur_elise

const struct buzzer_note tune_fur_elise[]
static
Initial value:
= {
{E6, 150}, {Ds6, 150}, {E6, 150}, {Ds6, 150}, {E6, 150}, {B5, 150}, {D6, 150}, {C6, 150},
{A5, 300}, {REST, 150}, {C5, 150}, {E5, 150}, {A5, 150}, {B5, 300}, {REST, 150},
{E5, 150}, {Gs5, 150}, {B5, 150}, {C6, 300}, {REST, 150}, {E5, 150}, {E6, 150}, {Ds6, 150},
{E6, 150}, {Ds6, 150}, {E6, 150}, {B5, 150}, {D6, 150}, {C6, 150},
{A5, 300}, {REST, 150}, {C5, 150}, {E5, 150}, {A5, 150}, {B5, 300}, {REST, 150},
{E5, 150}, {C6, 150}, {B5, 150}, {A5, 600}, TUNE_END
}
#define C5
#define Gs5

Beethoven, Fur Elise, first section (public domain)

Definition at line 229 of file buzzer_tunes.c.

◆ tune_gran_vals

const struct buzzer_note tune_gran_vals[]
static
Initial value:
= {
{E6, 160}, {D6, 160}, {Fs5, 320}, {Gs5, 320}, {Cs6, 160}, {B5, 160}, {D5, 320}, {E5, 320},
{B5, 160}, {A5, 160}, {Cs5, 320}, {E5, 320}, {A5, 960}, TUNE_END
}
#define Cs5
#define Cs6

Tarrega, Gran Vals, the phrase known as the Nokia ringtone (public domain)

Definition at line 223 of file buzzer_tunes.c.

◆ tune_happy_birthday

const struct buzzer_note tune_happy_birthday[]
static
Initial value:
= {
{G5, 300}, {G5, 100}, {A5, 400}, {G5, 400}, {C6, 400}, {B5, 800},
{G5, 300}, {G5, 100}, {A5, 400}, {G5, 400}, {D6, 400}, {C6, 800},
{G5, 300}, {G5, 100}, {G6, 400}, {E6, 400}, {C6, 400}, {B5, 400}, {A5, 800},
{F6, 300}, {F6, 100}, {E6, 400}, {C6, 400}, {D6, 400}, {C6, 800}, TUNE_END
}
#define G6

Happy Birthday (public domain)

Definition at line 180 of file buzzer_tunes.c.

◆ tune_la_cucaracha

const struct buzzer_note tune_la_cucaracha[]
static
Initial value:
= {
{C6, 150}, {C6, 150}, {C6, 150}, {F6, 450}, {A6, 300},
{C6, 150}, {C6, 150}, {C6, 150}, {F6, 450}, {A6, 600},
{F6, 300}, {F6, 150}, {E6, 150}, {E6, 150}, {D6, 150}, {D6, 150}, {C6, 600},
{C6, 150}, {C6, 150}, {C6, 150}, {E6, 450}, {G6, 300},
{C6, 150}, {C6, 150}, {C6, 150}, {E6, 450}, {G6, 600},
{C7, 300}, {D7, 150}, {C7, 150}, {As6, 150}, {A6, 150}, {G6, 150}, {F6, 600}, TUNE_END
}
#define D7
#define A6
#define As6
#define C7

La Cucaracha, chorus (traditional, public domain)

Definition at line 239 of file buzzer_tunes.c.

◆ tune_mushroom

const struct buzzer_note tune_mushroom[]
static

Mushroom Song.

Definition at line 189 of file buzzer_tunes.c.

◆ tune_notes

const struct buzzer_note* tune_notes = NULL
static

next note of a built-in tune

Definition at line 279 of file buzzer_tunes.c.

Referenced by buzzer_tunes_play(), and next_note().

◆ tune_ode_to_joy

const struct buzzer_note tune_ode_to_joy[]
static
Initial value:
= {
{E6, 300}, {E6, 300}, {F6, 300}, {G6, 300}, {G6, 300}, {F6, 300}, {E6, 300}, {D6, 300},
{C6, 300}, {C6, 300}, {D6, 300}, {E6, 300}, {E6, 450}, {D6, 150}, {D6, 600},
{E6, 300}, {E6, 300}, {F6, 300}, {G6, 300}, {G6, 300}, {F6, 300}, {E6, 300}, {D6, 300},
{C6, 300}, {C6, 300}, {D6, 300}, {E6, 300}, {D6, 450}, {C6, 150}, {C6, 600},
{D6, 300}, {D6, 300}, {E6, 300}, {C6, 300}, {D6, 300}, {E6, 150}, {F6, 150}, {E6, 300}, {C6, 300},
{D6, 300}, {E6, 150}, {F6, 150}, {E6, 300}, {D6, 300}, {C6, 300}, {D6, 300}, {G5, 600},
{E6, 300}, {E6, 300}, {F6, 300}, {G6, 300}, {G6, 300}, {F6, 300}, {E6, 300}, {D6, 300},
{C6, 300}, {C6, 300}, {D6, 300}, {E6, 300}, {D6, 450}, {C6, 150}, {C6, 600}, TUNE_END
}

Beethoven, Ode to Joy, full theme (public domain)

Definition at line 105 of file buzzer_tunes.c.

◆ tune_startup

const struct buzzer_note tune_startup[]
static
Initial value:
= {
{C6, 120}, {E6, 120}, {G6, 120}, {C7, 360}, TUNE_END
}

Short rising arpeggio.

Definition at line 100 of file buzzer_tunes.c.

◆ tune_twinkle

const struct buzzer_note tune_twinkle[]
static
Initial value:
= {
{C6, 300}, {C6, 300}, {G6, 300}, {G6, 300}, {A6, 300}, {A6, 300}, {G6, 600},
{F6, 300}, {F6, 300}, {E6, 300}, {E6, 300}, {D6, 300}, {D6, 300}, {C6, 600},
{G6, 300}, {G6, 300}, {F6, 300}, {F6, 300}, {E6, 300}, {E6, 300}, {D6, 600},
{G6, 300}, {G6, 300}, {F6, 300}, {F6, 300}, {E6, 300}, {E6, 300}, {D6, 600},
{C6, 300}, {C6, 300}, {G6, 300}, {G6, 300}, {A6, 300}, {A6, 300}, {G6, 600},
{F6, 300}, {F6, 300}, {E6, 300}, {E6, 300}, {D6, 300}, {D6, 300}, {C6, 600}, TUNE_END
}

Twinkle Twinkle Little Star, full song (public domain)

Definition at line 117 of file buzzer_tunes.c.

◆ tune_william_tell

const struct buzzer_note tune_william_tell[]
static
Initial value:
= {
{G6, 100}, {G6, 100}, {G6, 200}, {G6, 100}, {G6, 100}, {G6, 200},
{G6, 100}, {G6, 100}, {C7, 200}, {D7, 200}, {E7, 400}, {REST, 200},
{G6, 100}, {G6, 100}, {G6, 200}, {G6, 100}, {G6, 100}, {G6, 200},
{G6, 100}, {G6, 100}, {C7, 200}, {D7, 200}, {E7, 400}, {C7, 600}, TUNE_END
}
#define E7

Rossini, William Tell Overture, galop opening, played twice (public domain)

Definition at line 249 of file buzzer_tunes.c.