lilypond-user
[Top][All Lists]
Advanced

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

Re: unpacking a list


From: Urs Liska
Subject: Re: unpacking a list
Date: Mon, 30 Nov 2015 09:40:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


Am 30.11.2015 um 09:27 schrieb Urs Liska:
> Hi David,
>
> now finally to this one ...
>
> Am 28.11.2015 um 10:52 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> If someone might want to have a second look at the actual code it's
>>> (currently) in
>>> https://github.com/openlilylib/snippets/blob/just-intonation-stub/notation-snippets/just-intonation/definitions.ily,
>>> towards the end where it reads "(append (color-music col) ..."
>> Well, obviously you could just write
>>
>> #{ #@(color-music col) $pitch $duration -#(format "address@hidden" cent) #}
>>
>> instead of
>>
>>     (make-music
>>      'SequentialMusic
>>      'elements
>>      (append
>>       (color-music col)
>>       (list
>>        (make-music
>>         'NoteEvent
>>         'articulations
>>         (list (make-music
>>                'TextScriptEvent
>>                'text (format "address@hidden" cent)))
>>         'pitch pitch
>>         'duration ji-duration))))
>>
>> And it would likely result in somewhat better point-and-click behavior
>> out of the box (of course, one can fix the above make-music calls for
>> the same effect if it's a matter of professional pride).
> Indeed, that's much better and produces point-and-click *at all*. And
> especially it looks much more expandable once I might want to add more
> bells and whistles to the generated music.
>
> How would I find out about that solution? What I came up with was the
> result of taking \displayMusic's result as a model.
>
> Concretely: Can you tell me what the "#@" in front of (color-music does?

Maybe, not for having someone else do the work for me but as an
incentive to learn:

I assume I could also rewrite the following code in a similar fashion?

% Produce the code for coloring one grob in a (make-music) expression
#(define (color-element grob color)
   (make-music
    'ContextSpeccedMusic
    'context-type
    'Bottom
    'element
    (make-music
     'OverrideProperty
     'once
     #t
     'pop-first
     #t
     'grob-value
     color
     'grob-property-path
     (list (quote color))
     'symbol
     grob)))

What would that be in the newer, LilyPond-ish syntax?

TIA
Urs
>
> Thanks
> Urs
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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