lilypond-user
[Top][All Lists]
Advanced

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

Re: Accidentals centred above notes


From: Janek Warchoł
Subject: Re: Accidentals centred above notes
Date: Thu, 7 Aug 2014 20:44:44 +0200

Hi,

2014-08-07 9:26 GMT+02:00 Phil Holmes <address@hidden>:
> ----- Original Message ----- From: "Richard Shann" <address@hidden>
> To: <address@hidden>
> Sent: Thursday, August 07, 2014 7:58 AM
> Subject: Accidentals centred above notes
> It looks like the use of the \sharp markup does indeed put the sharp sign
> somewhat left.  It looks to me like the ficta sharp is correctly aligned on
> the notehead.
>
> \relative c''' {
> a2^\markup { \sharp } ^\markup { | } \set suggestAccidentals = ##t ais
> ^\markup { | }
> }

Don't use \markup { | } for indicating center of the notehead.  It's a
pure coincidence that it looks like being centered; in fact it's
reference point (which is on the *left* edge of its bounding box
(which actually includes some whitespace)) is aligned on the refpoint
of the notehead (which again happens to be on the left edge of the
notehead - usually...).  I think this example may be quite revealing:

#(set-global-staff-size 50)
\relative c''' {
  % draw boxes around grobs, representing their extents
  \override TextScript.stencil =
  #(make-stencil-boxer 0.03 0 ly:text-interface::print)
  \override NoteHead.stencil =
  #(make-stencil-boxer 0.03 0 ly:note-head::print)
  \override NoteHead.style = #'altdefault
  a2^\markup { | } r a1 ^\markup { | } a\breve ^\markup { | }
}

For visualizing the center of the notehead, use articulation like
staccato or staccatissimo; they really are centered on the note.

Btw, that's also why \markup { \sharp } seems "a bit to the left" -
like all TextScripts, it simply has its refpoint aligned to notehead's
refpoint (which is usually equivalent to being left-aligned).


2014-08-07 14:02 GMT+02:00 Richard Shann <address@hidden>:
> On Thu, 2014-08-07 at 09:45 +0100, Richard Shann wrote:
>> I'll start digging around for what the syntax is to align markup other
>> than on the left side of notes - if anyone can just tell me I would be
>> grateful.
>
> I have come up with this:
>
> \version "2.18.0"
> \relative c''' {
> \once \override TextScript.self-alignment-X=#'-1.5  a2 ^\markup { \tiny
> \sharp}
> \set suggestAccidentals = ##t ais
> }

You asked about things changing in future LilyPond versions, and
actually this is an example: with 2.18, writing \override
TextScript.self-alignment-X = #something produces weird alignment.  I
believe it was a broken user-interface and i'm working on changing
that.  Please wait until
https://code.google.com/p/lilypond/issues/detail?id=4022 is merged;
after that you can use

\version "2.19.12"
\relative c''' {
  \once \override TextScript.self-alignment-X = #CENTER
  \once \override TextScript.parent-alignment-X = #CENTER
  a2 ^\markup { \tiny \sharp}
  \set suggestAccidentals = ##t ais
}

to get centered markup (note that, unlike your current code, this will
produce correct alignment regardless of the size of the notehead and
markup).

Maybe it will be later possible to use just \once \override
TextScript.self-alignment-X = #CENTER to get centered TextScripts.
I hope that this was helpful.

best,
Janek



reply via email to

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