|
Planeshift
|
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. More... | |
| bool | CheckValidity (iDocument *musicalScore, csRef< iDocumentNode > &partNode) |
| Checks if the given document is a valid musical score and provide the <part> node. More... | |
| void | EnharmonicPitch (char &pitch, int &accidental) |
| Turns the given pitch into the enharmonic equivalent. More... | |
| 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. More... | |
| Duration | GetBiggestDuration (int duration) |
| Returns the biggest duration that can be represented on the score which is less or equal to the given one. More... | |
| bool | GetMeasures (iDocument *score, csRefArray< iDocumentNode > &measures) |
| Gets the XML nodes representing the measures contained in the musical score. More... | |
| bool | GetStatistics (iDocument *musicalScore, ScoreStatistics &stats) |
| Returns the statistics of the score. More... | |
| void | NextPitch (char &pitch, uint &octave) |
| Turns the given pitch into the next one in the scale. More... | |
| void | PreviousPitch (char &pitch, uint &octave) |
| Turns the given pitch into the previous one in the scale. More... | |
| bool | ZCompressSong (const csString &inputScore, csString &outputScore) |
| Compress a song with the zlib compression algorithm. More... | |
| bool | ZDecompressSong (const csString &inputScore, csString &outputScore) |
| Decompress a song with the zlib compression algorithm. More... | |
This namespace contains a set of functions that are usefull for the processing of music and musical scores.
| 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.
| duration | the duration expressed as the number of DURATION_QUARTER_DIVISIONS. |
| bool psMusic::CheckValidity | ( | iDocument * | musicalScore, |
| csRef< iDocumentNode > & | partNode | ||
| ) |
Checks if the given document is a valid musical score and provide the <part> node.
| musicalScore | the musical score. |
| partNode | a reference that will contain the part XML node. |
| void psMusic::EnharmonicPitch | ( | char & | pitch, |
| int & | accidental | ||
| ) |
Turns the given pitch into the enharmonic equivalent.
| 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.
| 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 the biggest duration that can be represented on the score which is less or equal to the given one.
| duration | The maximum duration as the number of DURATION_QUARTER_DIVISIONS. |
| bool psMusic::GetMeasures | ( | iDocument * | score, |
| csRefArray< iDocumentNode > & | measures | ||
| ) |
Gets the XML nodes representing the measures contained in the musical score.
| score | the musical score. |
| measures | a reference to a csRefArray that will contain the XML nodes. |
| bool psMusic::GetStatistics | ( | iDocument * | musicalScore, |
| ScoreStatistics & | stats | ||
| ) |
Returns the statistics of the score.
| musicalScore | the musical score. |
| stats | the retrieved statistics of the given score. |
| void psMusic::NextPitch | ( | char & | pitch, |
| uint & | octave | ||
| ) |
Turns the given pitch into the next one in the scale.
| 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.
| 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.
| inputScore | the musical sheet in uncompressed XML format. |
| outputScore | at the end this string will contain the compressed score. |
| bool psMusic::ZDecompressSong | ( | const csString & | inputScore, |
| csString & | outputScore | ||
| ) |
Decompress a song with the zlib compression algorithm.
| inputScore | the compressed musical sheet. |
| outputScore | at the end this string will contain the uncompressed score. |