lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use arbitrary notes (with stem/flag) as MMR stencil override


From: Urs Liska
Subject: Re: Use arbitrary notes (with stem/flag) as MMR stencil override
Date: Tue, 5 Feb 2019 17:42:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

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)? Is this the negative part of the extent of the note's NoteColumn or so? Or rather some space at the beginning of a score (the one between the time signature and the first note for example (where, I believe, a leading accidental is printed right into)?

The thing is, I can also pass more than one note to that function, and it will still leave exactly that space in front. When the first note has an accidental or not all the notes remain at the same position, just the accidental is added to the left.

After having written this I'm pretty sure the problem is that space before the first note of a score/system. How can I remove that in the Score definition above?

Thanks
Urs



Attachment: 1756_025_2.png
Description: PNG image

Attachment: 1756_025_2.png
Description: PNG image

Attachment: 1756_025_2.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]