On Wed, 12 Oct 2016, Henning Hraban Ramm wrote:

Now, I’d like to overwrite "texsettings.ly", containing the setting of ConTeXt’s text width, each time before I call LilyPond, to adapt its note line width to the current text width. That would automate the line width adaption to e.g. columns.

In the module’s documentation under "Dealing with expansion" I found the 
example of creating the filter command in a macro.
Can I use this to call a Lua function first and then LilyPond? Or is there a 
better way?

There is an internal option: filtersetups that may be useful for what you have in mind.

You can create a lua function, say lilypond.initialize(...), that does all the initializations, and then write

\startsetups lilypond:initialize

  [ ...

This is untested, but it should work.

If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net

Reply via email to