FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
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::Beat
 This embeds minimum duration (duration of a 32nd note), in milliseconds, for a given tempo (beats per minute). 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

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

Enumerations

enum class  devices::audio::Duration : uint8_t {
  devices::audio::WHOLE = 32 ,
  devices::audio::HALF = 16 ,
  devices::audio::QUARTER = 8 ,
  devices::audio::EIGHTH = 4 ,
  devices::audio::SIXTEENTH = 2 ,
  devices::audio::SEMI_BREVE = WHOLE ,
  devices::audio::MINIM = HALF ,
  devices::audio::CROTCHET = QUARTER ,
  devices::audio::QUAVER = EIGHTH ,
  devices::audio::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). More...
 
static constexpr Duration devices::audio::triplet (Duration d)
 Transforms a note duration to allow it to use in a triplet. More...
 

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). More...
 
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.