I'm working on a pure SWI-Prolog grammar to describe the modern music notation.
The end goal being to be able to do the last step of Optical Music Recognition and generate the final music score (in the MEI) from a set of graphical primitives: https://github.com/kwon-young/music
It's been months I've been stuck on the description of note groups because of the insanely complex 2D semantics.