Am 05.02.19 um 17:42 schrieb Urs Liska:
Hi Mark,
Am 05.02.19 um 17:01 schrieb Urs
Liska:
Hi
Mark,
Am 05.02.19 um 16:56 schrieb Mark Knoop:
At 15:23 on 05 Feb 2019, Urs Liska
wrote:
I succeeded overriding a
MultiMeasureRest's stencil with a custom markup
to display arbitrary markups centered in a measure. So I
know how to use
the MMR's properties to determine a measure's center and
place custom
stencils appropriately.
However, now I have to do the same but not with text but
with arbitrary
notes. Unfortunately there's no stencil for a "note", so I'm
not sure if
I can make this approach work.
Would it be possible to manually combine (arbitrary)
notehead, stem and
flag to a custom stencil that I can then place inside the
staff by
overriding a MMR's stencil? Are there even tools to help me
with that?
It seems overkill, but you could try getting the stencil from
a \markup \score block stripped of unnecessary engravers.
Good idea!
I'll try that. SInce I'm stuffing this away in include files it
might be overkill but feasible.
It sort-of works.
I'm producing the stencil of a \markup \score _expression_
through this function
getNoteMarkupStencil =
#(define-scheme-function (grob music)(ly:grob? ly:music?)
(grob-interpret-markup grob
#{
\markup \score {
\new Staff $music
\layout {
\context {
\Score
\omit StaffSymbol
\omit Clef
\omit TimeSignature
\omit KeySignature
\omit BarLine
}
}
}
#}))
and pass it to a stencil override where two markups are also
combined above and below the staff.
The result (attached) is promising but not quite there yet. I
have the impression that space is left for the accidental,
whether it is there or not.
Do you have any idea how I could tackle this (without having me
to sort everything out into a MWE)?
Well, that's sort-of embarrassing ;-) Here's the MWE:
\version "2.19.82"
\layout {
\context {
\Staff
\omit Clef
\omit TimeSignature
}
}
{
c''1
}
{
cis''1
}
The space left to the notehead here is exactly the amount my
centered stencil is offset to the right.
And having the MWE available also made me find the solution
myself: \once \override NoteColumn.X-offset = -2. I assume this is
reverting
(first-note fixed-space . 2.0)
from some of the elements starting the staff.
For the record I'm posting this result.
Urs