|
Canorus
0.7
|
Musical key. More...
#include <diatonickey.h>
Musical key.
Copyright (c) 2008, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
Copyright (c) 2008, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
This is a typical music presentation of the key.
For example, C-major, d-minor, e-flat-minor etc.
It consists of two properties:
- diatonic pitch (cis, des etc.)
- gender (major, minor etc.)
Valid range of diatonic pitch for the diatonic key is a positive
number ranging from 0 (C) to 6 (B).
\sa CADiatonicPitchReferences Major, Natural, setDiatonicPitch(), setGender(), and setShape().
Referenced by diatonicKeyFromString(), and operator+().


| CADiatonicKey::CADiatonicKey | ( | const QString & | key | ) |
| CADiatonicKey::CADiatonicKey | ( | const int & | numberOfAccs, |
| const CAGender & | gender | ||
| ) |
References Major, Minor, Natural, setDiatonicPitch(), setGender(), and setShape().

| CADiatonicKey::CADiatonicKey | ( | const CADiatonicPitch & | pitch, |
| const CAGender & | gender | ||
| ) |
References Harmonic, Major, Natural, setDiatonicPitch(), setGender(), and setShape().

| CADiatonicKey::CADiatonicKey | ( | const CADiatonicPitch & | pitch, |
| const CAGender & | gender, | ||
| const CAShape & | shape | ||
| ) |
References setDiatonicPitch(), setGender(), and setShape().

| QList< int > CADiatonicKey::accsMatrix | ( | ) |
Returns a list of accs from C to B for the key signature.
References numberOfAccs().
Referenced by noteAccs().


| CADiatonicKey CADiatonicKey::diatonicKeyFromString | ( | const QString | s | ) | [static] |
Creates a new diatonic key from the given string.
References CADiatonicKey().

| const QString CADiatonicKey::diatonicKeyToString | ( | CADiatonicKey | k | ) | [static] |
Generates a readable name of the diatonic key. eg. -3 accidentals & major => "Es" +6 accidentals & minor => "dis"
References gender(), Major, Minor, and numberOfAccs().
Referenced by CAMusElementFactory::configureFunctionMark(), CAMainWin::on_uiKeySig_activated(), and CAEngraver::reposit().


| CADiatonicPitch CADiatonicKey::diatonicPitch | ( | ) | [inline] |
References _diatonicPitch.
Referenced by CACanorusMLExport::exportDiatonicKey(), CALilyPondExport::exportVoiceImpl(), CAKeybdInput::matchPitchToKey(), numberOfAccs(), operator+(), operator==(), and CATranspose::transposeByKeySig().

| const CAGender CADiatonicKey::gender | ( | ) | [inline] |
References _gender.
Referenced by CADrawableKeySignature::diatonicKeyToRow(), diatonicKeyToString(), CACanorusMLExport::exportDiatonicKey(), CALilyPondExport::exportVoiceImpl(), numberOfAccs(), CAMainWin::on_uiKeySig_activated(), operator+(), operator=(), and operator==().

| CADiatonicKey::CAGender CADiatonicKey::genderFromString | ( | const QString | gender | ) | [static] |
Referenced by CAMusicXmlImport::readAttributes(), and CACanorusMLImport::startElement().

| const QString CADiatonicKey::genderToString | ( | CAGender | gender | ) | [static] |
| int CADiatonicKey::noteAccs | ( | int | noteName | ) |
Returns number of accidentals for the given note. Eg. If we call noteAccs(17) in D-Major, it returns 1, because 17 is a note F and D-Major has Fis.
References accsMatrix().
Referenced by CAMainWin::scoreViewPortKeyPress().


| int CADiatonicKey::numberOfAccs | ( | ) |
References CADiatonicPitch::accs(), diatonicPitch(), gender(), Major, and CADiatonicPitch::noteName().
Referenced by accsMatrix(), CADrawableKeySignature::diatonicKeyToRow(), diatonicKeyToString(), CAMainWin::on_uiKeySig_activated(), and CAKeySignature::updateAccidentals().


| bool CADiatonicKey::operator!= | ( | CADiatonicKey | p | ) | [inline] |
| CADiatonicKey CADiatonicKey::operator+ | ( | CAInterval | interval | ) |
Transposes the key for the given interval. The new pitch is correctly bounded.
References CADiatonicKey(), diatonicPitch(), gender(), CADiatonicPitch::noteName(), CADiatonicPitch::setNoteName(), and shape().

| void CADiatonicKey::operator= | ( | const QString & | key | ) |
References gender(), Harmonic, Major, Minor, Natural, setDiatonicPitch(), setGender(), and setShape().
Referenced by CADiatonicKey().


| bool CADiatonicKey::operator== | ( | CADiatonicKey | k | ) |
References diatonicPitch(), and gender().
Referenced by operator!=().


| void CADiatonicKey::setDiatonicPitch | ( | const CADiatonicPitch | p | ) | [inline] |
References _diatonicPitch.
Referenced by CADiatonicKey(), CACanorusMLImport::endElement(), and operator=().

| void CADiatonicKey::setGender | ( | const CAGender | g | ) | [inline] |
References _gender.
Referenced by CADiatonicKey(), and operator=().

| void CADiatonicKey::setShape | ( | const CAShape | s | ) | [inline] |
References _shape.
Referenced by CADiatonicKey(), and operator=().

| const CAShape CADiatonicKey::shape | ( | ) | [inline] |
| CADiatonicKey::CAShape CADiatonicKey::shapeFromString | ( | const QString | shape | ) | [static] |
| const QString CADiatonicKey::shapeToString | ( | CAShape | shape | ) | [static] |
CADiatonicPitch CADiatonicKey::_diatonicPitch [private] |
Referenced by diatonicPitch(), and setDiatonicPitch().
CAGender CADiatonicKey::_gender [private] |
Referenced by gender(), and setGender().
CAShape CADiatonicKey::_shape [private] |
Referenced by setShape(), and shape().
1.8.0