On 2024-12-14 17:51, Jason Yip - sripedia_getpgrp(a)slmail.me wrote:
On 2024-12-14 16:14, tran li - litran39(a)hotmail.com wrote:
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?
[...]
I don't know if a manual command that does what you want is even
possible, especially if no number is provided (assuming in the latest
development version). You could maybe define `\sdb` to take 2
arguments (the 2nd being the note itself) as a trick, though this is
not my area of expertise.
Try this (assuming if you are still ok with providing the subdivision
depth):
sdb = #(define-music-function
(n m)
(integer? ly:music?)
#{ \set stemRightBeamCount = #n
#m
\set stemLeftBeamCount = #n
#})
example = {
\relative c' { c16 [d e \sdb1 f g f e \sdb1 d c d e \sdb1 f g f e d] }
}