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 <david.nales...@gmail.com> 
> 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



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

Reply via email to