FastArduino  v1.8
C++ library to build fast but small Arduino/AVR projects
tone_player.h File Reference

API to handle melody playing (tones as simple square waves) to a buzzer. More...

#include "../eeprom.h"
#include "../flash.h"
#include "tones.h"
Include dependency graph for tone_player.h:

Go to the source code of this file.

Classes

class  devices::audio::TonePlay
 This struct is the unit data manipulated by TonePlayer: it describes one Tone along with its duration in milliseconds. More...
 
class  devices::audio::QTonePlay< NTIMER, OUTPUT >
 An optimized surrogate to TonePlay structure. More...
 
class  devices::audio::AbstractTonePlayer< NTIMER, OUTPUT, TONEPLAY >
 This low-level API defines an abstract player of melodies (defined as a sequence of tones and durations). More...
 
class  devices::audio::TonePlayer< NTIMER, OUTPUT, TONEPLAY >
 This API defines a player of melodies, defined as a sequence of tones and durations. More...
 
class  devices::audio::AsyncTonePlayer< NTIMER, OUTPUT, TONEPLAY >
 This API defines a player of melodies, defined as a sequence of tones and durations. More...
 

Namespaces

 devices
 Defines all API for all external devices supported by FastArduino.
 
 devices::audio
 Defines API for audio tones (square waves) generation and simple melodies playing.
 
 devices::audio::SpecialTone
 This namespace defines special "tones" which have an impact on how to play a melody.
 

Enumerations

enum  devices::audio::Duration : uint8_t {
  devices::audio::Duration::WHOLE = 32,
  devices::audio::Duration::HALF = 16,
  devices::audio::Duration::QUARTER = 8,
  devices::audio::Duration::EIGHTH = 4,
  devices::audio::Duration::SIXTEENTH = 2,
  devices::audio::Duration::SEMI_BREVE = WHOLE,
  devices::audio::Duration::MINIM = HALF,
  devices::audio::Duration::CROTCHET = QUARTER,
  devices::audio::Duration::QUAVER = EIGHTH,
  devices::audio::Duration::SEMI_QUAVER = SIXTEENTH
}
 Possible duration of a note, following music theory. More...
 

Functions

static constexpr Duration devices::audio::dotted (Duration d)
 Transforms a note duration to its dotted value (1.5 times the given duration).
 
static constexpr Duration devices::audio::triplet (Duration d)
 Transforms a note duration to allow it to use in a triplet.
 

Variables

static constexpr const Tone devices::audio::SpecialTone::END = Tone::USER0
 This special tone marks the end of a melody (as a sequence of Tones).
 
static constexpr const Tone devices::audio::SpecialTone::REPEAT_START = Tone::USER1
 This special tone marks the beginning of sequence that shall be repeated later. More...
 
static constexpr const Tone devices::audio::SpecialTone::REPEAT_END = Tone::USER2
 This special tone marks the end of a repeating sequence (started with REPEAT_START). More...
 
static constexpr const Tone devices::audio::SpecialTone::TIE = Tone::USER3
 This special tone marks the following notes to be tied together, ie their durations are added with no intertone delay. More...
 
static constexpr const Tone devices::audio::SpecialTone::SLUR = TIE
 This special tone marks the following notes to be slurred together, ie no intertone delay shall occur between these notes. More...
 

Detailed Description

API to handle melody playing (tones as simple square waves) to a buzzer.

Definition in file tone_player.h.