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: David Nalesnik
Subject: Re: always set beam outside of staff
Date: Thu, 8 Sep 2016 07:26:31 -0500

Hi Michael,

On Thu, Sep 8, 2016 at 3:38 AM, Michael Winter
<address@hidden> wrote:
>  { d'16 [ r16  d'8 ] d'16 [ b'16\rest  d'8 ] \override Beam.positions =
> #'(3.5 . 3.5)  d'16 [ r16  d'8 ] d''16 [ r16  d''8 ]}
>
> In the above example there are 4 beamed groups.
>
> 1) default - the rest is pushed down
>
> 2) explicitly set rest y position using \rest - the beam stays in the
> same position and collides with the rest
>
> 3) explicitly set beam position - this looks close to what I want, but I
> really do not want to do this manually and I would like some minimal
> dampening. I have no idea how to generally / programatically get the
> beam out of the staff, get the rest where it would lie naturally of not
> within a beamed group (as in both this and the previous example), and
> have some dampening.
>
> 4) This group show that even if I were to try to set the position
> programatically, I would have to do it based on the stem direction. In
> this particular case I would need to set the position negative.
>
> So to recap, there are a few things I am trying to do: generally get the
> beam out of the staff, always center the rests vertically where they go
> when not under a beam, and have some dampening.
>

This looks to do what you want.

I don't know if you will encounter "kneed" beams.  That would require
some refinement.

\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']
}

Hope this helps,
David



reply via email to

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