ScoreUtility class

The ScoreUtility namespace collects static functions for processing musical data in Scorelib. “SU” is a shorthand typedef for “ScoreUtility”.

Comparison functions

equalClefs — Return true if two items reprepresent the same clef.
equalTimeSigs — Returns true if two items represent the same time signature.
equalKeySigs — Returns true if two items represent the same key signature.

Mathematical functions

lcm — Find the least common multiple of two or more integers.
gcd — Find the greatest common divisor between two integers.

Pitch functions

base7ToBase40 — Converts diatonic base-7 note into a base-40 note.
base7ToBase40 — Converts a base-40 note into a base-7 pitch class.
base40ToUCDiatonicLetter — Converts a base-40 pitch into an upper-case base-7 diatonic letter.
base40ToLCDiatonicLetter — Converts a base-40 pitch into a lower-case base-7 diatonic letter.
base40ToBase7 — Converts a base-40 note into a base-7 pitch.
base40ToChromaticAlteration — Extract chromatic alteration of diatonic pitch given a
base40ToKern — Converts a base-40 note a Humdrum **kern pitch name.

Sorting functions

sortP3 — Sort two items by their horizontal position
sortP3P1 — Sort two items by P3, and then P1.
sortP3P2 — Sort two items by horizontal position, and then by staff number if tied.
sortP3P2P1 — Sort two items by P3 then P2 then P1.
sortP3P1P4 — Sort two items by P3, then P1, then P4.
sortP3P4P1 — Sort two items by P3, then P4, then P1.
sortP3P1P2P4 — Sort two items by P3, then P1, then P2, then P4.
sortP3P2P1P4 — Sort two items by P3, then P2, then P1, then P4.

Text-processing functions

printXmlTextEscapedUTF8 — Converts SCORE text to UTF-8, using XML entities.
getTextNoFontXmlEscapedUTF8 — Converts SCORE text to UTF-8, using XML entities.

Tie-processing functions

analyzeStaffTies — Calculate variables which are used to link slurs/ties across
identifySlurStartStopOffsets — Helper function for ScoreUtility::analyzeStaffTies.
linkNotesByTie — Helper function for ScoreUtility::identifySlurStartStopOffsets.

 

Keyboard shortcuts for this page: