[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improving this "Markup anywhere" snippet
From: |
Lukas-Fabian Moser |
Subject: |
Re: Improving this "Markup anywhere" snippet |
Date: |
Tue, 15 Feb 2022 19:41:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
Hi Colin,
I wonder whether any of you Lilypond wizards could help me work out
how to improve my Lilypond scores.
Most of my embellishments come from reading/copying bits of code from
this forum - but I admit I don't always fully understand why things
work. However, I have this 'snippet' which I call "Markup anywhere",
which basically allows a markup to be added without disrupting any of
the positioning of other items.
What I would like is to know how it can be improved - so that I can
use it without copying large chunks of code whenever it is required.
The amended markup is demonstrated here:-
c1^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)
\translate #'(-10.0 . -4.0)
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "LimeGreen")
\box \box \whiteout
"Put your text here"
Could this be streamlined and generalised somehow, and yet still be
able to accept various variable to alter position/colour etc
\null \with-dimensions ... seems strange: \null produces an empty
markup, and _then_ the actual command begins. So you can simplify to
\markup \with-dimensions-from \null \translate .....
Just as a side note - why does the \whiteout not work perfectly?
For the whiteout, try specyfing
\override TextScript.layer = 1000
in the music or in the \layout { } block to make sure that text scripts
are put in the foreground and do not lie under other layout objects.
Does this help already?
Lukas