lilypond-user
[Top][All Lists]
Advanced

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

Re: [SPAM] Re: Tweaking in scheme


From: David Kastrup
Subject: Re: [SPAM] Re: Tweaking in scheme
Date: Mon, 29 Jun 2015 16:10:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"Peter Gentry" <address@hidden> writes:

>>-----Original Message-----
>>From: David Kastrup [mailto:address@hidden 

>>One can also try to do this kind of iteration oneself in order 
>>to only use the less invasive tweaks and get the color covered:
>>
>>\version "2.19.22"
>>tweakIV =
>>#(define-music-function (music) (ly:music?)
>>   (map-some-music
>>     (lambda (m)
>>       (and (music-is-of-type? 'note-event)
>>            (tweak 'color red (tweak 'style 'harmonic m))))
>>     music))
>>
>>If version 2.19.22 is not available, one can retain the 
>>parser/location arguments and replace the (tweak ...) line by 
>>the core of any of Harm's proposals.  map-some-music has been 
>>available since 2.16.0 at least, and all the rest for longer.
>
> Thanks for that I have downloaded 2.19.22 for even more fun....

Well, people got used to the entrails of LilyPond hanging all over their
code for the last dozen years or however long music functions existed.

But the road to working with Scheme is less yucky if one can keep them
out of sight until needed.

And (tweak 'color red (tweak 'style 'harmonic m))
beats having to write

((ly:music-function-extract tweak) parser location 'color red
  ((ly:music-function-extract tweak) parser location 'style 'harmonic m))

even though the latter was likely faster since it did not bother
checking the arguments for correctness.  But I don't actually think any
user-level code ever used ly:music-function-extract: people either used
#{...#} once it was powerful enough for that, or manually emulated
whatever the music function did.

-- 
David Kastrup



reply via email to

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