Generate an accompaniement for a given melody
|
Describe a chord. More...
#include <Music.hpp>
Public Types | |
enum | ChordType { ChordType::Minor, ChordType::Major, ChordType::Sus4, ChordType::Sus2, ChordType::Dim, ChordType::Aug } |
Describes the type of the third note in the chord. More... | |
enum | SeventhType { Major, Minor, Dim, None } |
Describes the Type of the fourth note of the chord. More... | |
using | ChordID = unsigned |
Public Member Functions | |
std::vector< CompleteNoteName > | getNotes () const __attribute__((pure)) |
transform a chord into notes More... | |
Chord (Fraction d=4, const CompleteNoteName &b=CompleteNoteName(), const SeventhType &s=SeventhType::None, const ChordType &c=ChordType::Major) | |
Constructor with parameters. More... | |
bool | operator== (const Chord &o) const __attribute__((pure)) |
Equality operator for Chord. More... | |
bool | operator!= (const Chord &o) const __attribute__((pure)) |
Inequality operator for Chord. More... | |
Chord (ChordID id) | |
operator ChordID () const | |
Static Public Member Functions | |
static const std::vector < CompleteNoteName > & | getNotes (ChordID c) |
Public Attributes | |
Fraction | m_duration |
Hold the duration of the chord, in fraction of the bar it is played in. SHOULD BE DELETED ? | |
CompleteNoteName | m_base |
Name of the base name of the note. | |
SeventhType | m_seventh |
if it's not None, the seventh is added according to this value (Dim = double Flat) | |
ChordType | m_type |
Type of the chord. | |
Static Public Attributes | |
static const unsigned | nbChords = 6*4*12 |
Describe a chord.
A chord is characterized by a base note, a duration (fraction of the measure) and some alteration.
|
strong |
Describes the type of the third note in the chord.
|
strong |
Describes the Type of the fourth note of the chord.
Describe the nature of the chord.
By default, a chord is a triad composed of a base note, a third, and a fifth over it.
Chord::Chord | ( | Fraction | d = 4 , |
const CompleteNoteName & | b = CompleteNoteName() , |
||
const SeventhType & | s = SeventhType::None , |
||
const ChordType & | c = ChordType::Major |
||
) |
Constructor with parameters.
d | Duration of the chord, in fraction of the bar it is played in. |
b | Name of the base name of the note |
s | Type of the seventh |
c | Type of the chord |
std::vector<CompleteNoteName> Chord::getNotes | ( | ) | const |
transform a chord into notes