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

2011-08-18 Thread Rainer Dunker
Sorry--once again, now _with_ the promised attachment ...

Am 18.08.2011 schrieb Rainer Dunker:
 Hello Dirk!
 
 Am 16.08.2011 schrieb Dirk Laurie:
  On Tue, Aug 16, 2011 at 03:55:06PM +0200, Rainer Dunker wrote:
   [...]
   \\\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?
 
 I'd say it would be wrong to do that always. See the Winter ade 
 example in the musixlyr documentation: There, a double-line lyrics 
 section is continued with a single lyrics line in mid-system; you can't 
 delay the vertical shift up to the system end in this case.
 
  If not so, can one identify the situation 
  automatically so that M-Tx itself puts this in when needed?
 
 On the one hand, yes: If the vertical lyrics shift occurs after the last 
 note of the pending system, it should be synchonized with the system 
 break. But, as far as I unterstand, M-Tx doesn't know where the system 
 break will happen--PMX is the earliest processing stage where this 
 information is available. Therefore, the M-Tx processor itself has no 
 chance to detect the situation. (Right?)
 
 But maybe the \mtxLyricsAdjust command could be empowered to detect 
 its own calling context. This TeX macro, inserted by M-Tx into the 
 output literally, is executed by TeX _after_ PMX has decided about the 
 system breaks. Maybe, with a bit of luck, it could grasp this 
 information somehow and use it for a proper vertical lyrics shift.
 
 I had a look in the .tex file resulting from Simon's problem example and 
 noticed that both \mtxLyricsAdjust calls (generated by M-Tx) occur right 
 before the \alaligne calls (generated by PMX). Assumed that this is 
 always the case, \mtxLyricsAdjust could look ahead for the TeX command 
 directly following it (using TeX's \futurelet command), and if it finds 
 \alaligne, it knows that the lyrics shift occurs at a system break, 
 otherwise not.
 
 Although this appears to be a really dirty and fragile solution, at 
 least I managed to put it all together into a working example 
 (attached to this message). But I'm far from sure whether this would 
 work in every case and would not raise unwanted side effects 
 (especially due to the uncumulative use of \atnextline).
 
 Could you please have a look at it and evaluate whether it is generally 
 feasible? If you conclude that it's not, I may dig into musixlyr again 
 to see whether it can be made more aware of such vertical shifts and to 
 react properly itself, but I guess this would be so intricate that a 
 workaround for those rare problematic cases would still be more 
 appropriate.
 
 Best regards,
 
 Rainer
Systems: 2
Style: Singer
%%\let\mtxLyricsAdjustOrig\mtxLyricsAdjust
%%\def\mtxLyricsAdjust#1#2{%
%%  \def\mtxLyricsAdjustArgOne{#1}%
%%  \def\mtxLyricsAdjustArgTwo{#2}%
%%  \futurelet\mtxLyricsAdjustNextToken\mtxLyricsAdjustInternal
%%}
%%\def\mtxLyricsAdjustInternal{%
%%  \ifx\mtxLyricsAdjustNextToken\alaligne
%%\def\atnextline{%
%%  \mtxLyricsAdjustOrig\mtxLyricsAdjustArgOne\mtxLyricsAdjustArgTwo}%
%%  \else
%%\mtxLyricsAdjustOrig\mtxLyricsAdjustArgOne\mtxLyricsAdjustArgTwo%
%%  \fi
%%}

@-2 g g g g | g @+4 g g g | @-4 g g g g | g g g g
L: bla bla bla bla bla bla bla bla-bla bla bla bla bla bla bla bla
---
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-18 Thread Dirk Laurie
On Thu, Aug 18, 2011 at 04:02:43PM +0200, Rainer Dunker wrote:
 
 Am 16.08.2011 schrieb Dirk Laurie:
  On Tue, Aug 16, 2011 at 03:55:06PM +0200, Rainer Dunker wrote:
   [...]
   \\\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?
 
 I'd say it would be wrong to do that always. 
...
 Although this appears to be a really dirty and fragile solution, ...
 But I'm far from sure whether this would work in every case and 
 would not raise unwanted side effects... 
 Could you please have a look at it and evaluate whether it is generally 
 feasible? 
...
From a pure M-Tx point of view, I'd rather introduce syntax for 
postponing something to the next line than special-case code that
may itself have exceptions.  E.g. `!@-9` to make `@-9` act later.
In PMX `!` occurs only inside comments, in M-Tx only on uptext
lines.

Would this not be a more versatile solution, maybe even at the PMX 
level?  Could I have some feedback from people who write a lot of 
scores? Just grep for `atnextline` in your .mtx and/or .pmx files.
I know there is a lot of them in André van Ryckeghem's edition of 
the Deutsche Messe.  

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


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

2011-08-18 Thread Dirk Laurie
On Thu, Aug 18, 2011 at 05:52:45PM +0200, Don Simons wrote:
 I believe you're right that PMX doesn't now use ! at all. And I'd be glad
 to help however I can. But I'm very unclear on what you are proposing at
 the PMX level. Would the stuff after ! be PMX command(s), in-line TeX to
 be put into \atnextline, or something else? And if it is just stuff to go in
 \atnextline, what would be the advantage over simply using inline TeX within
 PMX?
 

Maybe in PMX there isn't anything except TeX that one would like to
take effect only at the next line, in which case there is no argument.

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


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


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

2011-08-02 Thread rainer . dunker
Hello Simon!

-Ursprüngliche Nachricht-
Von: Simon Dreher simon.dre...@gmx.net
Gesendet: 01.08.11 00:47:44
An: Werner Icking Music Archive tex-music@tug.org
Betreff: [Tex-music] Wrong lyrics adjustments with hyphens

Hello,
 
 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. [...]

I'm sure I can tell something meaningful about that, but since I'm on holiday 
for two weeks, please be patient a bit ...

Best regards,

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


[Tex-music] Wrong lyrics adjustments with hyphens

2011-07-31 Thread Simon Dreher

Hello,

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?


Viele Grüße,
Simon

PS: I also get the strange problem with the missing repeat in this 
example...


--888888888888--
Title: Lieber Freist\adtler
Composer: W.~A.~Mozart
Style: SINGER
Meter: C
Sharps: 2
Pages: 1
Systems: 7
%Bars/line:8
%Space: -18
%%\input musixtmr
%%\twelverm
%\input musixlth
%\hlthick.5pt% staff line thickness
%\stemthick.5pt  % stem thickness
%\blthick.5pt % normal bar line thickness
%\Blthick.6\Interligne% bold bar line thickness (repeat, etc.)
%
%Default-Werte:
%\hlthick.4pt% staff line thickness
%\stemthick.4pt  % stem thickness
%\blthick.4pt % normal bar line thickness
%\Blthick.6\Interligne% bold bar line thickness (repeat, etc.)

{S1}
Lie-ber Frei-st\adt-ler, lie-ber Gau-li-mau-li,
lie-ber Sta-chel-schwein, wo gehn Sie hin, wo gehn Sie hin, wo gehn Sie hin?
Et-wa zum Fin-to, o-der zum Scul-tet-ti? Ha, wo-hin, wo-hin?
Zum Scul-tet-ti, zum Fin-to, zum Fin-to, zum Scul-tet-ti. Ei,
zu kein'm von bei-den, ei, zu kein'm von bei-den, nein, son-dern zum 
Kit-scha
geht der Herr von Li-lien-feld, und nicht der Frei-st\adt-ler, nein, 
auch nicht der Gau-li-mau-li,

we-der der Sta-chel-schwein, son-dern der Herr von Li-lien-feld.

%%h170m
%%It150ipi
%%B
%%Apl+t+seb
%%\\nobarnumbers\
%\\def\writebarno{\ifnum\barno1\llap{\oldstyle\the\barno\barnoadd}\fi}\
%\\def\shiftbarno{1\Interligne}\
%\\def\raisebarno{2\Interligne}\
U:1.
@-7 f2 f | g e4 e | f f f f | g2 e | c2+.a | \\\scale{1.3}\ d4 [ c8 b ] 
a4 b | \\\scale{1}\

L:{S1}

%%L2
f2 e | d8 c d e f e f g |

U:@ @ 2.~~
a2 of d4- d8 d | e2 a- | a4+.d- d d | e2 a- | a+ r4 e | f d d+ r | r a8 
a [ a b ] g a |


[ f e ] d c d c d e |

U:@ @ 3.~~
f4 of d a2+ | r4 a a a | a a- { a2+ |

%%L5
Space: +3
@-2 a4 } a a a |

   a a- g2+ | f f4 g |
C: ~ ~  g-   f- f- g-

a0 |
C: a-

d4- a8+ g f g f e |

Space: -3
U:@ @ 4~~
@+2 d4 of d+ { d2 | d4 } [ c8 b ] c4 b8 a | d4 d- { d2 |

d8 } d c b c4 a |

e4+ e8 e g c- c4 | [ d8 f ] a g f4 e | d2 c | d4 r r2 of :|
---
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