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
anki-addon lilypond music png

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)

LilyPond - music notation for everyone - http://lilypond.org/ With this addon, you can add sheet music snippets to your deck, wrapped in [lilypond]c d e[/lilypond] tags. For this addon to work, you have to install LilyPond first. For Windows and Mac, please follow the installation instructions for running LilyPond on the command line. (lilypond executable needs to be in your PATH).

This addon is hosted on GitHub: https://github.com/girasole123/LilyPond-Integration-Sheet-Music-Typesetter-for-Anki-2.1.x. Original addon for Anki 2.1.x on GitHub: https://github.com/GydeonMylls/Anki-LilyPond. Unlike the original module, this one has a menu to edit templates.

How to use This addon understands [lilypond] tags: [lilypond]c d e[/lilypond] Alternatively, you can create fields dedicated to LilyPond, e.g. front-lilypond or back-lilypond, and omit the [lilypond] tags for them: c d e With lilypond in the field name, it will act as if the entire field content was wrapped in [lilypond][/lilypond] tags. This addon allows the creation of custom templates (see below), and specifying which template to use:[lilypond=default]c d e[/lilypond] [lilypond=yourtemplate]c d e[/lilypond] The name of the default template is default, so [lilypond=default] is identical to [lilypond]. You can also use templates in lilypond fields by giving them names like front-lilypond-yourtemplate, back-lilypond-yourtemplate.

Mobile/Web support Anki addons are desktop only, so by default, LilyPond images won't appear on other platforms since those platforms won't know what to make of a [lilypond] tag or how to treat a lilypond field. However, if you are using lilypond fields, and for each field create another field called lilypondimg, the desktop plugin will autofill it with the [image] tag. For example, if your field is front-lilypond, with content c d e, and you have another field front-lilypondimg, and use only the front-lilypondimg field in your card template, the image will appear on all platforms (provided that the desktop plugin generated the image once and the images were synced to the other platforms as well). Note: Please do not add any other text to a lilypondimg field, as it will be overwritten and discarded by the addon.

LilyPond Templates The addons21/123418104/lilypond directory holds template files for LilyPond. Templates can be created and edited from Anki, using the Tools->lilypond menu. An external editor is used. The default editor is xed, but you surely must adapt it for your specific setup: menu Tools->Addons, select this addon in the list, then click on Config. Modify the JSON config with the editor command (it may be necessary to include the path). Please restart Anki when you change templates. The default template is default.ly and used by: [lilypond]code[/lilypond] [lilypond=default]code[/lilypond] somefield-lilypond All other templates have to be specified by name: [lilypond=templatename]code[/lilypond] somefield-lilypond-templatename In the template, %ANKI% will be replaced with code. Multiple codes can be specified, by separating them with %%%: [lilypond] code1 %%% code2 [/lilypond] In the template, the first occurence of %ANKI% will be replaced with code1, the second occurence of %ANKI% with code2. The number of %ANKI% in the template has to match the number of codes used for this template always, otherwise the remaining occurences of %ANKI% will not be replaced, or the surplus specified codes will not be inserted. The default template looks like this: \paper{ indent=0\mm line-width=120\mm oddFooterMarkup=##f oddHeaderMarkup=##f bookTitleMarkup = ##f scoreTitleMarkup = ##f } \relative c'' { %ANKI% } Please refer to the LilyPond homepage and documentation for details on how to write LilyPond code.