You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another two problems come when running my test files and both are unimplemented functionality, but I list it here to have it when time comes.
Unpitched as in example R.musicxml gives an error. I looked at the Python code and make a hack - just handling unpithed as pitched to assure that the only problem is just not handling unpitched. This could also be a solution just to process unpitched the same way as pitched notes.
Another problem occurs with music with no time-specification and no measures. This occurs in old ballads.
The rhythm-problem (R.musicxml):
C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml>python convert.py R.musicxml
Traceback (most recent call last):
File "convert.py", line 7, in <module>
s = get_score_from_musicxml(filedata)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml\mnxconverter\musicxml.py", line 83, in get_score
return read_musicxml(xml)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml\mnxconverter\musicxml.py", line 194, in read_musicxml
return reader.read()
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml\mnxconverter\musicxml.py", line 219, in read
self.parse_measures()
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml\mnxconverter\musicxml.py", line 250, in parse_measures
self.parse_measure_part(measure_part_el, bar, parts[part_idx])
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml\mnxconverter\musicxml.py", line 269, in parse_measure_part
self.parse_note(el, part, bar_part)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml\mnxconverter\musicxml.py", line 555, in parse_note
raise NotationDataError('Got a <note> without <pitch>.')
mnxconverter.musicxml.NotationDataError: Got a <note> without <pitch>.
To investigate this problem I made a Python hack in musicxml.py:
______________________
elif tag == 'pitch':
note.pitch = self.parse_pitch(el)
elif tag == 'unpitched':
note.pitch = self.parse_pitch(el)
______________________
elif tag == 'octave':
try:
octave = int(el.text)
except ValueError:
raise NotationDataError('Invalid <octave> for <pitch>.')
elif tag == 'display-octave':
try:
octave = int(el.text)
except ValueError:
raise NotationDataError('Invalid <octave> for <pitch>.')
_______________________
elif tag == 'step':
step = el.text
elif tag == 'display-step':
step = el.text
_______________________
I do not know if unpitched is really needed in every single note. Isn't rhythm just an instrument where two notes sound more different than for other instruments?
Could we just specify unpitched once and for all notes in a rhythm part:
Python output for the second problem, where there is no time signature and there are no measures:
C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam>PYTHON convert.py "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\muhayyer--bozlak--serbest--havayi_da--asaf_guven.musicxml"
Traceback (most recent call last):
File "convert.py", line 7, in <module>
s = get_score_from_musicxml(filedata)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 88, in get_score
return read_musicxml(xml)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 199, in read_musicxml
return reader.read()
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 224, in read
self.parse_measures()
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 255, in parse_measures
self.parse_measure_part(measure_part_el, bar, parts[part_idx])
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 264, in parse_measure_part
clef = self.parse_measure_attributes(el, bar, part, bar_part)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 351, in parse_measure_attributes
bar.timesig = self.parse_time(el)
File "C:\Users\Mogens Lundholm\Desktop\MNX-test\MusicXml-Makam\mnxconverter\musicxml.py", line 479, in parse_time
raise NotationDataError('Invalid <time> element.')
mnxconverter.musicxml.NotationDataError: Invalid <time> element.
Most errors when running my test files come from "ValueError: Invalid duration fraction 3/8" (See issue #3). Together with the two errors described here, I don't get other errors.
I've just pushed a commit ffe07d9, which adds line numbers to MusicXML import errors. Thanks for the suggestion!
For the other thing you brought up (unpitched notes), these are still unspecified in MNX. I've just opened an issue in the MNX repository to log this as a to-do: w3c/mnx#316
Another two problems come when running my test files and both are unimplemented functionality, but I list it here to have it when time comes.
Unpitched as in example R.musicxml gives an error. I looked at the Python code and make a hack - just handling unpithed as pitched to assure that the only problem is just not handling unpitched. This could also be a solution just to process unpitched the same way as pitched notes.
Another problem occurs with music with no time-specification and no measures. This occurs in old ballads.
The rhythm-problem (R.musicxml):
To investigate this problem I made a Python hack in musicxml.py:
I do not know if unpitched is really needed in every single note. Isn't rhythm just an instrument where two notes sound more different than for other instruments?
Could we just specify unpitched once and for all notes in a rhythm part:
Python output for the second problem, where there is no time signature and there are no measures:
Most errors when running my test files come from "ValueError: Invalid duration fraction 3/8" (See issue #3). Together with the two errors described here, I don't get other errors.
R.zip
The text was updated successfully, but these errors were encountered: