Install Basically, you can install it with the pip command.
pip install music21
Install Mususcore
Set the path where Musescore is installed
us = environment.UserSettings()
us['musicxmlPath'] = 'C:/Program Files/MuseScore 3/bin/MuseScore3.exe'
us['musescoreDirectPNGPath'] = 'C:/Program Files/MuseScore 3/bin/MuseScore3.exe'
from music21 import note,stream,corpus,chord,environment,converter,midi
note = note.Note("C4", quarterLength = 1)
note.show()
Possible errors
SubConverterFileIOException: png file of xml not found. Or file >999 pages?
counter-measure
On line 891 of subconverters.py
Changed ʻos.system (musescoreRun)to
subprocess.run (musescoreRun). And added ʻimport subprocess
to subconverters.py
reference https://stackoverflow.com/questions/53646669/unable-to-show-scores-in-music21
Recommended Posts