Planeshift
ScoreStatistics Struct Reference

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

#include <musicutil.h>

Public Member Functions

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

Public Attributes

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

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

float ScoreStatistics::averageDuration

average duration of the score's notes in ms.

Definition at line 202 of file musicutil.h.

float ScoreStatistics::averagePolyphony

average number of notes played at the same time.

Definition at line 203 of file musicutil.h.

int ScoreStatistics::beatType

beat type of the score.

Definition at line 207 of file musicutil.h.

int ScoreStatistics::fifths

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

Definition at line 206 of file musicutil.h.

int ScoreStatistics::maximumPolyphony

maximum number of notes played at the same time.

Definition at line 201 of file musicutil.h.

int ScoreStatistics::minimumDuration

duration of the shortest note in the score in ms.

Definition at line 200 of file musicutil.h.

int ScoreStatistics::nAb

total number of played Ab.

Definition at line 195 of file musicutil.h.

int ScoreStatistics::nBb

total number of played Bb.

Definition at line 191 of file musicutil.h.

int ScoreStatistics::nChords

total number of played chords in the score.

Definition at line 190 of file musicutil.h.

int ScoreStatistics::nDb

total number of played Db.

Definition at line 194 of file musicutil.h.

int ScoreStatistics::nEb

total number of played Eb.

Definition at line 193 of file musicutil.h.

int ScoreStatistics::nGb

total number of played Gb.

Definition at line 192 of file musicutil.h.

int ScoreStatistics::nNotes

total number of played notes in the score.

Definition at line 189 of file musicutil.h.

int ScoreStatistics::tempo

tempo of the score.

Definition at line 205 of file musicutil.h.

float ScoreStatistics::totalLength

total duration of the score in milliseconds.

Definition at line 197 of file musicutil.h.

float ScoreStatistics::totalLengthNoRests

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: