lilypond-user
[Top][All Lists]
Advanced

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

Re: autobeaming over rests,Re: autobeaming over rests


From: Valentin Petzel
Subject: Re: autobeaming over rests,Re: autobeaming over rests
Date: Sun, 29 Jan 2023 19:20:17 +0100

> The lower voice could not possibly be autobeamed anyway since it starts
> behind the beat.  You need to add all of the skips manually, and I don't
> think that adding the single beam you want would be enough effort to
> warrant autobeaming.

Why would this be so? Lilypond does not have issues autobeaming
{ s16 16 16 16}
for example. And using a convenience function only for entering the music the 
autoBeamSkips option produces the correct output simply from the code:

\layout {
  \context {
    \Voice
    \accepts "Notes"
  }
  \context {
    \name "Notes"
    \type "Engraver_group"
  }
}

alternateVoices =
#(define-music-function (d music) (ly:duration? ly:music?)
   (let* ((mdur (ly:music-length music))
          (mdur (moment->fraction mdur))
          (mdur (/ (car mdur) (cdr mdur)))
          (ddur (duration-length d))
          (times (/ mdur ddur 2)))
     (display times)
     #{
       <<
         \new Voice = "v1" { \voiceOne #(skip-of-length music) }
         \new Voice = "v2" { \voiceTwo #(skip-of-length music) }
         \new Notes { <<
           \repeat unfold #times { <>\change Voice = "v1" s$d <>\change Voice 
= "v2" s$d }
           #music
         >> }
       >>
     #}))

\new Staff \relative {
  \set Staff.autoBeamSkips = ##t
  \set Staff.beamExceptions = \beamExceptions { 16[ 16 16 16 16 16 16 16 16 16 
16 16] }
  \time 3/4
  \alternateVoices 16 {
    fis''16 d d d cis d d d e d cis d |
    d d fis d e d fis d g d e d |
    fis d d d cis d d d e d cis d |
  }
}

Cheers,
Valentin

Attachment: document.png
Description: PNG image

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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