CPJKU / partitura

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

fix pattern checking #332

Closed sildater closed 1 year ago

sildater commented 1 year ago

There was no checking for any specific patterns in deletions and insertions, just matching with respect the base pattern of notes and snotes. This meant that the classes:

The fix creates dummy instances in the base class methods to check for the correct patterns. This is a bit weird, but some of the classes only fix the patterns at instantiation, so I didn't know how else to get to the pattern. All above note classes are now correctly parsed and the parser further discards spurious lines such as spurious_tag-note(606,[G,#],5,63037,63119,63119,67). for not recognizing the pattern (this would previously have been an insertion).