frmatthew / exsurge

A JavaScript library for rendering Gregorian Chant in square note notation
MIT License
54 stars 13 forks source link

exsurge.Gabc.loadChantScore is not a function #88

Closed benyanke closed 5 years ago

benyanke commented 7 years ago

Am I missing something, or is the example in the readme out of date?

When I run a simple example I constructed based on the README, it breaks:

scoretest.html:25 Uncaught TypeError: exsurge.Gabc.loadChantScore is not a function

frmatthew commented 7 years ago

Indeed, the README is not up to date. Actually I think I had exsurge version at 0.0.1 because the API was a moving target. Sadly, I haven't looked at the code for some time because of other projects going on.

The proper way to create chants now is:

mappings = exsurge.Gabc.createMappingsFromSource(ctxt, "(c4) (g)");
score = new exsurge.ChantScore(ctxt, mappings, true);

Mappings provide the ability to connect portions of gabc strings to the chant objects they represent, thus allowing partial parsing of gabc code when a string is changed. That's why the example at http://frmatthew.github.io/exsurge/chant.html can run in realtime even with large chants, because it doesn't have to re-parse the entire gabc.

See the source at http://frmatthew.github.io/exsurge/chant.html for an example of how to update mappings when gabc text is modified. Under the hood it's using a diff algorithm to intelligently parse only changes in the text.

PatrickMassot commented 6 years ago

The current status of this great library is a bit confusing. Following the above answer, I tried to imitate the source code of http://frmatthew.github.io/exsurge/chant.html rather than following the README. But it failed, while the README indication worked. I think it's because I installed exsurge using npm rather than pulling from github. And the npm package may be out of sync with this repository.

And then I see the fork of @bbloomf, https://github.com/bbloomf/exsurge/tree/feature/translation which is 174 commits ahead and two commits behind upstream master, but has the same README. Are there any plan to merge? Or the development here is stopped, and the fork will eventually become the main incarnation of exsurge?

So what is the recommended thing to do now? Use the version on npm, pull from here, pull from bbloomf?

PatrickMassot commented 5 years ago

Are there any news about this question? @frmatthew would you like to make @bbloomf the new maintainer of this library, so that he could push a new version to npm? If not, then would @bbloomf be ready to rename his fork and push it to npm? I understand very well that priorities can change, but it would be very sad that this amazing library stays so hard to use for lack of maintenance, especially since someone clearly has time and motivation to work on it.

frmatthew commented 5 years ago

The code is released under an MIT license to allow free forking. It's true, I'm not actively developing this; feel free to use @bbloomf's repo at https://github.com/bbloomf/exsurge if you're looking for an active version. I'm not interested in handing over admin access of this particular repo because I use it internally as is and I'm not interested in merging pull requests with significant stylistic differences.

PatrickMassot commented 5 years ago

Thank you very much for your answer. I hope @bbloomf will be interested in giving larger access to its work by pushing something to npm (or at least explain how to incorporate it in other projects).