Re: Highlight or Cross out measures

2015-03-16 Thread Jay Anderson
On Mon, Mar 16, 2015 at 8:48 AM, Klaus Blum  wrote:
> maybe this could help you:
>
> %
> -
> \version "2.18.2"
>
> bgColor =
> #(define-music-function (parser location y-lower y-upper color) (number?
> number? color?)
>#{\stopStaff
>  \override Staff.StaffSymbol $'stencil =
>  $(lambda (grob)
> (let* ((staff (ly:staff-symbol::print grob))
>(X-ext (ly:stencil-extent staff X))
>(Y-ext (ly:stencil-extent staff Y)))
>   (set! Y-ext (cons
>(+ (car Y-ext) (+ y-lower 2))
>(+ (cdr Y-ext) (- y-upper 2
>   (ly:grob-set-property! grob 'layer -10)
>   (ly:stencil-add
>(ly:make-stencil (list 'color color
>   (ly:stencil-expr (ly:round-filled-box X-ext
> Y-ext 0))
>   X-ext Y-ext))
>staff)))
>  \startStaff
>#})
>
> \relative c' {
>   c1
>   \bgColor #-2 #2 #yellow
>   c1
>   \stopStaff \revert Staff.StaffSymbol $'stencil \startStaff
>   c1
>   \bgColor #-3 #2 #green
>   c1
> }
> %
> -
>
> It's based on the code of snippet 726 which you've already found.
> There has been another thread about that:
> http://lilypond.1069038.n5.nabble.com/scheme-problem-colored-background-layers-td169023.html
> 
>

Awesome. That worked great. Thanks.

-Jay

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


Re: Highlight or Cross out measures

2015-03-16 Thread Klaus Blum
Hi Jay, 

maybe this could help you: 

%
-
\version "2.18.2"

bgColor =
#(define-music-function (parser location y-lower y-upper color) (number?
number? color?)
   #{\stopStaff
 \override Staff.StaffSymbol $'stencil =
 $(lambda (grob)
(let* ((staff (ly:staff-symbol::print grob))
   (X-ext (ly:stencil-extent staff X))
   (Y-ext (ly:stencil-extent staff Y)))
  (set! Y-ext (cons
   (+ (car Y-ext) (+ y-lower 2))
   (+ (cdr Y-ext) (- y-upper 2
  (ly:grob-set-property! grob 'layer -10)
  (ly:stencil-add
   (ly:make-stencil (list 'color color
  (ly:stencil-expr (ly:round-filled-box X-ext
Y-ext 0))
  X-ext Y-ext))
   staff)))
 \startStaff
   #})

\relative c' {
  c1
  \bgColor #-2 #2 #yellow
  c1
  \stopStaff \revert Staff.StaffSymbol $'stencil \startStaff
  c1
  \bgColor #-3 #2 #green
  c1
}
%
-

It's based on the code of snippet 726 which you've already found. 
There has been another thread about that:
http://lilypond.1069038.n5.nabble.com/scheme-problem-colored-background-layers-td169023.html
<http://lilypond.1069038.n5.nabble.com/scheme-problem-colored-background-layers-td169023.html>
  

Cheers, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Highlight-or-Cross-out-measures-tp173198p173221.html
Sent from the User mailing list archive at Nabble.com.

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


Highlight or Cross out measures

2015-03-15 Thread Jay Anderson
I want to be able to highlight sections (just a few measures).

Some past work:
- http://lsr.di.unimi.it/LSR/Snippet?id=699 - manual markup
  - http://lists.gnu.org/archive/html/lilypond-user/2008-09/msg00083.html
- http://lsr.di.unimi.it/LSR/Snippet?id=726 - colors whole staff

Has there been any other work on this in the intervening years? My
other thoughts are to use analysis brackets or draw custom bar lines
to denote the sections.

-Jay

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