lilypond-user
[Top][All Lists]
Advanced

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

Re: moving tweaks into markup-definition


From: David Nalesnik
Subject: Re: moving tweaks into markup-definition
Date: Tue, 16 Sep 2014 17:52:47 -0500

Hello,

On Tue, Sep 16, 2014 at 4:33 PM, Orm Finnendahl <address@hidden> wrote:
Hi,

 here is the next question:

Is there a way to move the tweaks in the following code into the
markup definition of secs so that they don't clutter up the score?


The only way I can think of doing this is to add (property . value) pairs to the contents of props.  The following works for your tweaks, but it won't work for every overridable property: 'color and 'transparent don't work, for example.

I'd be interested to know if there's a better way to do this.

Anyway, I hope this is useful.

 %<------------------------------------------------------------
\version "2.19.5"

#(define-markup-command (secs layout props numsecs)
   (string?)
   (let* ((immutable (car props))
          (mutable (cadr props))
          (font-defaults (caddr props)))
     (set! mutable (assoc-set! mutable 'self-alignment-X -0.5))
     (set! mutable (assoc-set! mutable 'padding 4))
     ;(set! mutable (acons 'padding 4 mutable)) ; this doesn't take--why not?
     (set! props (list immutable mutable font-defaults))
     
     (interpret-markup layout props
       (markup
        #:fontsize -1
        #:bold numsecs))))

{ r1 \fermata
  ^\markup \secs #"> 2\"" }
%<------------------------------------------------------------

reply via email to

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