Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | Related Pages

TKey Class Reference

Represents a key signature. More...

#include <TKey.h>

Inheritance diagram for TKey:

visitable smartable List of all members.

Public Types

enum  { undefined = -1 }
enum  {
  major = 1, minor, dorian, phrygian,
  lydian, mixolydian, aeolian, ionian,
  locrian, last = locrian
}

Public Member Functions

void setCancel (long cancel)
void setFifths (long fifths)
void setMode (long mode)
long getCancel () const
long getFifths () const
long getMode () const
virtual void accept (TScoreVisitor &visitor)

Static Public Member Functions

const string xmlmode (int d)
 convert an integer mode to a MusicXML string

int xmlmode (const string str)
 convert an MusicXML string to an integer mode


Friends

EXP friend SMARTP< TKeynewKey ()

Detailed Description

Traditional key signatures are represented by the number of flats and sharps, plus an optional mode for major/ minor/mode distinctions. Negative numbers are used for flats and positive numbers for sharps, reflecting the key's placement within the circle of fifths (hence the element name). A cancel element indicates that the old key signature should be cancelled before the new one appears. This will always happen when changing to C major or A minor and need not be specified then. The cancel value matches the fifths value of the cancelled key signature (e.g., a cancel of -2 will provide an explicit cancellation for changing from B flat major to F major).
Non-traditional key signatures can be represented using the Humdrum/Scot concept of a list of altered tones. The key-step and key-alter elements are represented the same way as the step and alter elements are in the pitch element in note.dtd. The different element names indicate the different meaning of altering notes in a scale versus altering a sounding pitch.
Valid mode values include major, minor, dorian, phrygian, lydian, mixolydian, aeolian, ionian, and locrian.
TKey corresponds to the MusicXML key element as defined in attributes.dtd.


Generated on Tue Mar 23 09:50:05 2004 for LibMusicXML by doxygen 1.3.3