1
2

More than 3 years have passed since last update.

windowsでmusic 21のインストール方法

Last updated at Posted at 2020-06-19

Install

基本的にはpipコマンドでインストールすれば良い。

pip install music21

Musescoreで楽譜を表示してみる

Mususcoreをインストールする

Musescoreがインストールされたパスの設定をする

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()

考えられるエラー

SubConverterFileIOException: png file of xml not found. Or file >999 pages?

対応策
subconverters.pyの891行目にある
os.system(musescoreRun)subprocess.run(musescoreRun). に変更し、import subprocesssubconverters.pyに追記

参考
https://stackoverflow.com/questions/53646669/unable-to-show-scores-in-music21

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2