Re: [Tex-music] Wrong lyrics adjustments with hyphens

2011-08-16 Thread Rainer Dunker
Hello Simon!

Am 01.08.2011 schrieb Simon Dreher:
 I get a strange behavior of the lyrics placement when I adjust the 
 vertical position at a new line:
 The hyphens or melisma at the end of the old line already gets shifted 
 as if it were on the new line after the vertical shift. You can see this 
 in the example below at the end of the 4th and 5th system. How can I 
 correct this strange behavior?

This is due to a quite fundamental difficulty concerning the 
synchronization of lyrics layout changes at system breaks. Recently, 
Hermann Hinsch had similar problems with the same cause.

In every such case, this is the situation: You want to change the lyrics 
layout at the beginning of a new system. You thus place the respective 
command (e.g., \setsongraise) _after_ the last note of the pending 
system but _before_ the system break command (normally \alaligne). This 
seems correct only at the first glance; instead, musixlyr has to act on 
the lyrics of the pending system even _after_ the final note is 
processed. More precisely, it adds trailing hyphen sequences and lyrics 
extension underlines, and it does so during the processing of the 
\alaligne command. If the \setsongraise-or-whatever has occurred already 
before \alaligne, the hyphens or underlines appear at the new vertical 
position that is meant only for the next system.

Using plain MusiXTeX, the proper solution is easy: Wrap the lyrics 
layout change in \def\atnextline{...}--that way, the change is made 
effective at exactly the right processing stage.

But what to do using M-Tx? Since vertical lyrics shifting is a built-in 
language element, you can't influence its function directly. From my 
point of view, M-Tx itself should use \atnextline here (but that would 
be more complicated since such vertical shifting could also occur in the 
middle of a system; a distinction would thus be necessary). For you 
as the M-Tx user, the only workaround I can think of is: Instead of 
M-Tx's lyrics shifting command @+x, use PMX inline-TeX commands 
properly. For example, change your M-Tx input line

@-2 a4 } a a a |

to:

\\\def\atnextline{\mtxLyricsAdjust{1}{-9}}\ a4 } a a a |

(This works for me, at least.) \mtxLyricsAdjust{1}{-9} is 
literally what M-Tx outputs for @-2, so it should do the right thing; 
putting it into \atnextline makes it perform at the right moment.

However, you do have to pay attention to the shifting amount. M-Tx's '@' 
command uses relative numbers and translates them to absolute 
positioning numbers for \mtxLyricsAdjust. In the example case, the 
absolute position was -7 before the change, and the relative change by 
-2 turns it into -9. Later in your input file, when shifting back by 
@+2, you have to specify absolute position -7 again.

Hope that works,

Rainer
---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Wrong lyrics adjustments with hyphens

2011-08-16 Thread Dirk Laurie
On Tue, Aug 16, 2011 at 03:55:06PM +0200, Rainer Dunker wrote:
 For example, change your M-Tx input line
 
 @-2 a4 } a a a |
 
 to:
 
 \\\def\atnextline{\mtxLyricsAdjust{1}{-9}}\ a4 } a a a |
 

Ouch!  This is definitely the sort of thing that M-Tx was designed
to avoid.  Would it in other situations also be right to do that,
or only in this one?  If not so, can one identify the situation 
automatically so that M-Tx itself puts this in when needed?

Dirk
---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music