lilypond-user
[Top][All Lists]
Advanced

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

Re: Extended mensuration signs in markup via Scheme


From: Graham King
Subject: Re: Extended mensuration signs in markup via Scheme
Date: Tue, 10 Sep 2013 18:31:39 +0100

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")
      (markup (#:musicglyph "timesig.mensural44"))
%......
)))

mensuration = #(define-music-function (P L mensuralTimesig .....)
                  (string? .....)
    #{ \mark \markup {
            \concat {
                \mensSign mensuralTimesig 
                " ("
%................

cantusMusic = \relative c' {
    %.....
    \mensuration #"C"  %....

This code is compiling successfully, but with two instances of "programming error: Object is not a markup."
However, if I edit the mensuration function and replace
\mensSign mensuralTimesig
with
\mensSign "C"
the errors disappear and everything works beautifully.  Utterly baffling!  I'd be grateful for any hints from you or any other guru.


reply via email to

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