Cannot show the png representation of a score using MusicScore

169 Views Asked by At

Using music21 in order to display a png of the score following instructions:

Some formats have sub-formats, for instance both musicxml and lilypond have a .png subformat which converts directly to a .png file. To use that, call .show("musicxml.png").

import music21 as m21    
us = m21.environment.UserSettings()
us['musicxmlPath'] = r'C:\Program Files\MuseScore 3\bin\MuseScore3.exe'
us['musescoreDirectPNGPath'] = r'C:\Program Files\MuseScore 3\bin\MuseScore3.exe'


s = m21.corpus.parse('josquin/milleRegrets')
s.show('musicxml.png')

File "C:\Users\xxx\miniconda3\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable

Same error in Jupyter and Spyder. Of course the path to MuseScore is correct. Replacing musicxml.png by musicxml works, MuseScore opens and display the score.

0

There are 0 best solutions below