Instructions for running mskpage.z
        ------------------------------------------

mskpage.z is the program that combines several non-page specific
i-files into a set of page specific i-files.  Although mskpage.z
is smaller than autoset.z and its task is less complicated, we
have had many more difficulties getting mskpage.z to run properly,
The program today still leaves much to be desired in terms of
reliability, reporting of errors, and quality of output.

To run mskpage.z, the current working directory for your window
should be one of the sub-directories inside outputs, as determined
by the application you are working on.  If you are typesetting
a score for printing in notesize 16, your current working
directory would be outputs/skore16, inside of which there would
be the three sub-directories, i-files, formats, and pages.
Whatever sub-directories there are in i-files should also be
in pages.

When mskpage.z first starts up, it asks four questions:

(1) Input library name.  An example would be i-files/04 --
fourth movement of the work you are typesetting.

(2) Output library name.  An example would be pages/04

(3) Starting number

(4) Number of parts

Notice that mskpage.z can only typeset a set of parts in sequence;
there is no provision for combining, for example, parts 2, 3 and 6.
In most cases, you will either want to combine all of the parts (as
in a score) or typeset only one part (as in separate parts).  But
there are times when you may want to typeset a subset of parts.
Here are three examples:

  (1) When typesetting a full score.  If the mskpage.z fails for
  for some reason, the cause is almost certainly a mistake
  in one of your stage2 files.  This would be a logical mistake,
  not a mistake in format, so it wouldn't necessarily trip up
  the autoset.z program.  What I do in this case is try running
  mskpage.z on just parts 1 and 2, then on parts 2 and 3, then
  parts 3 and 4, and so on, until mskpage.z fails.  This is a
  good method for determining which stage2 file is causing the
  trouble.

  (2) When typesetting a part that splits.  In the second
  movement of Beethoven's 7th symphony, the Cellos are
  divided, with each section having its only staff line.
  The cello part, in this case, must be typeset as a score
  with three lines, Cello I, Cello II, and Cellos combined.
  Proper settings of the type-y general print suggestions
  in the stage2 files for these parts will insure that
  either Cello I and Cello II are printed, or that Cellos
  is printed, and that no other combination is printed.
  (See the s2-specs.ten file in j:/release/progs for further
  documentation on the format of stage2 files).

  (3) When constructing a combined part for a score from
  separate parts.  An example would be constructing a part
  for Oboes (1 and 2), from Oboe 1 and Oboe 2.  I find it
  handy to make a small score consisting of all three parts
  This way I can compare on a measure by measure basis the
  new part with the two sources and see immediately any
  discrepencies or omissions in the new part.

After these first four questions, mskpage.z makes a choice.  If
the starting number is 1 and if the number of parts equals the
number of source files in i-files and if there is a valid format
file for this movement, then mskpage.z asks no more questions and
runs automatically 'till it is done.

If the starting number is 1 and if the number of parts equals
the number of source files in i-files and there is NOT a valid
format file, then mskpage.z will ask you if you would like to
create one.  The format file essentially contains the answers
to the questions that follow, and this is what allows mskpage.z
to run automatically next time.  The "remembered" answers are
important also because they enable you to specify a format that
will be repeated each time mskpage.z is run on these files.

If the starting number is not 1, or if the number of parts does
not equal the number of source files in i-files, then no format
file can be created.

One more word about format files.  Format files can only be
created for full scores.  Fine.  But what about typesetting
parts.  We still have the problem of "remembering" the format
so that a part will be typeset the same way each time.  I
solve this problem in the following way:

  Format files take their names from the movement file names.  If
  the movement names are 01, 02, 03, and 04, then these are the
  names of the format files for these movements.  Any other file
  names in the sub-directory formats are ignored by mskpage.z.
  When typesetting parts, I allocate a set of sub-directories
  inside formats, one for each part, e.g., cb, cl_1, cl_2, etc.
  Inside each of these I store the working screen for mskpage.z
  for each of the movements.  The working screen will contain all
  of mskpage.z's question and also my anwsers as given the first
  time around.  If I need to run mskpage.z again for a particular
  part and movement, I simply load the stored screen and start
  pressing <enter>.

Now back to mskpage.z's questions.

(5) The simple test question.  Sometimes (see above), you may want
to run mskpage.z as a test, without actually generating output.
The answer to this quesion is not stored in the format file.

(6) Height of new typesetting (return = top).  This allows us to
being a new movement anywhere on the page.  This is very handy if
a previous movement leaves sufficient empty space on a page for a
new movement to begin.

(7) Line of tacit instructions? (return = none).  Actually text line
can go here.  Sometimes I like to put the movement number (in Roman
numerals) on this line.

(8) Right justify last line? (return = no)  Also, enter "wide"
command here.  This line actually asks two questions: (a) do you
want to justify the last line? and (b) would you like to change
the default left and right margins?  The only reason you might
type (return = no) is that you are running a test.  If you type
the word "wide" followed by two numbers (separated by spaces),
the numbers are interpreted as modifications to the left and
right margins.  Default right and left margins are about 240 dots
(.80 inch).  It is possible to spread these margins by up to 100
dots.  Positive numbers will spread the margins; negative numbers
will move them in.

(9) Movement title?  This is actually like question 7 above.
You can enter any line of text here you want.  One difference,
however, is that the text line entered at question 7 will
automatically be centered on the page.  If you want the text
entered at this question to be centered, you must begin the
line with the three character code, "(c)".

(10) Enter brace/bracket/bar structure.   This is a control string
that tells mskpage.z how to draw the left spine of the score and
where to start and stop bar lines (vertically).  [] = bracket and
bar; () = bar only: {} = brace; dot = part; colon = grandstaff.
The number of dots+colons must equal the number of parts, and
brackets, parentheses and braces must be balanced right and left.
Otherwise mskpage.z gets indigestion.

Shown below is the format file for typesetting the 1st movement of
Beethoven's 1st symphony:

001 Reduced size = no
002 Use default height for new typesetting
003 Beethoven Symphony No. 1 in C Major,  Op. 21
004 Justify = yes   wide 60 100
005 (c)I.
006 [(....)][(..)](.)[({..}..)]
007 192 192 192 208 192 192 208 176 176 176 200

The first line "Reduced size = no" is a vestage from the past
and is no longer relevant.  Lines 2 through 6 contain the
answers to questions (6) through (10).   Line 7 contains the
answer to question (11) below.

(11) Line spacing: text, no text  (return = no change)
     Otherwise, enter all spacings (max of 15 per line)
     200 160

This shows the default line spacing that mskpage.z will use in
typesetting the music.  The first number is for lines with text
underly; the second line is for lines without text.  For purposes
of testing and proofing, the defaults are fine; but for real
typesetting, you will want to put in your own values.  If you
do this, you must put in a number for each part.  The last number
is for system spacing.  Important point: the actual spacing is
not as important as the relative spacing.  The vspace.z program
will re-space the lines, but in a proportional way.  So if you
want more space separating the woodwinds from the brass, as is
done with the Beethoven above, it is a good idea to get the
proportions right at this stage in the process.  A good looking
score will have the same spacings across an entire movement,
so that the eye is not confused as it shifts from page to page.

After completing these questions, mskpage.z takes off and does
it's work.  The process of "casting off" done by mskpage.z is an
iterative process.  If mskpage.z reaches a measure line which
calls for a system break, and this measure line is in the middle
of the page, mskpage.z will look for a (last) measure on some
previous line to move down and will try a new "cast off."  It
sometimes can take mskpage.z 20 iterations or more for it to get
a "casting off" that it likes.  Still, you or I might not like
what mskpage.z has done, which is why we need to run dskpage.z on
the result.  If we see something we don't like, we must go back
to the stage2 files and make some changes.  It might be changing
the global spacing; it might be adding a new system break; it
might be changing the spacing in one section of a stage2 file.
Then we must run autoset.z again; and then run mskpage.z again.

The problem of "casting off" is actually quite complicated.  There
are so many variables.  I am not entirely happy with the way things
work now, but I'm not sure how to go about making things better.
The system as it now works is based on trial and error.  You never
know if there is a solution out there that you haven't seen but
would be much better.  I wonder sometimes whether this problem
would lend itself to a linear programming solution.  The objective
function would depend on such things as ideal spacing, equality of
measure size, avoidance of broken ties, slurs, etc., etc.  One
thing I have noticed: when there is lots of space between notes, it
is much easier to get things looking uniform across lines and among
lines on a page.  However, in my opinion, extra space is a sign of
low quality typesetting.  Compact musical typesetting is not only
more economical, it is more readable.  A musician needs merely to
glance at a set of musical notes in order to know exactly what he
or she is to play.  Music that is spread out requires more glances.