Changes

Jump to navigation Jump to search
478 bytes added ,  20:15, 22 February 2018
m
fix link of filter module
< [[Graphics]] | [[Using Graphics]] >
[http://lilypond.org LilyPond] is a great music engraver, and you can include LilyPond in ConTeXt source using [[moduleshttps://github.com/adityam/filter|the filter module]] with some setup. This is different from using the lilypond-book preprocessor with LaTeX. (For LaTeX there’s also a package that works similar to our ConTeXt setup here: [https://github.com/jperon/lyluatex lyluatex].)
== Simple Filter Setup ==
directory=lilytemp/, % directory for LilyPond's files
output={\externalfilterbasefile.pdf},
filtercommand={lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts -ddelete-intermediate-files -o"lilytemp/\externalfilterbasefile" "\externalfilterinputfile"}]
</texcode>
directory=\LILYTEMP/,
output={\externalfilterbasefile.pdf},
filtercommand={lilypond -dbackend=eps -dinclude-eps-fonts -dno-gs-load-fonts -o"\LILYTEMP/\externalfilterbasefile" "\externalfilterinputfile"}]
</texcode>
If you have just one LilyPond part per component (e.g. songs in a songbook), you could use <tt>[name=\currentcomponent]</tt>.
 
== Automatical width adaption ==
 
If you want to set your note line width automatically to your current text width, try this:
 
-- this goes after "create temp folder"
io.savedata("\LILYTEMP/texsettings.ly", "\\paper { line-width = " ..
string.gsub(number.todimen(tex.dimen.textwidth),"pt","\\pt") .. " } \n")
 
and then adapt your snippets or preamble buffer:
<texcode>
\include "../mysettings.ly"
\include "texsettings.ly"
</texcode>
 
You must comment/delete the "line-width" setting in mysettings.ly, otherwise it doesn’t work.
== Example ==

Navigation menu