|
maiacore 1.10.1
Music analisys library
|
Represents a musical key signature (tonality), including circle of fifths and mode (major/minor). More...
#include <key.h>
Public Member Functions | |
| Key (int fifthCircle=0, bool isMajorMode=true) | |
| Constructs a Key from a fifth circle value and mode. More... | |
| Key (const std::string &key) | |
| Constructs a Key from a key name string (e.g., "C", "Gm"). More... | |
| void | setFifthCircle (int fifthCircle) |
| Sets the fifth circle value (number of accidentals). More... | |
| int | getFifthCircle () const |
| Returns the fifth circle value (number of accidentals). More... | |
| void | setIsMajorMode (bool isMajorMode) |
| Sets the mode of the key (major or minor). More... | |
| int | isMajorMode () const |
| Returns true if the key is major, false if minor. More... | |
| std::string | getName () const |
| Returns the key name as a string (e.g., "C", "Gm"). More... | |
| std::string | getRelativeKeyName () const |
| Returns the relative key name (e.g., for C major returns "Am", for Am returns "C"). More... | |
Represents a musical key signature (tonality), including circle of fifths and mode (major/minor).
The Key class provides methods for setting and querying the key signature, including conversion between fifth circle values, key names, and relative keys. It is designed for music analysis, computational musicology, and MusicXML processing.
| Key::Key | ( | int | fifthCircle = 0, |
| bool | isMajorMode = true |
||
| ) |
Constructs a Key from a fifth circle value and mode.
| fifthCircle | Number of accidentals in the circle of fifths (-6 to +11). |
| isMajorMode | True for major mode, false for minor mode. |
| Key::Key | ( | const std::string & | key | ) |
| int Key::getFifthCircle | ( | ) | const |
Returns the fifth circle value (number of accidentals).
| std::string Key::getName | ( | ) | const |
Returns the key name as a string (e.g., "C", "Gm").
| std::string Key::getRelativeKeyName | ( | ) | const |
Returns the relative key name (e.g., for C major returns "Am", for Am returns "C").
| int Key::isMajorMode | ( | ) | const |
Returns true if the key is major, false if minor.
| void Key::setFifthCircle | ( | int | fifthCircle | ) |
Sets the fifth circle value (number of accidentals).
| fifthCircle | Number of accidentals (-6 to +11). |
| void Key::setIsMajorMode | ( | bool | isMajorMode | ) |
Sets the mode of the key (major or minor).
| isMajorMode | True for major, false for minor. |