Generate an accompaniement for a given melody
|
Describe the key of a melody. More...
#include <Music.hpp>
Public Member Functions | |
Key (const CompleteNoteName &base=CompleteNoteName(), const NoteName &mode=NoteName::C) | |
Constructor from a CompleteNoteName for the base and a NoteName for the mode. More... | |
std::vector< CompleteNoteName > | getNotes () const |
Transform a key into the list of its seven notes. More... | |
void | normalize (CompleteNoteName &c) const |
Change the note (given as a reference) to get the notation corresponding to the key. More... | |
bool | operator== (const Key &k) const __attribute__((pure)) |
equality operator for Key More... | |
bool | operator!= (const Key &k) const __attribute__((pure)) |
inequality operator for Key More... | |
Public Attributes | |
CompleteNoteName | m_base |
Base note of the key. | |
NoteName | m_mode |
Mode of the key. | |
Describe the key of a melody.
The key is composed of the name of the base note (first of the scale) and the mode, which defines the intervals between the notes.
Key::Key | ( | const CompleteNoteName & | base = CompleteNoteName() , |
const NoteName & | mode = NoteName::C |
||
) |
Constructor from a CompleteNoteName for the base and a NoteName for the mode.
std::vector<CompleteNoteName> Key::getNotes | ( | ) | const |
Transform a key into the list of its seven notes.
void Key::normalize | ( | CompleteNoteName & | c | ) | const |
Change the note (given as a reference) to get the notation corresponding to the key.
c | is the note to normalize |