Generate an accompaniement for a given melody
|
Describe a note with its absolute pitch. More...
#include <Music.hpp>
Public Member Functions | |
Pitch (const CompleteNoteName &n, Octave o=4) | |
Construtor for Pitch with a CompleteNotename. More... | |
Pitch (NoteName n=NoteName::C, Accidental mod=Accidental::None, Octave o=4) | |
Construtor for Pitch with full info If the note is A Flat, and octave o, it means it is a G Sharp at octave o. More... | |
Pitch & | operator+= (int nb) |
Adds half tones to pitch. More... | |
Pitch | operator+ (int nb) const __attribute__((pure)) |
Creates new Pitch by adding nb half tones to this one. More... | |
Pitch & | operator-= (int nb) |
Substract half tones to pitch. More... | |
Pitch | operator- (int nb) const __attribute__((pure)) |
Creates new Pitch by substracting nb half tones to this one. More... | |
bool | operator== (const Pitch &o) const __attribute__((pure)) |
Comparison operator for Pitch done. | |
bool | operator!= (const Pitch &o) const __attribute__((pure)) |
Difference operator for Pitch done. | |
CompleteNoteName | getNoteName () const __attribute__((pure)) |
Returns the name of the note, ommiting the octave. More... | |
Public Member Functions inherited from CompleteNoteName | |
CompleteNoteName (NoteName n=NoteName::C, Accidental mod=Accidental::None) | |
Constructor for CompleteNoteName. More... | |
bool | operator== (const CompleteNoteName &o) const __attribute__((pure)) |
Comparison operator for CompleteNoteName. More... | |
bool | operator!= (const CompleteNoteName &o) const __attribute__((pure)) |
Difference operator for CompleteNoteName. More... | |
Public Attributes | |
Octave | m_octave |
octave of the note (absolute height of the note) | |
Public Attributes inherited from CompleteNoteName | |
NoteName | m_name |
Name of the note (C,D,...) | |
Accidental | m_modifier |
Accidental of the note (sharp, flat,none) | |
Describe a note with its absolute pitch.
Pitch::Pitch | ( | const CompleteNoteName & | n, |
Octave | o = 4 |
||
) |
Construtor for Pitch with a CompleteNotename.
Pitch::Pitch | ( | NoteName | n = NoteName::C , |
Accidental | mod = Accidental::None , |
||
Octave | o = 4 |
||
) |
Construtor for Pitch with full info If the note is A Flat, and octave o, it means it is a G Sharp at octave o.
CompleteNoteName Pitch::getNoteName | ( | ) | const |
Returns the name of the note, ommiting the octave.
Pitch Pitch::operator+ | ( | int | nb | ) | const |
Pitch& Pitch::operator+= | ( | int | nb | ) |
Adds half tones to pitch.
nb | the number of half tones to add |
std::domain_error | if the result is bellow the lowest representable note done |
Pitch Pitch::operator- | ( | int | nb | ) | const |
Pitch& Pitch::operator-= | ( | int | nb | ) |
Substract half tones to pitch.
nb | the number of half tones to substract |
std::domain_error | if the result is bellow the lowest representable note done |