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: Carl Sorensen
Subject: Re: Is it possible to have a single \override for same context/Grob for different property values?
Date: Mon, 24 Jan 2011 17:10:56 -0700



On 1/24/11 4:55 PM, "Neil Puttock" <address@hidden> wrote:

> 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)))

If you use pairs, instead of lists, for the property overrides then the
override list is a standard  alist:

\overrideGrobProps #'Accidental #`((color . ,red) (font-size . 4)
(extra-offset . (1.5 . 3)))

Seems like this might be able to be implemented in core LilyPond, but it's a
GLISS topic, I think.

Great idea!

Carl




reply via email to

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