28 #include <csutil/refarr.h> 29 #include <csutil/csstring.h> 30 #include <iutil/document.h> 234 #define DURATION_QUARTER_DIVISIONS 16 279 void NextPitch(
char &pitch, uint &octave);
303 bool GetMeasures(iDocument* score, csRefArray<iDocumentNode> &measures);
330 bool GetAttributes(iDocument* musicalScore,
int &quarterDivisions,
343 bool ZCompressSong(
const csString &inputScore, csString &outputScore);
352 bool ZDecompressSong(
const csString &inputScore, csString &outputScore);
361 bool CheckValidity(iDocument* musicalScore, csRef<iDocumentNode> &partNode);
367 #endif // MUSIC_UTIL_H bool CheckDuration(int duration)
Check wheather the given number of DURATION_QUARTER_DIVISIONS correspond to a specific duration taken...
int nBb
total number of played Bb.
int fifths
tonality as number of sharps (if > 0) or flats (if < 0).
bool GetMeasures(iDocument *score, csRefArray< iDocumentNode > &measures)
Gets the XML nodes representing the measures contained in the musical score.
bool GetStatistics(iDocument *musicalScore, ScoreStatistics &stats)
Returns the statistics of the score.
bool CheckValidity(iDocument *musicalScore, csRef< iDocumentNode > &partNode)
Checks if the given document is a valid musical score and provide the <part> node.
int nNotes
total number of played notes in the score.
ScoreStatistics & operator*=(const int scalar)
Multiplies all statistics concerning number of notes/chords and length for a integer scalar...
float averageDuration
average duration of the score's notes in ms.
bool ZDecompressSong(const csString &inputScore, csString &outputScore)
Decompress a song with the zlib compression algorithm.
Duration GetBiggestDuration(int duration)
Returns the biggest duration that can be represented on the score which is less or equal to the given...
float totalLengthNoRests
total duration of the score in ms excluding rests.
Duration
The number associated to each duration is the number of quarter divisions as specified in DURATION_QU...
float averagePolyphony
average number of notes played at the same time.
int nEb
total number of played Eb.
const ScoreStatistics operator*(const int scalar)
Multiplies all statistics concerning number of notes/chords and length for a integer scalar...
This namespace contains a set of functions that are usefull for the processing of music and musical s...
int nAb
total number of played Ab.
bool ZCompressSong(const csString &inputScore, csString &outputScore)
Compress a song with the zlib compression algorithm.
int nGb
total number of played Gb.
int minimumDuration
duration of the shortest note in the score in ms.
ScoreStatistics & operator-=(const ScoreStatistics &subtrahend)
Subtracts all statistics concerning number of notes/chords and length.
void EnharmonicPitch(char &pitch, int &accidental)
Turns the given pitch into the enharmonic equivalent.
bool GetAttributes(iDocument *musicalScore, int &quarterDivisions, int &fifths, int &beats, int &beatType, int &tempo)
Gets the attributes in the first measure of the given score.
void Reset()
Set all statistics to 0.
float totalLength
total duration of the score in milliseconds.
int nDb
total number of played Db.
ScoreStatistics & operator+=(const ScoreStatistics &addend)
Adds all statistics concerning number of notes/chords and length.
This struct keeps general information about a score.
ScoreStatistics(const ScoreStatistics ©)
Copy constructor.
int maximumPolyphony
maximum number of notes played at the same time.
void PreviousPitch(char &pitch, uint &octave)
Turns the given pitch into the previous one in the scale.
int tempo
tempo of the score.
int nChords
total number of played chords in the score.
ScoreStatistics()
Constructor.
int beatType
beat type of the score.
void NextPitch(char &pitch, uint &octave)
Turns the given pitch into the next one in the scale.