opensubscriber
   Find in this group all groups
 
Unknown more information…

l : lilypond-user@gnu.org 7 July 2012 • 12:07AM -0400

LSR snippet "Controlling of the pitch range in a score" broken at 2.15.40
by Patrick or Cynthia Karl

REPLY TO AUTHOR
 
REPLY TO GROUP





The LSR snippet "Controlling of the pitch range in a score" contains the code for a function, colorizeOutOfRange.  This function works at 2.14.2, but doesn't at 2.15.40.

This can be demonstrated by compiling the following:

> \include "./colorize.ly"
>
> music = \relative c' { c d e f g a b }
>
> \new Staff { \colorizeOutOfRange d' a' \music }

where the file colorize.ly contains the following code from the cited snippet:

> 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))))
>  (if (and (ly:pitch? low-pitch)
>           (ly:pitch? high-pitch)
>           (ly:pitch<? low-pitch high-pitch))
>     (music-map
>       (lambda (evt)
>         (let ((p (ly:music-property evt 'pitch)))
>           (if (and (ly:pitch? p)
>                    (or (ly:pitch<? p low-pitch)
>                        (ly:pitch<? high-pitch p)))
>             (let ((tweaks (ly:music-property evt 'tweaks)))
>                 (ly:music-set-property! evt 'tweaks
>                     (acons 'color red tweaks))))
>           evt))
>       music)
>     music)))

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?


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu....
https://lists.gnu.org/mailman/listinfo/lilypond-user

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.