Graham King <[email protected]> writes:
> On Tue, 2013-09-10 at 04:39 +0200, David Kastrup wrote:
>
>> Inside of markups, you can't use functions defined with
>> define-scheme-function (their argument parsing is just not compatible
>> with markup mode). Check out define-markup-command instead.
>>
>> As a note aside: case can't be used with strings as (eqv? "x" "x") => #f
>
>
>
> David, many thanks. A few hours reading and programming later, and I'm
> nearly there.
>
> #(define-markup-command (mensSign layout props text) (markup?)
> "Create the markup for an extended list of mensuration signs"
> (interpret-markup layout props
> (if (string=? text "C")
Since you use an argument of markup?, you might want to use equal?
instead of string=? here. Otherwise, if the argument is something like
\box { f }
you get into trouble.
> (markup (#:musicglyph "timesig.mensural44"))
> %......
> )))
>
> mensuration = #(define-music-function (P L mensuralTimesig .....)
> (string? .....)
> #{ \mark \markup {
> \concat {
> \mensSign mensuralTimesig
You probably mean \mensSign #mensuralTimesig here.
> " ("
> %................
>
> cantusMusic = \relative c' {
> %.....
> \mensuration #"C" %....
>
> This code is compiling successfully, but with two instances of
> "programming error: Object is not a markup."
Probably because of what you return when
(if (string=? "mensuralTimesig" "C") ...
goes into the else part.
> However, if I edit the mensuration function and replace
>
> \mensSign mensuralTimesig
>
> with
>
> \mensSign "C"
>
> the errors disappear and everything works beautifully.
Note that \mensSign mensuralTimesig is the same as \mensSign "mensuralTimesig"
and probably not what you expected.
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user