Generate an accompaniement for a given melody
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Key Struct Reference

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< CompleteNoteNamegetNotes () 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

Key::Key ( const CompleteNoteName base = CompleteNoteName(),
const NoteName mode = NoteName::C 
)

Constructor from a CompleteNoteName for the base and a NoteName for the mode.

Note
done

Member Function Documentation

std::vector<CompleteNoteName> Key::getNotes ( ) const

Transform a key into the list of its seven notes.

Returns
A vector of CompleteNoteName containing the seven notes of the key
Note
done
void Key::normalize ( CompleteNoteName c) const

Change the note (given as a reference) to get the notation corresponding to the key.

Parameters
cis the note to normalize
Note
work in progress
bool Key::operator!= ( const Key k) const

inequality operator for Key

Note
done
bool Key::operator== ( const Key k) const

equality operator for Key

Note
done

The documentation for this struct was generated from the following file: