On Sun, Aug 30, 2026 at 9:23 AM Yoshiaki Onishi <[email protected]>
wrote:

> Dear Thomas,
>
> > Sorry for not being clear - solution anyone?
> >
> > This gives what I do not want:
> >
> > \version "2.27.2"
> > \relative c' {
> > \set subdivideBeams = ##t
> > \tuplet 6/4 { c16 c c c \tuplet 3/2 { c c c} }
> > }
> >
> > Result:
> > c[ c c] c[ \tuplet c c c]
> >
> > I want:
> > c[ c] c[ c] \tuplet c[ c c]
> >
> > … and a primary beam for the whole expression.
> >
> >
>
> Here is my solution:
>
> %% BEGIN %%
> \version "2.27.2"
> \relative c' {
>  \set subdivideBeams = ##t
>  \tuplet 6/4 { c16
>                \set stemRightBeamCount = 1
>                c
>                \set stemLeftBeamCount = 1
>                \set stemRightBeamCount = 2
>                c
>                \set stemLeftBeamCount = 2
>                \set stemRightBeamCount = 1
>                c \tuplet 3/2 { \set stemLeftBeamCount = 1 c c c} }
> }
> %% END %%
>
> With my Frescobaldi, I set keyboard shortcuts for
> "\set stemRightBeamCount =" and "\set stemLeftBeamCount =“ as I use them
> quite often.
>

Although a more elegant solution was put forward in another thread, I
thought I'd share a music function that uses the pattern:

stemRightBeamCount = n
note
stemLeftBeamCount = n

...which I encounter often.  You could use it like this:

%%%
\version "2.26.0"

% Subdivide beams
% e.g.: a32 \sdb #2 b a b
sdb = #(define-music-function
   (n m)
   (integer? ly:music?)
   #{
     \set stemRightBeamCount = #n
     #m
     \set stemLeftBeamCount = #n
   #})

\relative c' {
  \tuplet 6/4 { c16 \sdb #1 c c \sdb #1 c \tuplet 3/2 { c c c} }
}
%%

--
Knute Snortum

Reply via email to