lilypond-user
[Top][All Lists]
Advanced

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

Re: Horizontal beam parallel to staff


From: Ahanu Banerjee
Subject: Re: Horizontal beam parallel to staff
Date: Tue, 11 May 2021 01:05:55 -0400

Thank you both, very helpful!

Cheers, 
-Ahanu 

On Tue, May 11, 2021, 01:02 Aaron Hill <lilypond@hillvisions.com> wrote:
On 2021-05-10 9:10 pm, Pierre Perol-Schneider wrote:
> Hi Ahanu,
> How about:
>
> \version "2.20.0"
> {
>   %\override Beam.damping = #5
>   \override Beam.positions = #'(5 . 5)
>   g''8 b b c'' c'' b b g''
> }

And for an automated approach:

%%%%
\version "2.22.0"

#(define NEAR -1)
#(define FAR 1)
flattenPositions =
#(define-scheme-function
   (rel-pos) (number?)
   (grob-transformer 'positions
    (lambda (grob orig)
     (let* ((dir (ly:grob-property grob 'direction))
            (ys (ordered-cons (car orig) (cdr orig)))
            (y (interval-index ys (* dir rel-pos))))
      (cons y y)))))

{
   \override Beam.positions = \flattenPositions #NEAR
   g''8 b b c'' a' b'' b'' d'
   \override Beam.positions = \flattenPositions #CENTER
   g''8 b b c'' a' b'' b'' d'
   \override Beam.positions = \flattenPositions #(* 2 FAR)
   g''8 b b c'' a' b'' b'' d'
}
%%%%


-- Aaron Hill

reply via email to

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