Hi,
I need to define new items to attach to notes that center-align to the
note heads. These should be either regular texts or drawn paths. I know
a few approaches but haven't found a working solution for me, so I'd be
happy to get some hints (or solutions).
As I want *some* of the objects to be used as a drop-in replacement for
existing commands like \upbow the following solution doesn't work:
upbow =
#(define-music-function ()()
#{
\tweak self-alignment-X #CENTER
-\markup "hin."
#})
because
c4 \upbow
will fail with the complaint about an unexpected post-event (I have to
write -\upbow)
The second limitation to this is that it doesn't align to the notehead's
center but to the stem. Therefore I thought creating either an
articulation or a dynamic text.
Creating a new articulation (or overwriting the definition of an
existing one) seems tempting using something like
#(append! default-script-alist
(list
`("scriptDownbow"
. ((script-stencil . (feta . ("dfermata" . "ufermata")))
; any other properties
(toward-stem-shift-in-column . 0.0)
(padding . 1)
(avoid-slur . around)
(direction . ,UP)
))
))
% create postfix commands to use the articulations
downbow = #(make-articulation "scriptDownbow")
This successfully makes \downbow use the fermata instead of the regular
glyph. However, it seems there's no way to make that use a markup or a
path instead of an Emmentaler glyph (if this old information
(https://www.mail-archive.com/lilypond-user@gnu.org/msg64645.html) still
holds true).
Creating a dynamic script is easy:
upbow =
#(make-dynamic-script
(markup
(#:normal-text "hin.")))
However, I have two problems with this approach:
How can I make sure the dynamics stay on one vertical line? Attaching
them directly to the note gives the result as in the attached
"horizontal-shift.png" while dynamics printed in a Dynamics context
don't seem to avoid collisions, and I don't know how to avoid that.
So, is there any reasonable way to create something (function,
articulation, dynamics) with the following characteristics:
* can be written like articulations/dynamics (i.e. with or without
postfix operator)
* can be forced to a common vertical baseline with other elements
* pushes notecolumns to obtain the necessary space (like \textLengthOn
does for markup)
?
Any advice would be appreciated!
Urs
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user