実行中にエラーが発生します:
from music21 import *
n1 = note.Note('C4', quarterLength=1)
n2 = note.Note('A4', quarterLength=1)
s = stream.Stream()
s.append(n1)
s.append(n2)
s.show('lily.svg')
Traceback (most recent call last):
File "C:\Python34\test.py", line 7, in <module>
s.show('lily.svg')
File "C:\Python34\lib\site-packages\music21\base.py", line 2206, in show
return formatWriter.show(self, regularizedConverterFormat, app=app, subformats=subformats, **keywords)
File "C:\Python34\lib\site-packages\music21\converter\subConverters.py", line 277, in show
returnedFilePath = self.write(obj, fmt, subformats=subformats, **keywords)
File "C:\Python34\lib\site-packages\music21\converter\subConverters.py", line 245, in write
conv = lily.translate.LilypondConverter()
File "C:\Python34\lib\site-packages\music21\lily\translate.py", line 147, in __init__
self.setupTools()
File "C:\Python34\lib\site-packages\music21\lily\translate.py", line 177, in setupTools
versionString = versionString.split()[-1]
IndexError: list index out of range
私は scipy と mathplotlib をインストールしたので、music21 はそれらが利用できないことについて文句を言わなくなりました。Windows 7 で Python 3.4 を実行しています。
代わりs.show('musicxml.png')
に画像を取得するために使用すると、次のエラーが表示されます。
Traceback (most recent call last):
File "C:\Python34\test.py", line 7, in <module>
s.show('musicxml.png')
File "C:\Python34\lib\site-packages\music21\base.py", line 2206, in show
return formatWriter.show(self, regularizedConverterFormat, app=app, subformats=subformats, **keywords)
File "C:\Python34\lib\site-packages\music21\converter\subConverters.py", line 147, in show
returnedFilePath = self.write(obj, fmt, subformats=subformats, **keywords)
File "C:\Python34\lib\site-packages\music21\converter\subConverters.py", line 637, in write
fp = self.runThroughMusescore(fp, **keywords)
File "C:\Python34\lib\site-packages\music21\converter\subConverters.py", line 606, in runThroughMusescore
elif not os.path.exists(musescoreFile):
File "C:\Python34\lib\genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: can't specify None for path argument
画像 (できれば svg) を取得するにはどうすればよいですか?