Inserting a "hard" white space?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Inserting a "hard" white space?

Alasdair McAndrew
Hello,

I have created a few expression marks (for some early 18th century music I'm trying to typeset) which I put into place with carefully adjusted x and y offsets.  The trouble is that Lilypond doesn't take these marks into account when spacing out notes and bars, and sometimes the expression mark is written over by a bar line.

All I want is some way of adding some extra space after a bar line.  Something like 

    | " "

would be lovely if it worked, which of course it doesn't.  I know that "s" adds a blank note; what I'm after is like a blank note that also has zero duration!

What is the approved or simplest way of adding extra space after a bar line?  Note that I don't need to add extra space after every bar line, just occasionally.

Reply | Threaded
Open this post in threaded view
|

Re: Inserting a "hard" white space?

Aaron Hill
On 2020-09-09 7:27 pm, Alasdair McAndrew wrote:
> I have created a few expression marks (for some early 18th century
> music
> I'm trying to typeset) which I put into place with carefully adjusted x
> and
> y offsets.  The trouble is that Lilypond doesn't take these marks into
> account when spacing out notes and bars, and sometimes the expression
> mark
> is written over by a bar line.

This could point to issues with how you are defining expression marks.  
Ideally, you should prefer an approach that gives LilyPond enough
information to make the appropriate decisions regarding spacing, so that
the BarLine and custom expression mark do not collide.


> What is the approved or simplest way of adding extra space after a bar
> line?  Note that I don't need to add extra space after every bar line,
> just
> occasionally.

Consider the following:

%%%%
\version "2.20.0"

mx = -\tweak extra-offset #'(-1.5 . 4.35)
      _\markup \sans x

fx = -\tweak font-size #0
      -\tweak X-offset #-1.5
      -\tweak Y-offset #0
       \finger \markup \normal-text \vcenter \sans x

{ | b'1
   | b'4 \mx b'2.
   | \tweak extra-spacing-width #'(-1.5 . 0)
     b'4 \mx b'2.
   | b'4 \fx b'2. }
%%%%

\mx is defined using a TextScript grob that is manually re-positioned
via extra-offset, whereas \fx uses the Fingering grob that is positioned
relative to the NoteHead via X-offset and Y-offset.

To avoid the collision between the BarLine and \mx, we can \tweak the
extra-spacing-width of the NoteHead to ask LilyPond to reserve more
space before the note.  No such \tweaking is needed for \fx to avoid
collision.


-- Aaron Hill

bar-line-spacing.cropped.png (10K) Download Attachment