This namespace contains a set of functions that are usefull for the processing of music and musical scores.
More...
Functions |
bool | CheckDuration (int duration) |
| Check wheather the given number of DURATION_QUARTER_DIVISIONS correspond to a specific duration taken into account by the enum Duration.
|
bool | CheckValidity (iDocument *musicalScore, csRef< iDocumentNode > &partNode) |
| Checks if the given document is a valid musical score and provide the <part> node.
|
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.
|
Duration | GetBiggestDuration (int duration) |
| Returns the biggest duration that can be represented on the score which is less or equal to the given one.
|
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.
|
void | NextPitch (char &pitch, uint &octave) |
| Turns the given pitch into the next one in the scale.
|
void | PreviousPitch (char &pitch, uint &octave) |
| Turns the given pitch into the previous one in the scale.
|
bool | ZCompressSong (const csString &inputScore, csString &outputScore) |
| Compress a song with the zlib compression algorithm.
|
bool | ZDecompressSong (const csString &inputScore, csString &outputScore) |
| Decompress a song with the zlib compression algorithm.
|
Detailed Description
This namespace contains a set of functions that are usefull for the processing of music and musical scores.
Function Documentation
bool psMusic::CheckDuration |
( |
int |
duration | ) |
|
Check wheather the given number of DURATION_QUARTER_DIVISIONS correspond to a specific duration taken into account by the enum Duration.
- Parameters:
-
duration | the duration expressed as the number of DURATION_QUARTER_DIVISIONS. |
- Returns:
- true if the given duration can be expressed by the type Duration, false otherwise.
bool psMusic::CheckValidity |
( |
iDocument * |
musicalScore, |
|
|
csRef< iDocumentNode > & |
partNode |
|
) |
| |
Checks if the given document is a valid musical score and provide the <part> node.
- Parameters:
-
musicalScore | the musical score. |
partNode | a reference that will contain the part XML node. |
- Returns:
- true if the document is valid, false otherwise.
void psMusic::EnharmonicPitch |
( |
char & |
pitch, |
|
|
int & |
accidental |
|
) |
| |
Turns the given pitch into the enharmonic equivalent.
- Parameters:
-
pitch | the pitch of the note. |
accidental | the alteration of the note. |
bool psMusic::GetAttributes |
( |
iDocument * |
musicalScore, |
|
|
int & |
quarterDivisions, |
|
|
int & |
fifths, |
|
|
int & |
beats, |
|
|
int & |
beatType, |
|
|
int & |
tempo |
|
) |
| |
Gets the attributes in the first measure of the given score.
The provided attributes are always valid. If the musical score contains non valid attributes (e.g. beatType <= 0), they are set to a valid default value.
- Parameters:
-
musicalScore | the musical score. |
quarterDivisions | the number of divisions in a quarter for the score. |
fifths | the tonality of the score. |
beats | beats of the song. |
beatType | the beat type of the song. |
tempo | the beat per minutes of the song. |
- Returns:
- true if the document is a valid musical score and the attributes could be found in the first measure, false otherwise. False is returned also if there are not measures in the given score.
Returns the biggest duration that can be represented on the score which is less or equal to the given one.
- Parameters:
-
duration | The maximum duration as the number of DURATION_QUARTER_DIVISIONS. |
- Returns:
- The duration value.
bool psMusic::GetMeasures |
( |
iDocument * |
score, |
|
|
csRefArray< iDocumentNode > & |
measures |
|
) |
| |
Gets the XML nodes representing the measures contained in the musical score.
- Parameters:
-
score | the musical score. |
measures | a reference to a csRefArray that will contain the XML nodes. |
- Returns:
- true if the document is a valid musical score, false otherwise.
bool psMusic::GetStatistics |
( |
iDocument * |
musicalScore, |
|
|
ScoreStatistics & |
stats |
|
) |
| |
Returns the statistics of the score.
- Parameters:
-
musicalScore | the musical score. |
stats | the retrieved statistics of the given score. |
- Returns:
- true if the document is a valid musical score, false otherwise.
void psMusic::NextPitch |
( |
char & |
pitch, |
|
|
uint & |
octave |
|
) |
| |
Turns the given pitch into the next one in the scale.
- Parameters:
-
pitch | the pitch of the note. |
octave | the octave of the note. |
void psMusic::PreviousPitch |
( |
char & |
pitch, |
|
|
uint & |
octave |
|
) |
| |
Turns the given pitch into the previous one in the scale.
- Parameters:
-
pitch | the pitch of the note. |
octave | the octave of the note. |
bool psMusic::ZCompressSong |
( |
const csString & |
inputScore, |
|
|
csString & |
outputScore |
|
) |
| |
Compress a song with the zlib compression algorithm.
- Attention:
- the output string is not a normal string but a sequence of bytes. It could contain null characters. Do not treat it like a null terminated string.
- Parameters:
-
inputScore | the musical sheet in uncompressed XML format. |
outputScore | at the end this string will contain the compressed score. |
- Returns:
- true if the compression is done without errors, false otherwise.
bool psMusic::ZDecompressSong |
( |
const csString & |
inputScore, |
|
|
csString & |
outputScore |
|
) |
| |
Decompress a song with the zlib compression algorithm.
- Parameters:
-
inputScore | the compressed musical sheet. |
outputScore | at the end this string will contain the uncompressed score. |
- Returns:
- true if the decompression is done without errors, false otherwise.