lilypond-user
[Top][All Lists]
Advanced

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

Re: LSR snippet "Controlling of the pitch range in a score" broken at2.1


From: David Kastrup
Subject: Re: LSR snippet "Controlling of the pitch range in a score" broken at2.15.40
Date: Fri, 06 Jul 2012 18:33:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

"Phil Holmes" <address@hidden> writes:

>>> colorizeOutOfRange = #(define-music-function (parser location
>>>                        low-note high-note music )(ly:music?
>>> ly:music? ly:music?)
>>> "Colorizes in red notes out of range `low-note `high-note"
>>> (let* (
>>>   (low-elts (ly:music-property low-note 'elements))
>>>   (high-elts (ly:music-property high-note 'elements))
>>>   (low-pitch (and (pair? low-elts)
>>>                   (ly:music-property (car low-elts) 'pitch)))
>>>   (high-pitch (and (pair? high-elts)
>>>                    (ly:music-property (car high-elts) 'pitch))))
>>
>> When compiled with lilypond 2.14.2 the notes c and b are colored
>> red. When compiled with lilypond 2.15.40, all notes are black.
>>
>> Does anyone know a fix for colorizeOutOfRange?
>
>
> Have you tried updating it with convert-ly?

Would not help.  It relies on single notes being wrapped inside of
EventChord which is no longer the case.  It was a change to the
internals making a lot of things easier or possible to do in the first
place (fully functional music functions inside of chords, tweaks working
on single notes, q implemented in a reliably robust way, #{ ... #} being
useful inside of chords and other things).

Much more straightforward, but incompatible.  One could have band-aid
patched the code by putting

  (set! low-note (event-chord-wrap! low-note parser))
  (set! high-note (event-chord-wrap! high-note parser))

in, but it was much easier to just create a working replacement (posted
separately) that does not even need to dig into the internals.

-- 
David Kastrup




reply via email to

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