lilypond-user
[Top][All Lists]
Advanced

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

Re: [SPAM] Re: Generating a (#:column ...) list in Scheme


From: Urs Liska
Subject: Re: [SPAM] Re: Generating a (#:column ...) list in Scheme
Date: Thu, 08 May 2014 17:25:54 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Hi David,

thanks for the assistance.

Am 08.05.2014 14:19, schrieb David Kastrup:
Urs Liska <address@hidden> writes:

Hi,

I have this construct in a function that creates a combined time signature:

    (grob-interpret-markup grob
      (markup #:override '(baseline-skip . 0) #:number
        (#:line ((#:column (numOne denOne))
                 (#:column (numTwo denTwo))))))

It creates two columns from the four given arguments, but I want to be
able to create an arbitrary number of columns.

I see that #:line gets a list of (#:column ()) entries.
But I'm lost with the #: part. What does that mean?

That's the markup macro.  It is documented in the Extending Guide.  More
or less.

And how can I generate such a list with an arbitrary number of
columns?

You can't actually do it in time since the whole point of a macro is
that it operates on its elements _before_ they are evaluated.

So the Extending Guide says:

Known issues and warnings
.........................

The markup-list argument of commands such as ‘#:line’, ‘#:center’, and
‘#:column’ cannot be a variable or the result of a function call.

      (markup #:line (function-that-returns-markups))

is invalid.  One should use the ‘make-line-markup’,
‘make-center-markup’, or ‘make-column-markup’ functions instead,

      (markup (make-line-markup (function-that-returns-markups)))


That's how far I got - after writing the email ...


So let's fiddle this in another way:

That's where I did _not_ get




Of course, we can just abandon hope regarding the markup macro and do
this as

and this neither.
But I could incorporate the second solution in my function, and now it's a neat \alternatingTimeSignatures function.

Compile the attached file to see it in action.
I think this should be generally available, and if you don't think it should be included in LilyPond I'll put it in the openLilyLib snippets.

Best
Urs

Attachment: alternatingTimeSignatures.ly
Description: Text Data


reply via email to

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