lilypond-user
[Top][All Lists]

## Re: function to place markup in the same staff-position of the notehead?

 From: Dmytro O. Redchuk Subject: Re: function to place markup in the same staff-position of the notehead? Date: Thu, 3 Jun 2010 09:26:28 +0300 User-agent: Mutt/1.5.20 (2009-06-14)

On Wed 02 Jun 2010, 18:04 josé henrique padovani wrote:
> Hi,
Hi,

> I want to write a function to place markups (like \postscript
> blocks) just after (but in the same Y-offset) my noteheads...
>
> I know I have to use something like that to allow the TextScript to
> be inside the Staff, etc...
> \once \override TextScript #'outside-staff-priority = ##f
> \once \override TextScript #'side-axis = #0
> \once \override TextScript #'direction = #CENTER
> \once \override TextScript #'X-offset = #2
>
> But how do I get the staff-position of a note and use it to adjust
> the Y-offset of my markups? (is it the ly:grob-staff-position
> function?)
> And how do I set a function to do that?
>
> Any help is appreciated...
... not as an attempt to help, but rather to discuss once more.

Please take a look at this:

\version "2.13.22"  % 2.12.3 does the same here

\relative c'' {
\once \override TextScript #'Y-extent = #'(1 . -1)
\once \override TextScript #'Y-offset = #0
\textLengthOn
c -\markup \concat { \hspace#1.5 "script" } c c c
}

Here 'Y-extent for TextScript is set for something "unreal", "in order to make
a grob take up no [vertical here] space at all" (see the note for
'extra-spacing-width at IR 3.3). After that it's possible to specify it's
'Y-offset (its baseline) from the middle line "transparently" to other
objects --- so, it will be overwritten by others. To prevent this i've set
\textLengthOn and started markup with some space.

I was discouraged to do things like that (such 'Y-extent i mean) [1], however
i could not find a better way to do this for DynamicLineSpanner, for example.

Surely, would like to know a better way to do that, for any object, either
TextScript or DynamicLineSpanner.

______________________
1. http://lists.gnu.org/archive/html/lilypond-user/2010-05/msg00242.html

>
> josé
>
> --