pyampact.symbolic.toMEI
- pyampact.symbolic.toMEI(piece, file_name='', indentation='\t', data='', start=None, stop=None, dfs=None, analysis_tag='annot')[source]
Write or return an MEI score optionally including analysis data.
If no file_name is passed then returns a string of the MEI representation. Otherwise a file called file_name is created or overwritten in the current working directory. If file_name does not end in ‘.mei.xml’ or ‘.mei’, then the .mei.xml file extension will be added to the file_name.
- Parameters:
file_name – Optional string representing the name to save the new MEI file to the current working directory.
data – Optional string of the path of score data in json format to be added to the the new mei file.
start – Optional integer representing the starting measure. If start is greater than stop, they will be swapped.
stop – Optional integer representing the last measure.
dfs – Optional dictionary of pandas DataFrames to be added to the new MEI file. The keys of the dictionary will be used as the @type attribute of the analysis_tag parameter element.
analysis_tag – Optional string representing the name of the tag to be used for the analysis data.
- Returns:
String of new MEI score if no file_name is given, or None if writing the new MEI file to the current working directory.
See also