[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Setting subdivide beams in a more straightforward manner
From: |
tran li |
Subject: |
Setting subdivide beams in a more straightforward manner |
Date: |
Sun, 15 Dec 2024 09:15:48 +0800 |
User-agent: |
Mozilla Thunderbird |
Below is a minimal example of setting subdivide beams in LilyPond:
\version "2.24.4"
\language "english"
rb = #(define-music-function
(n)
(integer?)
#{ \set stemRightBeamCount = #n #})
lb = #(define-music-function
(n)
(integer?)
#{ \set stemLeftBeamCount = #n #})
example = {
\relative c' { c16[ d e \rb1 f \lb1 g f e \rb1 d \lb1 c d e \rb1 f
\lb1 g f e d] }
}
\score {
\new Staff { \example }
}
However, to manually (I mean, here, not to use LilyPond's auto-beaming
functionality for subdivide beams, because even till now I still cannot
be clear how subdivide beams in auto-beaming works and trying relevant
commands often cannot bring me to the desired result) create subdivide
beams, in the example above, you must say `\rb` and `\lb` before and
after the last note of each subgroup, respectively. This is not quite
convenient and not straightforward, because it isn't quite intuitive for
code readers to identify that it refers to subdivision. my desired
effect is just using one command like `\sdb` (abbreviation for subdivide
beam), and transform the above code into:
example = {
\relative c' { c16[ d e f \sdb g f e d \sdb c d e f \sdb g f e d] }
}
So, is it possible?
Best regards,
F. X. P.