Greetings:

I had just gotten nicely to sleep (for a long winter's nap :-), and I heard
someone suggesting "changes to MusixFlx...)!!!

If anyone considers doing this, there are are a few serious things to
consider...

First, (as I recall the code), the tricky problem facing Musixflx is to keep
strictly in sync with MusixTex line breaking decisions.  It is MusixTex that
makes the choice as to where the line breaks occur.  Keeping "in sync" is
already a tricky problem for Musixflx, considering the limited information
that mfx (i.e. musixflx) has to work with, and due to certain MusixTex
extensions made after musixflx was first designed.

The last update to mfx addressed a problem where Mtx (i.e. MusixTex) was
placing more or less spacing in a last measure than mfx thought,
specifically when processing \xbars, with embedded key and time signature
changes.  We were fortunate to solve this problem (without changes to
MusixTex) because a hack was developed which attempts (successfully?) to
detect WHEN \xbars occur, which is accomplished by emperically tracking
tell-tale characteristics of the spacing data written to the file by Mtx
from pass 1. (Xbar detection logic was installed.)  Then, if an xbar is "in
process" AND there is a sign, key, meter... change affecting the first
measure of the NEXT bar, spacing for the current line is adjusted to (now,
hopefully) be correct... That is, it more perfectly anticipates what Mtx
will do during Pass 2.

The problem is:  Mfx DOES NOT determine the line breaks.  It simply tracks
where it believes the line breaks will occur, and calculates the correct
spacing for each line.  The nice, exact spacing of tokens occurs because mfx
has told Mtx what internote spacing to use.  Then Mtx, without any other
biases, finds the horizontal box (hbox) full "just right" at the point it
decides to do the line break.  If Mtx makes a different decision in pass 2,
such as opting to break at a different measure, or deciding to put something
more or less in a measure (unknown to mfx), then mfx was wrong about the
spacing, and the notorious "overfull" or "undefull" hboxes occur.

The \xbar + sign change problem was tricky because IF Mtx decided (in pass
2) that it needed to either post or revoke the posting of a discretionary
sign/clef/meter change, but mfx (which did not know everything about xbar
behavior) was not aware that Mtx would switch the amount of spacing during
Pass 2, then the calcuations were wrong both for the current line and the
next line.  It was the discretionary behavior of the sign change posting
that was typically to blame for the difference in space placement during
xbars at the end of lines.

This principle must be observed:  MusixTex Pass 2 behavior should NOT be
allowed to diverge from Pass 1 behavior with respect to where line break
decisions occur, or WHAT is in a given line as a result of every line break
decision.  (It was the peculiar and divergent issue of discretionary sign
change postings during xbars that caused the last headache with mfx.)
Observe that Pass 1 is BOUND to Pass 2.  The only magic between the .MX1
file and the .MX2 file is the spacing computation done by Musixflx (which is
NOT magic at all!!), and Musixflx is not a good place to decide the line
breaking points.

I strongly endorse this design philosophy:  Once Pass 1 completes, MusixTex
should have already made the decision as to where each line break should
occur, and (therefore) what the lines should contain.  It is unfortunate,
unnecessary and undesirable behavior for MusixTex to conclude something
different during Pass 2.

Well, momentarily side-stepping that tricky little monster called
Musixflx...  I observe that there is already a healthy amount of
"discretionary" activity that MtX accomplishes at line breaks, particularly
involving both sign change, clef change, meter change and bar change
postings.  (And, only in a few strange cases does this decision come out
differently during Pass 2, :-(( )  Of course, I don't have extensive
knowledge about the many possible cases one could imagine, but I am curious
as to what type of discrtionary postings you would need, for which the
decision could not be made during Pass 1, (or whether currently defined
behavior would cover a majority of those cases already).

Interested, but seriously wary... Not wanting to wake a sleeping monster
(called Musixflx).

Joel Hunsberger
[EMAIL PROTECTED]

-----Original Message-----
From: Mogens Lemvig Hansen <[EMAIL PROTECTED]>
To: MuTeX mailing list <[EMAIL PROTECTED]>
Date: Wednesday, December 01, 1999 7:34 PM
Subject: mudiscretionary


>I have a Musixtex feature request:  I would like to have a Musixtex
>equivalent of TeX's \discretionary command.  That is, a line break is
>possible at
>   \mudiscretionary{<pre-break>}{<post-break>}{<no break>}
>If no line break does actually occur, then <no break> is typeset;  if a
>line break does occur, then <pre-break> is typeset before the line break
>and <post-break> is typeset after.
>
>For example, you could then type
>   \mudiscretionary{\rightrepeat}{\leftrepeat}{\leftrightrepeat}
>It would also be possible to automatically post a signature change twice
>if it happens at a line break.
>
>Any implementation of \mudiscretionary unfortunately requires a
>modification of musixflx:  In the first pass, \mudiscretionary must
>record the widths of each of its three arguments in the .mx1 file.  Then
>musixflx must use this information to decide on line breaks.  In the
>second pass, \mudiscretionary must simply do as told by the .mx2 file.
>
>In implementing \mudiscretionary, one would also have to decide what
>exactly should be the meaning of "before" and "after" the line break.
>
>Regards,
>Mogens Lemvig Hansen
>http://users.uniserve.com/~mlhansen
>

Reply via email to