Hacker News new | ask | show | jobs
by jacquesm 977 days ago
VexFlow is kind of tricky to use but extremely versatile and probably saved me a year (or two) in getting pianojacq.com up and running but I am still in the process of optimizing the code, last year during a holiday I did a complete refactoring to make it all more readable and I still have a plan to re-work the interface to VexFlow into something nicer than what is there right now. The problem is that there are 6 different representations of the score in memory right now (midi, VexFlow, visual (bitmaps), timing (milliseconds), pianoroll (for the sustained notes) and finally beats and bars. All of these serve different functions and have to be kept in sync so the bookkeeping gets to be a bit ugly. There is yet another representation used to reverse from pixels on the screen to notes. I suspect every program like that suffers from a similar problem that in order to do things fast you need to keep it around in the representation that is most suitable for the problem you're solving at that moment in time. For instance, during midi decoding I don't have time to parse the whole data structure but I do need to know if a note is still sustaining.

Edit: I looked at your stuff, did you know about:

https://guides.loc.gov/music-notation-preferred-preservation...