Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
CADiatonicKey Class Reference

Musical key. More...

#include <diatonickey.h>

List of all members.

Public Types

enum  CAGender { Major, Minor }
enum  CAShape { Natural, Harmonic, Melodic }

Public Member Functions

 CADiatonicKey ()
 CADiatonicKey (const QString &key)
 CADiatonicKey (const int &numberOfAccs, const CAGender &gender)
 CADiatonicKey (const CADiatonicPitch &pitch, const CAGender &gender)
 CADiatonicKey (const CADiatonicPitch &pitch, const CAGender &gender, const CAShape &shape)
bool operator== (CADiatonicKey)
bool operator!= (CADiatonicKey p)
void operator= (const QString &key)
CADiatonicKey operator+ (CAInterval)
CADiatonicPitch diatonicPitch ()
const CAGender gender ()
const CAShape shape ()
void setDiatonicPitch (const CADiatonicPitch p)
void setGender (const CAGender g)
void setShape (const CAShape s)
int numberOfAccs ()
QList< int > accsMatrix ()
int noteAccs (int noteName)

Static Public Member Functions

static const QString shapeToString (CAShape)
static CAShape shapeFromString (const QString)
static const QString genderToString (CAGender)
static CAGender genderFromString (const QString)
static const QString diatonicKeyToString (CADiatonicKey k)
static CADiatonicKey diatonicKeyFromString (const QString)

Private Attributes

CADiatonicPitch _diatonicPitch
CAGender _gender
CAShape _shape

Detailed Description

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 CADiatonicPitch

Member Enumeration Documentation

The lower tetrachord of the scale - gender:

  • Major
  • Minor
Enumerator:
Major 
Minor 

The upper tetrachord of the scale - shape:

  • Natural
  • Harmonic
  • Melodic
Enumerator:
Natural 
Harmonic 
Melodic 

Constructor & Destructor Documentation

References Major, Natural, setDiatonicPitch(), setGender(), and setShape().

Referenced by diatonicKeyFromString(), and operator+().

Here is the call graph for this function:

Here is the caller graph for this function:

CADiatonicKey::CADiatonicKey ( const QString &  key)

References operator=().

Here is the call graph for this function:

CADiatonicKey::CADiatonicKey ( const int &  numberOfAccs,
const CAGender gender 
)

References Major, Minor, Natural, setDiatonicPitch(), setGender(), and setShape().

Here is the call graph for this function:

References Harmonic, Major, Natural, setDiatonicPitch(), setGender(), and setShape().

Here is the call graph for this function:

References setDiatonicPitch(), setGender(), and setShape().

Here is the call graph for this function:


Member Function Documentation

QList< int > CADiatonicKey::accsMatrix ( )

Returns a list of accs from C to B for the key signature.

References numberOfAccs().

Referenced by noteAccs().

Here is the call graph for this function:

Here is the caller graph for this function:

Creates a new diatonic key from the given string.

References CADiatonicKey().

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

References Major, and Minor.

Referenced by CAMusicXmlImport::readAttributes(), and CACanorusMLImport::startElement().

Here is the caller graph for this function:

const QString CADiatonicKey::genderToString ( CAGender  gender) [static]

References Major, and Minor.

Referenced by CACanorusMLExport::exportDiatonicKey().

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool CADiatonicKey::operator!= ( CADiatonicKey  p) [inline]

References operator==().

Here is the call graph for this function:

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

Here is the call graph for this function:

void CADiatonicKey::operator= ( const QString &  key)

References gender(), Harmonic, Major, Minor, Natural, setDiatonicPitch(), setGender(), and setShape().

Referenced by CADiatonicKey().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CADiatonicKey::operator== ( CADiatonicKey  k)

References diatonicPitch(), and gender().

Referenced by operator!=().

Here is the call graph for this function:

Here is the caller graph for this function:

References _diatonicPitch.

Referenced by CADiatonicKey(), CACanorusMLImport::endElement(), and operator=().

Here is the caller graph for this function:

void CADiatonicKey::setGender ( const CAGender  g) [inline]

References _gender.

Referenced by CADiatonicKey(), and operator=().

Here is the caller graph for this function:

void CADiatonicKey::setShape ( const CAShape  s) [inline]

References _shape.

Referenced by CADiatonicKey(), and operator=().

Here is the caller graph for this function:

References _shape.

Referenced by operator+().

Here is the caller graph for this function:

References Harmonic, Melodic, and Natural.

const QString CADiatonicKey::shapeToString ( CAShape  shape) [static]

References Harmonic, Melodic, and Natural.


Member Data Documentation

Referenced by diatonicPitch(), and setDiatonicPitch().

Referenced by gender(), and setGender().

Referenced by setShape(), and shape().


The documentation for this class was generated from the following files: