Planeshift
Public Member Functions | Public Attributes

ScoreStatistics Struct Reference

This struct keeps general information about a score. More...

#include <musicutil.h>

List of all members.

Public Member Functions

const ScoreStatistics operator* (const int scalar)
 Multiplies all statistics concerning number of notes/chords and length for a integer scalar.
ScoreStatisticsoperator*= (const int scalar)
 Multiplies all statistics concerning number of notes/chords and length for a integer scalar.
ScoreStatisticsoperator+= (const ScoreStatistics &addend)
 Adds all statistics concerning number of notes/chords and length.
ScoreStatisticsoperator-= (const ScoreStatistics &subtrahend)
 Subtracts all statistics concerning number of notes/chords and length.
void Reset ()
 Set all statistics to 0.
 ScoreStatistics (const ScoreStatistics &copy)
 Copy constructor.
 ScoreStatistics ()
 Constructor.

Public Attributes

float averageDuration
 average duration of the score's notes in ms.
float averagePolyphony
 average number of notes played at the same time.
int beatType
 beat type of the score.
int fifths
 tonality as number of sharps (if > 0) or flats (if < 0).
int maximumPolyphony
 maximum number of notes played at the same time.
int minimumDuration
 duration of the shortest note in the score in ms.
int nAb
 total number of played Ab.
int nBb
 total number of played Bb.
int nChords
 total number of played chords in the score.
int nDb
 total number of played Db.
int nEb
 total number of played Eb.
int nGb
 total number of played Gb.
int nNotes
 total number of played notes in the score.
int tempo
 tempo of the score.
float totalLength
 total duration of the score in milliseconds.
float totalLengthNoRests
 total duration of the score in ms excluding rests.

Detailed Description

This struct keeps general information about a score.

All average statistics are computed by using the total length without rests. If the score is empty (or has only rests), the average polyphony and duration are set to 0.

Definition at line 43 of file musicutil.h.


Constructor & Destructor Documentation

ScoreStatistics::ScoreStatistics ( ) [inline]

Constructor.

Initialize all statistics to 0.

Definition at line 50 of file musicutil.h.

ScoreStatistics::ScoreStatistics ( const ScoreStatistics copy) [inline]

Copy constructor.

Definition at line 58 of file musicutil.h.


Member Function Documentation

const ScoreStatistics ScoreStatistics::operator* ( const int  scalar) [inline]

Multiplies all statistics concerning number of notes/chords and length for a integer scalar.

It does not change minimum,maximum and average statistics nor beat type and fifths.

Parameters:
scalarthe integer that multiplies these statistics.
Returns:
the updated statistics.

Definition at line 156 of file musicutil.h.

ScoreStatistics& ScoreStatistics::operator*= ( const int  scalar) [inline]

Multiplies all statistics concerning number of notes/chords and length for a integer scalar.

It does not change minimum,maximum and average statistics nor beat type and fifths.

Parameters:
scalarthe integer that multiplies these statistics.
Returns:
these updated statistics.

Definition at line 132 of file musicutil.h.

ScoreStatistics& ScoreStatistics::operator+= ( const ScoreStatistics addend) [inline]

Adds all statistics concerning number of notes/chords and length.

It does not change minimum,maximum and average statistics nor beat type and fifths.

Parameters:
addendthe statistics that must be added to these.
Returns:
these updated statistics.

Definition at line 87 of file musicutil.h.

ScoreStatistics& ScoreStatistics::operator-= ( const ScoreStatistics subtrahend) [inline]

Subtracts all statistics concerning number of notes/chords and length.

It does not change minimum,maximum and average statistics nor beat type and fifths.

Parameters:
subtrahendthe statistics that must be subtracted to these.
Returns:
these updated statistics.

Definition at line 109 of file musicutil.h.

void ScoreStatistics::Reset ( void  ) [inline]

Set all statistics to 0.

Definition at line 166 of file musicutil.h.


Member Data Documentation

average duration of the score's notes in ms.

Definition at line 202 of file musicutil.h.

average number of notes played at the same time.

Definition at line 203 of file musicutil.h.

beat type of the score.

Definition at line 207 of file musicutil.h.

tonality as number of sharps (if > 0) or flats (if < 0).

Definition at line 206 of file musicutil.h.

maximum number of notes played at the same time.

Definition at line 201 of file musicutil.h.

duration of the shortest note in the score in ms.

Definition at line 200 of file musicutil.h.

total number of played Ab.

Definition at line 195 of file musicutil.h.

total number of played Bb.

Definition at line 191 of file musicutil.h.

total number of played chords in the score.

Definition at line 190 of file musicutil.h.

total number of played Db.

Definition at line 194 of file musicutil.h.

total number of played Eb.

Definition at line 193 of file musicutil.h.

total number of played Gb.

Definition at line 192 of file musicutil.h.

total number of played notes in the score.

Definition at line 189 of file musicutil.h.

tempo of the score.

Definition at line 205 of file musicutil.h.

total duration of the score in milliseconds.

Definition at line 197 of file musicutil.h.

total duration of the score in ms excluding rests.

Definition at line 198 of file musicutil.h.


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