lilypond-devel
[Top][All Lists]
Advanced

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

Re: Is it possible to have a single \override for same context/Grob for


From: Neil Puttock
Subject: Re: Is it possible to have a single \override for same context/Grob for different property values?
Date: Mon, 24 Jan 2011 23:55:36 +0000

On 24 January 2011 17:30, James Lowe <address@hidden> wrote:

> So I wondered if it is possible to save some lines of code/simplify
> overrides for the same context/Grob such that I can write 'something like'
>
> \override context.GrobName ( ( #'property1 = #value1) (#'property2 =
> #value2) (#'property3 = #value3) )

Here's an idea:

overrideGrobProps =
#(define-music-function (parser location grob-name prop-list) (symbol?
cheap-list?)
   (make-sequential-music
    (map (lambda (entry)
           (make-grob-property-override grob-name (car entry) (cadr entry)))
         prop-list)))

\relative c' {
  c4 cis d des
  % apply \override to list of properties + values (not \once)
  \overrideGrobProps #'Accidental #`((color ,red) (font-size 4)
(extra-offset (1.5 . 3)))
  \overrideGrobProps #'NoteHead #'((style mensural) (duration-log 0))
  c4 cis d des
}

Cheers,
Neil



reply via email to

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