Overview¶
This project wraps around Music21 and lxml to make certain tasks easier and provide code for lining up and evaluating multiple symbolic music-files. I do not agree with certain design decisions Music21 has taken regarding the handling of the MusicXML format. Issues which become observable to me when examining the output of multiple music engraving software.
Documentation¶
-
class
mupix.application.
BasicCompare
(true_filepath: str, test_filepath: str, do_not_count: list = [])¶ Using 1-to-1 comparisons based on the index of each element. Obviously not ideal, but can be an interesting comparison.
-
class
mupix.application.
SimpleNeedlemanWunsch
(true_filepath: str, test_filepath: str, do_not_count: list = [])¶ This version aligns notes based on the note names, and the measures + offsets of other elements.
Note
Align each note object with each other. Understandably this is not the best, but it serves more as a proof-of-concept or a placeholder to be built later.
- Notes are aligned by step names
- Restes are aligned by measure number as a single char
- TimeSignatures are aligned by measure number as a single char
- KeySignatures are aligned by measure number as a single char
- Clefs are aligned by measure number as a single char
-
class
mupix.application.
WeightedNeedlemanWunsch
(true_filepath: str, test_filepath: str, do_not_count: list = [])¶ Using a weighted version of Affine Needleman-Wunsch, the way it should be used.
-
class
mupix.application.
PartwiseWeightedNeedlemanWunsch
(true_filepath: str, test_filepath: str, do_not_count: list = [])¶ Using weighted N-W on every permutation of parts between ground truths and test files. The ones with the lowest number of errors are aligned. Then a new total is computed with the lowest errored parts.
-
mupix.application.
xml_validator
(musicxml_filepath, schema_filepath='/home/docs/checkouts/readthedocs.org/user_builds/mupix/envs/latest/lib/python3.7/site-packages/tests/xml/musicxml.xsd')¶ Return if the provided musicxml file is valid against the current musicxml schema.
Parameters: - [musicxml_filepath] (String) – A character string that represents the filepath and filename of the file to open.
- [schema_filepath](optional) – A character string that represents the filepath and filename of the schema to use.
Returns: Returns a boolean value, either it is a valid MusicXML file or it is not.
Return type: Bool
-
mupix.application.
xml_type_finder
(musicxml_filepath)¶ Check if the xml file is written in a partwise or timewise fashion. This is just the fastest way to check as long as everything in the MusicXML isn’t minified on a single line.
Parameters: [filepath] (String) – A character string that represents the filepath and filename of the file to open. Returns: Either a Partwise or a Timewise string will return. Return type: String