21 namespace metro_private {
22 class MetronomePrivate;
39 : std::runtime_error(msg){};
79 Note(
Timbre timbre,
float frequency,
float volume);
89 Note(std::string triplet);
92 float&
operator[](
size_t index) {
return frames[index]; };
95 const float&
operator[](
size_t index)
const {
return frames[index]; };
101 size_t size() {
return frames.size(); };
107 for (
size_t i = 0; i < ret.
size(); ++i)
108 ret[i] = (*
this)[i] + other[i];
113 std::vector<float> frames;
145 : notes(num_notes){};
189 size_t size() {
return notes.size(); };
192 std::vector<Note> notes;
243 metro_private::MetronomePrivate*
float & operator[](size_t index)
index into underlying vector of floats.
Definition: libmetro.h:92
If anything goes wrong in libmetro, a MetroException is thrown.
Definition: libmetro.h:36
Measure(int num_notes)
Measure constructor.
Definition: libmetro.h:144
void start()
start the loop
FileFormat
Definition: libmetro.h:128
metro namespace contains everything defined in libmetro
Definition: libmetro.h:26
Note operator+(const Note &other)
sum underlying vectors and return new Note
Definition: libmetro.h:104
size_t size()
size of underlying vector of floats.
Definition: libmetro.h:101
Metronome(int bpm)
Metronome constructor.
const float & operator[](size_t index) const
index into underlying vector of floats.
Definition: libmetro.h:95
std::vector< Note > & get_notes()
get a reference to the underlying vector of Notes.
Definition: libmetro.h:186
std::vector< float > & get_frames()
get a reference to the underlying vector of floats.
Definition: libmetro.h:98
Note class.
Definition: libmetro.h:54
Definition: libmetro.h:59
Metronome class.
Definition: libmetro.h:209
Measure class.
Definition: libmetro.h:125
Note & operator[](size_t index)
index into underlying vector of Notes.
Definition: libmetro.h:180
void start_and_loop()
start the loop and block
Definition: libmetro.h:129
Definition: libmetro.h:58
size_t size()
size of underlying vector of Notes.
Definition: libmetro.h:189
const Note & operator[](size_t index) const
index into underlying vector of Notes.
Definition: libmetro.h:183
const float SampleRateHz
Sample rate used throughout libmetro.
Definition: libmetro.h:33
Definition: libmetro.h:130
Timbre
Definition: libmetro.h:57
void add_measure(Measure &measure)
add a measure
Note()
Empty Note constructor.
Definition: libmetro.h:67