The reason I want to do this is because in drum notation, a buzz roll is
indicated with a "z" on the stem (or in the case of a whole note, just below
the head). So what I want is a script that always places the text (in this
case "z") under the note head.
I have used the following script
z = #(define-music-function (parser location x y ) (ly:music? ly:music?)
#{
\once \override Score . TextScript #'extra-offset = #'(-.5 . 3) %
Positions the "z" on the stem
s1*0_\markup{\large \dynamic z} ( % Prints and formats the "z", start of
slur
$x s1*0 ) $y % Prints the notes, end of slur
#})
But obviously this places all z:s on the same height. (Except when there are
tuplet brackets, then another offset value has to be used somehow...) Is
there a way to to this without the extra-offset? As you said, there are a
lot of collisions.
Maybe one way would be to make sure all text is in one row (overriding
dynamic line spanners and tuplet brackets) and then use different offset
values depending on where the notehead is? (Only one line is used in drum
notation and the noteheads are above or below the line.)
On Mon, Aug 11, 2008 at 19:28, Valentin Villenave
<address@hidden>wrote:
2008/8/11 Emil Anonymous <address@hidden>:
> I want to put text on certain stems, just under the notehead. How do I do
> this?
I don't know what you're trying to achieve, but I'm not certain
overriding extra-offset is the best solution here: it can cause many
ugly collisions.
Besides, you're referring to stems but your example shows a whole note
-- with no stem! :-)
If you want a quick way to write your markup, it's simple to do
txt = \markup { \large text }
{ c1_\txt }
If you want to use an override, you can use
txt =
#(define-music-function (parser location note) (ly:music?)
#{ \once \override Score.TextScript #'extra-offset = #'(-.5 . 3)
$note _\markup { \large text } #})
{
\txt c1
}
Finally, another option would be to move your text *inside* the markup
(without any \override); you can read the folowing section, which I've
just rewritten:
http://kainhofer.com/~lilypond/Documentation/user/lilypond/Text-alignment.html<http://kainhofer.com/%7Elilypond/Documentation/user/lilypond/Text-alignment.html>
Cheers,
Valentin