lilypond-user
[Top][All Lists]
Advanced

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

Re: always set beam outside of staff


From: Michael Winter
Subject: Re: always set beam outside of staff
Date: Thu, 8 Sep 2016 09:01:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Thank you David!

This is a great start. And at the very least gets me to the point where
manual overrides will not be as numerous.

I also think I can play with this to get a bit more natural dampening.
Plus this is a good opportunity to get my feet wet with scheme.

Quick thought (to maybe deal with the dampening part) and since you
clearly know how to get values from the grobs which is where I was
unclear...

Is there a way to get the min and max note positions. Then this could be
done by setting Stem.details.beamed-lengths and allowing the dampening
to remain.

Either way, what you have will definitely work!

Best,

Michael


On 09/08/2016 06:01 AM, David Nalesnik wrote:
> On Thu, Sep 8, 2016 at 7:26 AM, David Nalesnik <address@hidden> wrote:
>
>> \version "2.19.46"
>>
>> #(define my-positions
>>    (lambda (grob)
>>      (let* ((stems (ly:grob-object grob 'stems))
>>             (first-stem (ly:grob-array-ref stems 0))
>>             (dir (ly:grob-property first-stem 'direction)))
>>        (if (eq? dir UP)
>>            (cons 3.5 3.5)
>>            (cons -3.5 -3.5)))))
>>
>> {
>>   \override Beam.positions = #my-positions
>>   d'16 [ r16  d'8 ] d'16 [ r16  d'8 ]
>>   d'16 [ r16  d'8 ] d''16 [ r16  d''8 ]
>>   d''16 [ r16  d''8 ] d'16 [ r16  d''8 ]
>>   d''16 [ r16  d''8 ] d'''16 [ r16  d'''8 ]
>>
>>   r16[d'' d'' d'']
>>   r16[d' d' d']
>> }
>
> The above sets positions to an arbitrary height outside of the staff.
> We need to consider that setting might be too low/high:
> \version "2.19.46"
>
> #(define my-positions
>    (lambda (grob)
>      (let* ((default-pos (beam::place-broken-parts-individually grob))
>             (left-pos (car default-pos))
>             (right-pos (cdr default-pos))
>             (stems (ly:grob-object grob 'stems))
>             (first-stem (ly:grob-array-ref stems 0))
>             (dir (ly:grob-property first-stem 'direction))
>             (new-pos
>              (if (eq? dir UP)
>                  (max 3.5 left-pos right-pos)
>                  (min -3.5 left-pos right-pos))))
>        (cons new-pos new-pos))))
>
> {
>   \override Beam.positions = #my-positions
>   d'16 [ r16  d'8 ] d'16 [ r16  d'8 ]
>   d'16 [ r16  d'8 ] d''16 [ r16  d''8 ]
>   d''16 [ r16  d''8 ] d'16 [ r16  d''8 ]
>   d''16 [ r16  d''8 ] d'''16 [ r16  d'''8 ]
>
>   r16[d'' d'' d'']
>   r16[d' f' a']
>   f'' d'' b' g'
>   \stemUp f'' d'' b' g'
>   \stemUp f''' d''' b'' g''
> }
>
> -David





reply via email to

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