CPJKU / partitura

A python package for handling modern staff notation of music
https://partitura.readthedocs.io
Apache License 2.0
227 stars 15 forks source link

Corrected Offsets for tied notes. #366

Closed manoskary closed 1 month ago

manoskary commented 1 month ago

Tied note mismatch during parsing of Kern scores. Corrected by omitting second loop for tie_prev. Also corrected parsing of G clef with octave change.

Closes #365 Closes #367

sildater commented 1 month ago

simple fixes for two bugs during **kern import. Two minor questions:

manoskary commented 1 month ago

Thanks @sildater for your review and your comments! To answer your questions:

  • is there a reason to comment the faulty code instead of just deleting it?

I was unsure if the second pass for tied notes could be helpful so I decided to keep it but you are right it is not useful so I deleted it and added a couple of comments.

  • is there a reason to only accept treble Clefs on the second line for octave changes? It seems that **kern allows for all options and we could just parse them all by getting rid of the conditionals lines 565 - 571?

In principle, a general parsing would be better but in practice, kern lines can take many forms since there are no strict formatting rules within kern files. In an attempt to parse as correctly as I could, I restricted the accepted solutions as much as possible. As the kern parser gets better maybe we can start loosening some of the constraints but for the moment I would suggest keeping it as is.