lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing functions for large-scale layout


From: David Kastrup
Subject: Re: Writing functions for large-scale layout
Date: Thu, 25 Oct 2012 22:49:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Christopher Smith <address@hidden> writes:

> I am working on typesetting Anglican preces and responses, and since
> the apparent best approach is to embed a score inside the
> instrumentName for one of the parts (similar to the treatment of the
> incipits in the scores at http://www.uma.es/victoria/partituras.html),
> I would like to write a reusable function that takes the Voices for
> the cantor's line and each part in the response and composes them into
> the appropriate layout.
>
> I'm running into an issue with the Lilypond API that I'm having
> trouble understanding: How do I get the return value of a Scheme
> function embedded into my output?
>
> The attached snippet includes a function that takes the music blocks
> and should return a score.  Lilypond will happily run it, but the
> score doesn't get set onto the page.  I've confirmed that extracting
> the Lilypond block and putting it where I had my \precesAndResponse
> invocation produces the expected output.  Is there something explicit
> that I need to do, either in the function or in the call, to have the
> output printed?

Assign the result to a variable xxx and use \xxx.  If you go "what?!?",
that just means that I have a reasonably good grasp of what would feel
natural and useful to users.

I am just not finished with my work on those kinds of things.

Oh, and what should also work is writing
$#{ \schemefunctioncall ... #}

The main problem with getting scheme functions work in every
circumstance is the argument list parsing in combination with lookahead,
and #{ ... #}, calling its own parser and knowing exactly where the
argument list ends, does not have a problem with that.

Not pretty, I agree.  But the best I can think of right now.  I'll
likely come to deal with that in the next month or two.  While you
probably can't speed this up much as I am already spending all my time
working on LilyPond, you might consider joining those users who keep me
afloat with financial support to make sure I don't have to quit before
getting there.  The LilyPond Report #24
<URL:http://news.lilynet.net/?The-LilyPond-Report-24#an_urgent_request_for_funding>
carries the details, and all the following reports tell to which degree
this is working out.

At any rate, at the current point of time, there are just music, event,
and scheme functions.  Scheme functions work seamlessly already for
strings and markups (and Scheme expressions and function arguments, of
course_), but it is taking time and effort getting more expression
classes covered.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]