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

MeasureMusic Class Reference
[Core Musical Objects]

This class represent the Musical concept of a measure. It has a note container which is the aggregate of all the notes. By the implementation there is a limited number of staves for a part to 12 staves. This is not bad ! warning :If you change the tuplet define value chack that it is consistant with the tuplet marker define This class is far too long, it would be a good thing if it was splitted it some managers for instance : More...

#include <MeasureMC.h>

Inheritance diagram for MeasureMusic:

MusicObject List of all members.

Public Member Functions

 MeasureMusic (QString part)
void setMeasureSectionIndex (int)
bool isTacitNbStaves ()
int getNbStaves ()
void setNbStaves (int n)
void setId (int)
QPtrList< AttributesMusicgetTimedAttributes ()
StaffMusicgetStaff (int)
bool hasAttributes ()
void backup (int)
void forward (int, int, int)
NoteContainer getNoteContainer ()
void setAttributes (AttributesMusic *)
void addTimedAttributes (AttributesMusic *)
AttributesMusicgetAttributes ()
void insert (NoteMusic *, bool isChord)
void insertDirection (DirectionMC *)
void tacitAttributes ()
int * getCurrentShiftClef ()
void setCurrentShiftClef (int *)
void setImplicitAlterationPitch (ImplicitAlterationList)
ImplicitAlterationList getImplicitAlterationPitch ()
int getCurrentPosition ()
bool isTacitAttributes ()
int getUTotalDivisions ()
int getLTotalDivisions ()
void startTuplet ()
void stopTuplet ()
QPtrList< NoteMusicgetChordNotes (NoteMusic *)
StemGroupsMC getStemGroups ()
 In that method we introduce the rules for building StemGroups.

QString toString ()
void debugStemGroups ()
QPtrList< DirectionMCgetDirections ()
int getWeight (NoteMusic *)

Public Attributes

QString part

Detailed Description

This class represent the Musical concept of a measure. It has a note container which is the aggregate of all the notes. By the implementation there is a limited number of staves for a part to 12 staves. This is not bad ! warning :If you change the tuplet define value chack that it is consistant with the tuplet marker define This class is far too long, it would be a good thing if it was splitted it some managers for instance :


Constructor & Destructor Documentation

MeasureMusic::MeasureMusic QString  pa  ) 
 

By default a measure will have at least 1 staff Build a measure with n staves


Member Function Documentation

void MeasureMusic::addTimedAttributes AttributesMusic att  ) 
 

This add a timed attibutes

void MeasureMusic::backup int  i  ) 
 

This set the measure current position back of the quantity specified in duration I had the following prevention to illogical behavior that if the current position computed is lower than 0 I set it to 0 if the value of the backup is -1 like it happens when it is empty we do the same thing

Parameters:
i the duration of the backup

void MeasureMusic::debugStemGroups  ) 
 

This method display the stemGroups of a measure it is usefull for a debbugging purpose

void MeasureMusic::forward int  i,
int  st,
int  voice
 

This set the measure current position forward of the quantity specified in duration

Parameters:
i the duration forward
st the staff number it apply to (unused at this time)
voice the voice number it apply to (unused at this time)

QPtrList< NoteMusic > MeasureMusic::getChordNotes NoteMusic nm  ) 
 

Parameters:
note the note we are looking for chorded notes
Returns:
a list of chorded notes to the the arg note

int MeasureMusic::getCurrentPosition  ) 
 

This function is used when parsing time attributes. In that case we must know the position of the last note appended.

Returns:
the current position.

int * MeasureMusic::getCurrentShiftClef  ) 
 

Used for the retrieving the current shit clef from the preceding measure

Returns:
the currentShit clef.

QPtrList< DirectionMC > MeasureMusic::getDirections  ) 
 

Returns:
the directions in the measure

ImplicitAlterationList MeasureMusic::getImplicitAlterationPitch  ) 
 

Get the implicit atleration pitch

int MeasureMusic::getLTotalDivisions  ) 
 

Returns:
the Local (part) time measurement unit total number of divisions in the measure

If total divisions is 0 this mean we have no time measure attribute defined so we get the maximum time among the sorted notes.

int MeasureMusic::getNbStaves  ) 
 

Returns:
the number of staves

NoteContainer MeasureMusic::getNoteContainer  ) 
 

See why the method is called twice

Returns:
the sorted Notes

StaffMusic * MeasureMusic::getStaff int  i  ) 
 

Returns:
the staff at i

StemGroupsMC MeasureMusic::getStemGroups  ) 
 

In that method we introduce the rules for building StemGroups.

There are many rules

  • A group is caracterized by a weight. The weight is a measure multiple in a / Measure the weight are 1 2 4 8 those weight are a concept that let think of several notes as a unit ( stem group) The basic rule is
  • If a note cannot be stemmed then the current stem group ends.
  • If a lower weight stem group starts then the current stem group ends.
  • If a stem group contains several duration. The preceding rule cannot be overrided
  • If a stem group contains only duration then the stem group can continue
  • If the direction of the note is not the same and the staves are the same then the group break. (Except if the separation beetween notes is important but this rules is not implemented)
    Returns:
    the stem groups of this measure.
    This function doesn't build correctly the tuplet if they are not defined in the XML. Maybe this would be a nice extension if they could also be build if not specified in the XML.

At last we append the tuplets and other special stem group forms

QPtrList< AttributesMusic > MeasureMusic::getTimedAttributes  ) 
 

Returns:
the timed attributes I.e the attributes that does not start at the beginning of the measure

int MeasureMusic::getUTotalDivisions  ) 
 

Returns:
the Universal (part) time measurement unit total number of divisions in the measure the second test wont work any way because it mixes Universal time an local time fix it !

If total divisions is 0 this mean we have no time measure attribute defined so we get the maximum time among the sorted notes.

int MeasureMusic::getWeight NoteMusic n  ) 
 

The weight is :

  • 1 for the start of the mesure
  • 2 for the middle of the measure
  • 3 for the third or 2/3 of the measure if it is a 3 time measure
  • 4 for a quarter start
  • 8 for an eight start
  • etc. According to the time signature of the measure, those weight can change. It browse the sorted notes.
    Returns:
    the weight of a note. in error case it 10000
    See also:
    computeWeights

bool MeasureMusic::hasAttributes  ) 
 

return true if the mesure has some attributes

void MeasureMusic::insert NoteMusic m,
bool  isChord
 

Insert the note music m at staff staff. This method perform some specials for :

  • Chorded note
  • Tuplets note
  • Also it set the Note property of the height.
    Parameters:
    m 
    staff 

Traitement des alterations

If note belongs to a chord then it has the same startPosition as the las note we have inserted

void MeasureMusic::insertDirection DirectionMC direction  ) 
 

This insert a direction

bool MeasureMusic::isTacitAttributes  ) 
 

Make the attributes not displayed

bool MeasureMusic::isTacitNbStaves  ) 
 

Returns:
false if the measure has been set with a number of staves

void MeasureMusic::setAttributes AttributesMusic att  ) 
 

This set the attributes of the measure.

Parameters:
nstaff number of the staff

void MeasureMusic::setCurrentShiftClef int *  csc  ) 
 

Used for the setting the current shit clef from the next measure

void MeasureMusic::setId int  i  ) 
 

Set the measure Id.

The id should be sequentially correct. For instance, a measure 2 cannot be played before a measure of id 1

Warning : The id of the measure does not correspond to the id. property specified in the XML. This is beacuse the id of the XML hjas no constraint to be sequential.

void MeasureMusic::setImplicitAlterationPitch ImplicitAlterationList  p  ) 
 

Set the implicit atleration pitch

void MeasureMusic::setMeasureSectionIndex int  msi  ) 
 

This sets the measure section Index Also we set the measure section index of all the note in the measure because the measure is appended AFTER all the notes has been appended to the measure

void MeasureMusic::setNbStaves int  n  ) 
 

This set the number of staves in the measure Maybe the staves container will be deprecated So we'd better try some day to see if commenting this whole method change the rendering.

void MeasureMusic::startTuplet  ) 
 

Starts a tuplet for use with the insert function

void MeasureMusic::stopTuplet  ) 
 

Ends a tuplet, for use whith the tuplet function.

void MeasureMusic::tacitAttributes  ) 
 

Make the attributes not displayed

QString MeasureMusic::toString  ) 
 

String representation of the measure

Returns:
the String representation of the measure


The documentation for this class was generated from the following files:
Generated on Tue Jun 1 21:13:33 2004 for Alternate Take by doxygen 1.3.6