Re: TimeSignature with white border?

2009-04-10 Thread Mark Polesky

Mark Polesky wrote:
 Regarding snippet candidacy, I was thinking it would be
 better to allow the padding to be modified on-the-fly, 
 but it's not a big priority.

moved to new thread:
http://lists.gnu.org/archive/html/lilypond-user/2009-04/msg00383.html



  


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


Re: TimeSignature with white border?

2009-04-07 Thread Trevor Daniels

Snippet?

Trevor

- Original Message - 
From: Kieren MacMillan kieren_macmil...@sympatico.ca

To: Mark Polesky markpole...@yahoo.com
Cc: lilypond-user Mailinglist lilypond-user@gnu.org
Sent: Tuesday, April 07, 2009 4:25 AM
Subject: Re: TimeSignature with white border?



Mark,


This one is a little better.


You rock -- thanks!
Kieren.


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




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


Re: TimeSignature with white border?

2009-04-07 Thread Kieren MacMillan

Snippet?


Definitely!
Kieren.


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


Re: TimeSignature with white border?

2009-04-07 Thread Neil Puttock
2009/4/7 Kieren MacMillan kieren_macmil...@sympatico.ca:
 Snippet?

 Definitely!
 Kieren.

This will make an excellent snippet if it's amended slightly. :)

I hope Mark didn't spend too long working out the stencil overrides,
as there's already the public function stencil-whiteout (used for the
markup command \whiteout) which will do the job in one fell swoop:

\override Staff.Clef #'stencil =
#(lambda (grob) (stencil-whiteout (ly:clef::print grob)))

\override Staff.TimeSignature #'stencil =
#(lambda (grob) (stencil-whiteout (ly:time-signature::print grob)))

Regards,
Neil


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


Re: TimeSignature with white border?

2009-04-07 Thread Kieren MacMillan

Neil,


I hope Mark didn't spend too long working out the stencil overrides,
as there's already the public function stencil-whiteout (used for the
markup command \whiteout) which will do the job in one fell swoop:

\override Staff.Clef #'stencil =
#(lambda (grob) (stencil-whiteout (ly:clef::print grob)))

\override Staff.TimeSignature #'stencil =
#(lambda (grob) (stencil-whiteout (ly:time-signature::print  
grob)))


As the kids nowadays say... OMG!   =)

Thanks,
Kieren.


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


Re: TimeSignature with white border?

2009-04-07 Thread Mark Polesky

Neil Puttock wrote: 
 I hope Mark didn't spend too long working out the 
 stencil overrides, as there's already the public 
 function stencil-whiteout (used for the markup 
 command \whiteout) which will do the job in one 
 fell swoop...

Neil,

don't worry about my time! :}

It seems my programming style is reinventing the wheel
but sometimes I think that's a good way to learn. 

By the way, one benefit of my approach is that you can
select a padding so you can whiteout extra space around
the objects, but I suspect there's a trivial solution to
that as well? If so, let us know!

Regarding snippet candidacy, I was thinking it would be
better to allow the padding to be modified on-the-fly, 
but it's not a big priority.

- Mark


  


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


Re: TimeSignature with white border?

2009-04-07 Thread Neil Puttock
2009/4/7 Mark Polesky markpole...@yahoo.com:

 Neil,

 don't worry about my time! :}

 It seems my programming style is reinventing the wheel
 but sometimes I think that's a good way to learn.

Indeed, I've done a lot of that myself. :)

 By the way, one benefit of my approach is that you can
 select a padding so you can whiteout extra space around
 the objects, but I suspect there's a trivial solution to
 that as well? If so, let us know!

That's a definite advantage; stencil-whiteout doesn't give you that
option, but it could easily be copied into a file and tweaked
slightly.

Regards,
Neil


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


Re: TimeSignature with white border?

2009-04-06 Thread Mark Polesky
This one is a little better.
- Mark



  \version 2.13.0

#(define (whiteout-clef-stil grob)
   (let* ((x-pad 0.3)
  (this-stil (ly:clef::print grob))
  (stil-x-ext (ly:stencil-extent this-stil 0))
  (stil-y-ext (ly:stencil-extent this-stil 1))
  (box-x-ext (cons (- (car stil-x-ext) x-pad)
   (+ (cdr stil-x-ext) x-pad)))
  (box-y-ext stil-y-ext)
  (box-w (- (cdr box-x-ext) (car box-x-ext)))
  (box-h (- (cdr box-y-ext) (car box-y-ext)))
  )
 (ly:grob-set-property! grob 'stencil
  (ly:stencil-add
   (ly:make-stencil
(list 'embedded-ps
 (ly:format
  (string-append gsave\n
 currentpoint translate\n
 1 setgray\n
 ~a ~a ~a ~a rectfill\n
 grestore\n)
  (car box-x-ext)
  (car box-y-ext)
  box-w
  box-h))
stil-x-ext
stil-y-ext)
   this-stil

#(define (whiteout-time-signature-stil grob)
   (let* ((x-pad 1)
  (this-stil (ly:time-signature::print grob))
  (stil-x-ext (ly:stencil-extent this-stil 0))
  (stil-y-ext (ly:stencil-extent this-stil 1))
  (box-x-ext (cons (- (car stil-x-ext) x-pad)
   (+ (cdr stil-x-ext) x-pad)))
  (box-y-ext stil-y-ext)
  (box-w (- (cdr box-x-ext) (car box-x-ext)))
  (box-h (- (cdr box-y-ext) (car box-y-ext)))
  )
 (ly:grob-set-property! grob 'stencil
  (ly:stencil-add
   (ly:make-stencil
(list 'embedded-ps
 (ly:format
  (string-append gsave\n
 currentpoint translate\n
 1 setgray\n
 ~a ~a ~a ~a rectfill\n
 grestore\n)
  (car box-x-ext)
  (car box-y-ext)
  box-w
  box-h))
stil-x-ext
stil-y-ext)
   this-stil
 
whiteoutClefs = {
  \override Slur #'layer = #-2
  \override Staff.Clef #'avoid-slur = ##f
  \override Staff.Clef #'layer = #-1
  \override Staff.Clef #'stencil = #whiteout-clef-stil
}

normalClefs = {
  \revert Slur #'layer
  \revert Staff.Clef #'avoid-slur
  \revert Staff.Clef #'layer
  \revert Staff.Clef #'stencil
}

whiteoutTimeSignatures = {
  \override Slur #'layer = #-2
  \override Tie #'layer = #-2
  \override Staff.TimeSignature #'avoid-slur = ##f
  \override Staff.TimeSignature #'layer = #-1
  \override Staff.TimeSignature #'stencil =
#whiteout-time-signature-stil
}

normalTimeSignatures = {
  \revert Slur #'layer
  \revert Tie #'layer
  \revert Staff.TimeSignature #'avoid-slur
  \revert Staff.TimeSignature #'layer
  \revert Staff.TimeSignature #'stencil
}

\markup whiteoutClefs:
{
  \whiteoutClefs
  \clef bass e2. d4(
  \clef treble c''4) c''2.
}

\markup whiteoutTimeSignatures:
{
  \whiteoutTimeSignatures
  c''2. b'4^(tie)~
  \time 3/4 b'2 f'4^(slur)(
  \time 2/4 b'2)
  
}

\markup both:
{
  \whiteoutClefs
  \whiteoutTimeSignatures
  \clef bass d2. d4(
  \clef treble \time 3/4 e'4) e'2
}attachment: white-border_01.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: TimeSignature with white border?

2009-04-06 Thread Kieren MacMillan

Mark,


This one is a little better.


You rock -- thanks!
Kieren.


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


Re: TimeSignature with white border?

2009-04-05 Thread Mark Polesky
 From: Kieren MacMillan
 Is there a way to have the TimeSignature stencil
 output with a thin white border? That way, you
 could stack Slur, TimeSignature, and StaffSymbol
 grobs, and the Slur would look like it
 disappeared behind the TimeSignature.


Will using markup suffice?

\version 2.13.0

\markup \combine
  \musicglyph #clefs.G
  \whiteout \pad-markup #0.75 \musicglyph #accidentals.sharp

\markup \combine
  \musicglyph #clefs.G
  \whiteout \pad-around #0.75 \musicglyph #accidentals.sharp

\markup \combine
  \musicglyph #clefs.G
  \whiteout \pad-to-box #'(0 . 2) #'(-2 . 2)
\musicglyph #accidentals.sharp

- Mark



  attachment: white-border.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: TimeSignature with white border?

2009-04-05 Thread Kieren MacMillan

Hi Mark,


Will using markup suffice?


I've been doing something similar...
However, I'd like an automated way of outlining any #'stencil --  
maybe it's a task I can accomplish as a Frog?


Cheers,
Kieren.


\version 2.13.0

\markup \combine
  \musicglyph #clefs.G
  \whiteout \pad-markup #0.75 \musicglyph #accidentals.sharp

\markup \combine
  \musicglyph #clefs.G
  \whiteout \pad-around #0.75 \musicglyph #accidentals.sharp

\markup \combine
  \musicglyph #clefs.G
  \whiteout \pad-to-box #'(0 . 2) #'(-2 . 2)
\musicglyph #accidentals.sharp

- Mark



white-border.png




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


Re: TimeSignature with white border?

2009-04-05 Thread Mark Polesky
 From: Kieren MacMillan

 However, I'd like an automated way of outlining any #'stencil --  
 maybe it's a task I can accomplish as a Frog?

Kieren,

Here's something to fiddle with.
Just a start, but you could develop
it more if you're interested.

Hope it helps
- Mark


\version 2.13.0

#(define (whiteout-clef-stil grob)
  (let* ((pad 1)
 (this-stil (ly:clef::print grob))
 (stil-x-ext (ly:stencil-extent this-stil 0))
 (stil-y-ext (ly:stencil-extent this-stil 1))
 (stil-w (- (cdr stil-x-ext) (car stil-x-ext)))
 (stil-h (- (cdr stil-y-ext) (car stil-y-ext)))
 (box-x-ext (cons (- (car stil-x-ext) pad)
  (+ (cdr stil-x-ext) pad)))
 (box-y-ext (cons (- (car stil-y-ext) pad)
  (+ (cdr stil-y-ext) pad)))
 (box-w (- (cdr box-x-ext) (car box-x-ext)))
 (box-h (- (cdr box-y-ext) (car box-y-ext)))
 )
(ly:grob-set-property! grob 'stencil
 (ly:stencil-add
  (ly:make-stencil
   (list 'embedded-ps
(ly:format
 (string-append gsave\n
currentpoint translate\n
1 setgray\n
~a ~a ~a ~a rectfill\n
grestore\n)
 (car box-x-ext)
 (car box-y-ext)
 box-w
 box-h))
stil-x-ext
stil-y-ext)
  this-stil

whiteoutClef = {
  \override Slur #'layer = #-2
  \override Staff.Clef #'layer = #-1
  \override Staff.Clef #'stencil = #whiteout-clef-stil
}
normalClef = {
  \revert Slur #'layer
  \revert Staff.Clef #'layer
  \revert Staff.Clef #'stencil
}

{
  \whiteoutClef 
  \once \override Slur #'extra-offset = #'(0 . -2)
  \clef bass f,1^( \clef treble a'1)
}


  attachment: white-border-clef.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user