Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Score is not parsed #7

Closed
PRamoneda opened this issue Aug 23, 2022 · 21 comments
Closed

Score is not parsed #7

PRamoneda opened this issue Aug 23, 2022 · 21 comments

Comments

@PRamoneda
Copy link

I am parsing the score: from Craig Sapp collection:
wtc2f24.krn.zip

and it is not possible to load it to music21

minimum example

converter.unregisterSubconverter(converter.subConverters.ConverterHumdrum)
converter.registerSubconverter(HumdrumConverter)
s = converter.parse(
  humdrum_path,
  format='humdrum'
)
list_elements_music21 = [e for e in s]

and list_elements_music21 is empty.... it is not loading anything

Some idea?

@gregchapman-dev
Copy link
Owner

Thanks for the report! I'll take a look.

@PRamoneda
Copy link
Author

thanks to you for this library :) say to me if I can help!

@gregchapman-dev
Copy link
Owner

I'm seeing the following error:

Error: Inconsistent rhythm analysis occurring near line 716
Expected durationFromStart to be: 149.5 but found it to be 149.0
Line: 4.BBB 4.d# 4.b

Looking further to see what's going on.

@gregchapman-dev
Copy link
Owner

Aha! Here's the final measure in the file:

=101 =101 =101
. 8eQ 8a#Q
4.BBB 4.d# 4.b

Those two 'Q's should be 'q' to show they are grace notes (they are being treated as eighth-notes by my parser). I'm looking to see if I should support 'Q' as a variation on 'q', but in the meantime it should be easy to fix your file so it will parse.

@gregchapman-dev
Copy link
Owner

BadGraceNotes.pdf

verovio.humdrum.org has the same issue with this file. I don't think I should allow 'Q' to mean grace note.

@PRamoneda
Copy link
Author

PRamoneda commented Aug 24, 2022

Thank you so much for your answer!

And well, maybe it is better to output a warning and not returning and empty file

@gregchapman-dev
Copy link
Owner

gregchapman-dev commented Aug 24, 2022 via email

@PRamoneda
Copy link
Author

Another problem is in wtc1p02.krn it seems to block forever converter21

@PRamoneda
Copy link
Author

but dont worry I am opening the files and they have strange things. I am going to think in using another machin-readable version of wtc.

Do you have some idea of the nocturne problem?

@gregchapman-dev
Copy link
Owner

Can you point me at the wtc files you are trying? I have a lot of Humdrum files that Craig Sapp pointed me at (about 4000), but not these.

@PRamoneda
Copy link
Author

here

@gregchapman-dev
Copy link
Owner

Thanks! Any chance you have a zip file full of all of them? I'd like to add them to my local test suite, and individually downloading each of them sounds painful.

@gregchapman-dev
Copy link
Owner

gregchapman-dev commented Aug 24, 2022

Do you have some idea of the nocturne problem?

Which problem is this?

@PRamoneda
Copy link
Author

wtc 2.zip

@PRamoneda
Copy link
Author

PRamoneda commented Aug 25, 2022

I am trying to visualise the humdrum files from music21 with your converter21 library and if we convert them to musicxml something goes crazy with the voices adding a lot of hidden silences.
However, if you download the score in musicxml from here: https://chopinscores.org/en/partytura/23 the conversion is very very clean. And they only convert with the cpp version two years ago the humdrum to musicxml.

I show in the next lines an example with Chopin, Nocturne 1er; Op. 9 (publisher: Kistner):

The original humdrum (verovio):

After converter21 or after VHV web conversion:

Captura de pantalla 2022-08-22 a las 18 26 19

However, downloading the score from the chopinscores website it is very very clean:

Captura de pantalla 2022-08-22 a las 18 23 46

@PRamoneda
Copy link
Author

the same if I can help with something say me :) thank you so much

@gregchapman-dev
Copy link
Owner

gregchapman-dev commented Aug 26, 2022 via email

@gregchapman-dev
Copy link
Owner

OK, I have done some analysis of various Humdrum parser failures on the wtc scores. I have fixed the infinite loop (triggered by '*staffX', where X is not numeric). I have also gone ahead and made 'Q' the equivalent of 'q'. 'Q' in Humdrum is supposed to be a weird variation of a grace note that actually extends the duration of a measure. But Verovio's Humdrum parser is very picky about durations (and so is mine), so we need to treat it like a grace note. Maybe someday Verovio will as well? Right now it just fails to parse.

You can expect a release of converter21 soon that has those fixes.

The rest of the wtc scores seem to parse fine, with a few exceptions due to incorrectly encoded tuplets.

@PRamoneda
Copy link
Author

Thank you for the wtc scores! I will add them to my test suite, and fix any bugs I find.

thanks to you for this library!

This is a side effect of the way that music21 stores DynamicWedges (Crescendo and Diminuendo). DynamicWedges are Spanners containing a start note/chord/rest and an end note/chord/rest, so the “duration” of the DynamicWedge is determined from the range of those two spanned notes/chords/rests. Unfortunately, those spanned notes/chords/rests must both be in the same Part/PartStaff, so if the Humdrum file has put the start or end of a ‘>' or ‘<' on a note in another staff (and this happens often, in piano scores), my Humdrum parser has to create a correctly positioned invisible rest in the current staff to correctly position the DynamicWedge. This also means I have to add a Voice to the current Staff to put the invisible rest in. I try very hard not to do this; if there is a correctly positioned note/chord/rest already in the current staff, I will use that instead.

The same, if you need some help say me

In the next weeks I am going to review a large part of the craig sapp Humdrum collection (parsed by converter21). If you want we can keep this thread open and I report here if I find more errors

thank you so much again!

@gregchapman-dev
Copy link
Owner

Craig has asked me to back out my support for 'Q' as equivalent to 'q', as he wants (in future) to have 'Q' mean cue-sized (small) notes, not grace notes. He will be updating the wtc scores to use 'q' instead of 'Q'.

@gregchapman-dev
Copy link
Owner

Hi Pedro, I'm going to close this out. If you find a particular score that shows a problem, please open a new issue.

@gregchapman-dev gregchapman-dev closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants