Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

NotationDisplayPitch Class Reference

List of all members.

Detailed Description

NotationDisplayPitch stores a note's pitch in terms of the position of the note on the staff and its associated accidental, and converts these values to and from performance (MIDI) pitches.

Rationale: When we insert a note, we need to query the height of the staff line next to which it's being inserted, then translate this back to raw pitch according to the clef in force at the x-coordinate at which the note is inserted. For display, we translate from raw pitch using both the clef and the key in force.

Whether an accidental should be displayed or not depends on the current key, on whether we've already shown the same accidental for that pitch in the same bar, on whether the note event explicitly requests an accidental... All we calculate here is whether the pitch "should" have an accidental, not whether it really will (e.g. if the accidental has already appeared).

(See also docs/discussion/units.txt for explanation of pitch units.)

Definition at line 41 of file pitch.cpp.

Public Member Functions

Accidental getAccidental () const
std::string getAsString (const Clef &clef, const Key &key, bool inclOctave=true, int octaveBase=-2) const
int getHeightOnStaff () const
void getInScale (const Clef &clef, const Key &key, int &placeInScale, int &accidentals, int &octave) const
int getPerformancePitch (const Clef &clef, const Key &key) const
int getPerformancePitchFromRG21Pitch (const Clef &clef, const Key &key) const
 NotationDisplayPitch (int pitch, const Clef &clef, const Key &key, const Accidental &explicitAccidental=Accidentals::NoAccidental)
 NotationDisplayPitch (int heightOnStaff, const Accidental &accidental)

Static Private Member Functions

static void displayPitchToRawPitch (int, Accidental, const Clef &, const Key &, int &, bool ignoreOffset=false)
static void rawPitchToDisplayPitch (int, const Clef &, const Key &, int &, Accidental &)

Private Attributes

Accidental m_accidental
int m_heightOnStaff

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

Generated by  Doxygen 1.6.0   Back to index