Expand description
music21’s common.stringTools: names recased and split, text compared
and cleaned, and brackets matched.
Structs§
- Parentheses
Match - A bracketed stretch of text that
parentheses_matchfound: music21’sParenthesesMatch. Positions count characters.
Functions§
- camel_
case_ to_ hyphen - music21’s
common.camelCaseToHyphen: a camel-cased name as words joined byreplacement, lower case. A capital that starts a run of lower-case letters is set apart first, then any capital following a lower-case letter or a digit, which is the pair of substitutions music21 makes. - camel_
case_ to_ hyphen_ checked camel_case_to_hyphenwith music21’s checks on the replacement: one character, and not a capital, which the result would lose.- format_
str - A debugging or warning message as music21’s
common.formatStrmakes one: the parts joined by spaces, ending in a newline. - get_
num_ from_ str - The characters of a string that are among
numbers, and the rest, each in order: music21’sgetNumFromStr, whosenumbersare the ten digits. - hyphen_
to_ camel_ case - A
replacement-joined name,movement-name, as a camel-cased one,movementName: music21’shyphenToCamelCase. - is_
python_ space - Whether Python’s
str.isspacecounts a character as white space, which is Unicode’s white space and the four ASCII separators below it. - md5_hex
- The MD5 digest of some bytes, in lower-case hexadecimal: music21’s
getMd5, which hashes a string’s UTF-8. - normalize_
filename - A name made safe as a file name: accents stripped, anything else
outside ASCII dropped, and what is not a letter, a digit,
_or-made_, all but a four-character extension: music21’snormalizeFilename. - parentheses_
match - Every bracketed stretch of a string, each with those nested in it:
music21’s
parenthesesMatch. A bracket after a backslash is not one, and either bracket may be longer than a character. - remove_
punctuation - Text with ASCII’s punctuation taken out: music21’s
removePunctuation. - space_
camel_ case - A camel-cased name, or one of letters and numbers, spaced into words:
music21’s
spaceCamelCase. A space goes before each capital and where numbers start or stop; each ofkeep_together, spaced out, is joined up again, and withreplace_underscorean underscore is a space too. music21 keepsPMFCtogether where it is given nothing to keep. - str_
repr - A string as Python’s
reprwrites it, in single quotes unless it holds one and no double quote. - strip_
accents - Text with its accents taken off: music21’s
stripAccents. Each character is decomposed for compatibility and its combining marks are dropped;ßbecomesssand curly quotes straight ones. A character with nothing to take off, like音, is left as it is. - whitespace_
equal - Whether two strings are the same once all their white space is taken
out: music21’s
whitespaceEqual.