lilypond-user
[Top][All Lists]
Advanced

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

Re: How to read out the number of beams and the space between them?


From: harm6
Subject: Re: How to read out the number of beams and the space between them?
Date: Mon, 17 Oct 2011 15:15:04 -0700 (PDT)

Hi David,


David Nalesnik-2 wrote:
> 
> Hi Harm,
> 
> On Sun, Oct 16, 2011 at 2:36 PM, Thomas Morley <
> address@hidden> wrote:
>>
>>
>> I regarded the gap-property, but \once\override Beam #'gap = #15 seems to
>> do nothing, so I dropped that thought.
>>
> 
> You have to do this instead:
> 
> \once \override Beam #'length-fraction = #15
> 
> (See  http://www.mail-archive.com/address@hidden/msg65014.html)
> 

I tried the 'length-fraction property. But with (let ((l-f (ly:grob-property
grob 'length-fraction)))) I got '() eyery time.
So I dropped 'gap and 'length-fraction and it ends up with starting this
Thread.:)


> I noticed that your function as it stands only aligns the bracket
> correctly
> with \stemUp.  I don't know if this is your intention. 
> 
I wrote this little test-function only to show the problem and to test
possible solutions. The original function is very large (about 200 lines). I
thought it could be a good idea to make it a little bit shorter.:D
And I don't mind if the test-function doesn't works in all cases.


> I've been thinking about this some more.  Specifically, I've noticed that
> adding the beam widths and the spaces between the beams doesn't seem to
> add
> up precisely to the total extent of the beam.  The result is that the size
> of the bracket is off -- noticeably so in the first beamed group.
> 
> I don't know why this is the case.  (I hope that somebody with more
> expertise could answer this.)
> 
I noticed this too. This was one of the difficulties I had to solve in the
original function. (I hope I've done it)


> If you use stencil extents, however, you can avoid the problem entirely
> and
> simplify the function:
> 
> \version "2.14.2"
> 
> #(define (stencil-plus-bracket grob)
>  (let* ((beam (ly:beam::print grob))
>         (beam-extent-Y (ly:stencil-extent beam Y))
>         (bracket (ly:bracket Y
>                    (cons (car beam-extent-Y)
>                          (cdr beam-extent-Y))
>                    0.05 0.4)))
> 
>    (ly:stencil-add
>      beam
>      (ly:stencil-in-color
>        (ly:stencil-translate
>          bracket
>          (cons -1 0))
>        1 0 0))))
> 
> \relative c' {
>   \stemUp
>   \override Beam #'stencil = #stencil-plus-bracket
>   f'32 [f f f]
>   f16 [f f f]
>   f64 [f f f]
> }
> 
> 

Many thanks to work on my test-function, but your suggestion doesn't work
with all possible beams.
Try: 
\relative c' {
  \stemUp
  \override Beam #'stencil = #stencil-plus-bracket
  f32 [f']
}

Anyway, I will post my function once work is finished. I can see the end. 
And if other problems with it are appearing, I start a new thread hoping you
can answer my questions again.;)

Thanks a lot,
  Harm

-- 
View this message in context: 
http://old.nabble.com/How-to-read-out-the-number-of-beams-and-the-space-between-them--tp32662208p32671061.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.




reply via email to

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