Re: scheme problem: colored background, layers

2014-12-06 Thread Big Noise

Hi guys,

...always open for new challenges...
I've opened a new thread for this new subject:
http://lists.gnu.org/archive/html/lilypond-user/2014-12/msg00112.html
Thanks to Urs and Malte for your ideas.

Cheers,
Klaus


Am 04.12.2014 um 18:01 schrieb lilypond-user-requ...@gnu.org:

From: Malte Meyn To: lilypond-user@gnu.org Subject: Re: scheme problem: 
colored background, layers Am 04.12.2014 um 00:13 schrieb Urs Liska:



Am I seeing correctly that the arrows are coded with absolute
coordinates from their starting points (i.e. they wouldn't adapt to
layout changes)?
This is not at all diminishing your snippet, but it would be absolutely
awesome if someone could extend this to override the stencil of, say, a
slur, so the arrows would snap to two notes.


Probably a glissando or a voice follower (both engraved by the
Note_head_line_engraver) would be better/easier to reuse than a slur
since these arrws look like some sort of ?voice following? ;)


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


Re: scheme problem: colored background, layers

2014-12-04 Thread Malte Meyn



Am 04.12.2014 um 00:13 schrieb Urs Liska:


Am I seeing correctly that the arrows are coded with absolute
coordinates from their starting points (i.e. they wouldn't adapt to
layout changes)?
This is not at all diminishing your snippet, but it would be absolutely
awesome if someone could extend this to override the stencil of, say, a
slur, so the arrows would snap to two notes.

Probably a glissando or a voice follower (both engraved by the 
Note_head_line_engraver) would be better/easier to reuse than a slur 
since these arrws look like some sort of “voice following” ;)


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


Re: scheme problem: colored background, layers

2014-12-03 Thread Big Noise

Hi everybody,

now I could finish two scores that have been waiting for that colored 
background trick. Maybe they are somewhat extreme examples...

If anyone is interested:
http://jkg-musik.jimdo.com/lilypond

For the colored arrows from the second example, I've created a snippet 
as well:

http://lsr.di.unimi.it/LSR/Item?u=1id=961

Cheers,
Klaus

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


Re: scheme problem: colored background, layers

2014-12-03 Thread Urs Liska


Am 03.12.2014 22:31, schrieb Big Noise:

Hi everybody,

now I could finish two scores that have been waiting for that colored 
background trick. Maybe they are somewhat extreme examples...

If anyone is interested:
http://jkg-musik.jimdo.com/lilypond


This is absolutely great!
I think this would be a good item for http://lilypond.org/examples.html.

Otherwise it'd be cool if you could write something on Scores of Beauty 
about it.





For the colored arrows from the second example, I've created a snippet 
as well:

http://lsr.di.unimi.it/LSR/Item?u=1id=961


Am I seeing correctly that the arrows are coded with absolute 
coordinates from their starting points (i.e. they wouldn't adapt to 
layout changes)?
This is not at all diminishing your snippet, but it would be absolutely 
awesome if someone could extend this to override the stencil of, say, a 
slur, so the arrows would snap to two notes.


Best
Urs



Cheers,
Klaus

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



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


Re: scheme problem: colored background, layers

2014-12-02 Thread Pierre Perol-Schneider
Add to the LSR : http://lsr.di.unimi.it/LSR/Item?id=960
Waiting for your comments.
Cheers,
Pierre

2014-12-02 7:25 GMT+01:00 Pierre Perol-Schneider 
pierre.schneider.pa...@gmail.com:

 Hum, interesting Klaus!
 I'll take a closer look today.
 Cheers,
 Pierre

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


Re: scheme problem: colored background, layers

2014-12-02 Thread Ben Big Noise
Wow - that's amazing. Having contributed to the LSR feels good :)

Thanks for adding and code optimizing.

Cheers, 
Klaus


Am 02.12.2014 um 09:41 schrieb Pierre Perol-Schneider 
Add to the LSR : http://lsr.di.unimi.it/LSR/Item?id=960

Waiting for your comments.

Cheers,

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


Re: scheme problem: colored background, layers

2014-12-02 Thread Johan Vromans
On Tue, 2 Dec 2014 11:05:20 +0100
Ben Big Noise benbigno...@gmx.de wrote:

 Wow - that's amazing. Having contributed to the LSR feels good :)

This is *very* nice. Kudos to Klaus and Pierre!

-- Johan

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


Re: scheme problem: colored background, layers

2014-12-02 Thread Urs Liska


Am 02.12.2014 11:29, schrieb Johan Vromans:

On Tue, 2 Dec 2014 11:05:20 +0100
Ben Big Noise benbigno...@gmx.de wrote:


Wow - that's amazing. Having contributed to the LSR feels good :)

This is *very* nice. Kudos to Klaus and Pierre!

-- Johan



Yes, from me too. I have immediately tagged this as to be investigated 
for our editorial tools collection.


Urs

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


Re: scheme problem: colored background, layers

2014-12-02 Thread Johan Vromans
On Tue, 02 Dec 2014 11:43:41 +0100
Urs Liska u...@openlilylib.org wrote:

 Yes, from me too. I have immediately tagged this as to be investigated 
 for our editorial tools collection.

One of the first purposes that came to my mind was marking (colour coding)
changes in a score, automatically, directly from git.

(We all use version control on our scores, don't we?)

-- Johan

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


Re: scheme problem: colored background, layers

2014-12-02 Thread Urs Liska


Am 02.12.2014 13:01, schrieb Johan Vromans:

On Tue, 02 Dec 2014 11:43:41 +0100
Urs Liska u...@openlilylib.org wrote:


Yes, from me too. I have immediately tagged this as to be investigated
for our editorial tools collection.

One of the first purposes that came to my mind was marking (colour coding)
changes in a score, automatically, directly from git.

(We all use version control on our scores, don't we?)

No, should we?  ;-/


-- Johan



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


Re: scheme problem: colored background, layers

2014-12-01 Thread Big Noise

Hi Pierre,

thanks for taking the time to think about it.
Meanwhile, after some sleepless nights ;-)  I've found another way to 
get some results:


% ---
\version 2.18.0

colorSpan =

#(define-music-function (parser location y-lower y-upper color) (number? 
number? color?)


#{

\override Staff.HorizontalBracket #'stencil =

$(lambda (grob)

(let* (

(area (ly:horizontal-bracket::print grob))

(X-ext (ly:stencil-extent area X))

(Y-ext (ly:stencil-extent area Y))

)

(set! Y-ext (cons y-lower y-upper)

)

(ly:grob-set-property! grob 'layer -10)

(ly:make-stencil (list 'color color

(ly:stencil-expr (ly:round-filled-box X-ext Y-ext 0))

X-ext Y-ext))

))

#})

{

 { R1

\colorSpan #-5 #5 #(rgb-color 1.0 0.9 0.5) c'2\startGroup g' c' \stopGroup

\colorSpan #0 #5 #(rgb-color 0.5 1.0 0.5)

r4\startGroup r \stopGroup

\colorSpan #-5 #0 #(rgb-color 0.9 1.0 0.5) r\startGroup r\stopGroup }

\\

{

\override Voice.ClusterSpanner.color = #(rgb-color 0.5 0.6 1)

\override Voice.ClusterSpanner.layer = #-1

\makeClusters { s1 c'2 g' c' s s1 }

}



}

\layout {

\context {

\Voice

\consists Horizontal_bracket_engraver

\override HorizontalBracket #'thickness = #0

\override HorizontalBracket #'bracket-flare = #'(0 . 0)

\override HorizontalBracket #'Y-extent = #'(0 . 0)

\override HorizontalBracket #'edge-height = #'(0 . 0)

\override HorizontalBracket #'Y-offset = #0

\override HorizontalBracket #'shorten-pair = #'(-1 . -0.75)

}

}

% ---

Result: 
http://4.bp.blogspot.com/-THmAQWfqDaw/VHztoaE6N2I/ACs/9Sqgl4ViMBc/s1600/ly-ex3.gif


This time, I abused the Horizontal_bracket_engraver that is used for 
\startGroup and \stopGroup and replaced it's stencil by a rectangle.
Because it's not attached to the StaffSymbol, it can be placed in a 
different layer, so the blue cluster and the staff lines both stay visible.
Anyway, LilyPond does the horizontal spacing without the need for manual 
work.


This might make life easier for doing crazy things like this:
http://4.bp.blogspot.com/-kEXoxAx6HG0/VHzvH9GW9KI/AC8/48vNguVdp2A/s1600/ly-ex4.gif
http://4.bp.blogspot.com/-ChtL4-lGKoE/VHzvHuNU76I/AC4/Do8L81Al19I/s1600/ly-ex5.gif


Cheers,
Klaus Blum




Am 29.11.2014 um 10:43 schrieb Pierre Perol-Schneider:

Hi Klaus,

2014-11-29 10:30 GMT+01:00 Big Noise benbigno...@gmx.de 
mailto:benbigno...@gmx.de:


thanks for your reply.
Unfortunately, changing the layer value from -10 to -2 doesn't
help. The problem is that the function places the staff lines and
the colored rectangle into the *same* layer, whereas I need to
leave the staff lines in layer 0 and put the rectangle into layer
-2 (or even less).
This would allow me to put other clusters *between* them like in
the first example.


Right ! Now I see the problem, 'seems that I've replied without 
thinking...


I have already found another interesting snippet:
http://lsr.di.unimi.it/LSR/Item?id=953
But in that case, I would have to find the dimensions for the
rectangle by trial-and-error, whereas overriding the StaffSymbol
seems to be a very easy way...


Actually I've made this one (which is more or less a draft). I'll try 
to see what I can do with it. No promise though :(


Cheers,
Pierre



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


Re: scheme problem: colored background, layers

2014-12-01 Thread Pierre Perol-Schneider
Hum, interesting Klaus!
I'll take a closer look today.
Cheers,
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme problem: colored background, layers

2014-11-29 Thread Pierre Perol-Schneider
Hi,

2014-11-29 1:15 GMT+01:00 Big Noise benbigno...@gmx.de:


 Here is my problem:
 Now the staff lines and the yellow rectangle are located in the same
 layer, so it's not possible to place the blue cluster between them.
 Is there a way to make the scheme function put the staff lines
 (StaffSymbol) and the yellow rectangle into different layers?



How about changing the layer value from -10 to -2 ?

bgColor =
#(define-music-function (parser location y-lower y-upper color) (number?
number? string?)
   #{
 \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)
   (+ (cdr Y-ext) y-upper)))
  ;; change layer's value to -2
  (ly:grob-set-property! grob 'layer -2)
  (ly:stencil-add
   (ly:make-stencil (list 'color (eval-string color)
  (ly:stencil-expr (ly:round-filled-box X-ext
Y-ext 0))
  X-ext Y-ext))
   staff)))
 \startStaff
   #})

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


Re: scheme problem: colored background, layers

2014-11-29 Thread Big Noise

Salut Pierre,

thanks for your reply.
Unfortunately, changing the layer value from -10 to -2 doesn't help. The 
problem is that the function places the staff lines and the colored 
rectangle into the *same* layer, whereas I need to leave the staff lines 
in layer 0 and put the rectangle into layer -2 (or even less).
This would allow me to put other clusters *between* them like in the 
first example.


I have already found another interesting snippet: 
http://lsr.di.unimi.it/LSR/Item?id=953
But in that case, I would have to find the dimensions for the rectangle 
by trial-and-error, whereas overriding the StaffSymbol seems to be a 
very easy way...


Cordialement,
Klaus Blum


Am 29.11.2014 um 10:05 schrieb Pierre Perol-Schneider:

Hi,

2014-11-29 1:15 GMT+01:00 Big Noise benbigno...@gmx.de 
mailto:benbigno...@gmx.de:


Here is my problem:
Now the staff lines and the yellow rectangle are located in the
same layer, so it's not possible to place the blue cluster between
them.
Is there a way to make the scheme function put the staff lines
(StaffSymbol) and the yellow rectangle into different layers?



How about changing the layer value from -10 to -2 ?

bgColor =
#(define-music-function (parser location y-lower y-upper color) 
(number? number? string?)

   #{
 \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)
   (+ (cdr Y-ext) y-upper)))
  ;; change layer's value to -2
  (ly:grob-set-property! grob 'layer -2)
  (ly:stencil-add
   (ly:make-stencil (list 'color (eval-string color)
  (ly:stencil-expr (ly:round-filled-box 
X-ext Y-ext 0))

  X-ext Y-ext))
   staff)))
 \startStaff
   #})

HTH
Pierre


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


Re: scheme problem: colored background, layers

2014-11-29 Thread Pierre Perol-Schneider
Hi Klaus,

2014-11-29 10:30 GMT+01:00 Big Noise benbigno...@gmx.de:


 thanks for your reply.
 Unfortunately, changing the layer value from -10 to -2 doesn't help. The
 problem is that the function places the staff lines and the colored
 rectangle into the *same* layer, whereas I need to leave the staff lines in
 layer 0 and put the rectangle into layer -2 (or even less).
 This would allow me to put other clusters *between* them like in the first
 example.


Right ! Now I see the problem, 'seems that I've replied without thinking...


 I have already found another interesting snippet:
 http://lsr.di.unimi.it/LSR/Item?id=953
 But in that case, I would have to find the dimensions for the rectangle by
 trial-and-error, whereas overriding the StaffSymbol seems to be a very easy
 way...


Actually I've made this one (which is more or less a draft). I'll try to
see what I can do with it. No promise though :(

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