girasole123 / LilyPond-Integration-Sheet-Music-Typesetter-for-Anki-2.1.x

LilyPond Integration (Sheet Music Typesetter) for Anki 2.1.x (tested on versions >=2.1.54)
0 stars 1 forks source link

update to -lilypondimg fields does not work, mungeFields function is never called #1

Open cleinias opened 5 months ago

cleinias commented 5 months ago

The add-on does not seem to be replacing the -lilypondimg field with the link to the img source. It seems the function mungeFields is never called. The lilypond compilation and replacement only works on the -lilypond fields, which unfortunately is viable on mobile.

I saw your post of about a year a go in the forums, which discusses possible replacements for the function and concludes by saying that you had found a solution. However, the code on github does not seem to include the solution, nor does your post in the forums.

What did you discover that worked?

girasole123 commented 5 months ago

Hi @cleinias I don't remember exactly what I found, but in future I will rewrite and combine two add-ons which share the same skeleton. In fact, they are based on another add-on from someone else and were intended for the versions before 2.1.x. This add-on (and its sibling "ABC to MP3") were an attempt to port to the 2.1.x API... but I never succeed. I don't know exactly what isn't working, because I don't understand the new way of doing things with Anki (I'm sorry, I'm a perfect newbie). For the moment, I don't have time to devote to those projects, but in the future I will combine them and I will get rid of the special field functionality (there will be only an insert image button and an insert sound button, both from selected ABC notation or with a dialogue window prompt). Feel free to fork the project if you'd like. I'm sorry that I'm not so helpful.

cleinias commented 5 months ago

Thanks for your quick reply. Indeed, I forked the code and I was able to have the add-on work on the desktop. It is only the update to the img field that does not work because of the now obsolete mungeFields hook. I am completely new to anki add-on coding, so I don't have a solution either. On the related issue, I think combining the ABC and lilypond add-ons would be an idea worth pursuing. Indeed, since lilypond can produce midi files directly, it might be simpler to produce soundfiles directly from lilypond's midi output. But that as well would require a functionality equivalent to the obsolete mungeFields hook.