Hello Angie, > Le 4 août 2022 à 04:48, 柊希里子 <[email protected] > <mailto:[email protected]>> a écrit : > > My workflow is needed to be an automation script, cause I want to create a > tool to generate the annotation of each note automatically. The process is > like the below: > > Turn the .xml file into .ly, > Ideally, I want to eliminate all the decorations, like accent, staccato, any > kind of ornament, and tempo-related expression. > Such as --nd, do not convert directions (^, _ or -) for articulations, > dynamics, etc. > Command example: musicxml2ly -v --nd --midi --output="1_Bach_Prelude1.ly > <http://1_bach_prelude1.ly/>" ./1_Bach_Prelude1.xml > In the .ly file, convert the instrument into Violin or Cello, no matter what > kind of instrument the score was originally made for, because the String > instrument will get a more stable note duration of MIDI file than the > Woodwind or Piano. > > In the .ly file, eliminate all the tempo expressions, and set the tempo to > BPM=60. > For the same reason as 2nd step, this step aims to get a more stable note > duration. > > The steps 2 and 3 I wrote a python code to replace the tempo and want to > change the instrument clef, see the attachment “replace_tempo.py”. > Command example: `python replace_tempo.py --path ./1_Bach_Prelude1.ly > <http://1_bach_prelude1.ly/>`, then output the file named just add the > `_replace` afterward, like: `1_Bach_Prelude1_replace.ly > <http://1_bach_prelude1_replace.ly/>`
Automatising such steps thru options is what xml2ly, a part of the MusicFormats library, is about, maybe it can help you. The user doc is at https://github.com/jacques-menu/musicformats/blob/master/documentation/MusicFormatsUserGuide/MusicFormatsUserGuide.pdf <https://github.com/jacques-menu/musicformats/blob/master/documentation/MusicFormatsUserGuide/MusicFormatsUserGuide.pdf> . HTH! JM
