lilypond-user
[Top][All Lists]
Advanced

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

Re: Two bits of markup at the same point in the music?


From: David Kastrup
Subject: Re: Two bits of markup at the same point in the music?
Date: Mon, 10 Dec 2012 17:00:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Richard Shann <address@hidden> writes:

> Thank you very much for this answer. One minor puzzle: what is the
> hyphen doing before \tweak in these examples?
> I have tried the same script with and without the hyphen and (on 2.16.0)
> I get the same pdf.
> That is, this seems to work just fine:
>
>   <>\tweak #'extra-offset #'(0 . 2) ^\markup {"pizz."}
>   <>\tweak #'extra-offset #'(0 . -10) _\markup {"3"}

The problem is that it is misinterpreted in a manner that happens to
work more by accident than anything else.  If you write

\displayMusic {
 <>\tweak #'extra-offset #'(0 . 2) ^\markup {"pizz."}
 <>\tweak #'extra-offset #'(0 . -10) _\markup {"3"}
}

you'll get to see
(make-music
  'SequentialMusic
  'elements
  (list (make-music
          'EventChord
          'elements
          '())
        (make-music
          'TextScriptEvent
          'tweaks
          (list (cons (quote extra-offset) (cons 0 2)))
          'direction
          1
          'text
          (markup #:line (#:simple "pizz.")))
        (make-music
          'EventChord
          'elements
          '())
        (make-music
          'TextScriptEvent
          'tweaks
          (list (cons (quote extra-offset) (cons 0 -10)))
          'direction
          -1
          'text
          (markup #:line (#:simple "3")))))

which implies that the markups are not actually attached to the chords
<> but are hanging in the air as if they were proper music events
themselves.

So it is more or less a coincidence of several ill-defined behaviors
that this invalid music expression happens to produce the expected
results in the output.

I _am_ planning to make this work as expected (namely making the tweaked
scripts a part of the chords, like done with -\tweak) eventually, and
then not just by several bugs cancelling each other.  But that's not
there yet.

In the mean time, I'll probably submit code producing an error as long
as this does not work in the right manner.

> Thanks too to Eluze for his response. And the handy warning that the
> syntax is changing (I can put in a conditional to cover this).

The "old syntax" for this simple form of a \tweak has no expiration date
since version 2.17.6 makes extra-offset a nicer alternative form for
specifying #'extra-offset and/or #'(extra-offset).  So no need for a
conditional here: just use the "old form", and simplify at any point of
time you want after 2.16 starts being history to you.

-- 
David Kastrup



reply via email to

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