I'm working on coding shifted accidentals. I would like to hear
preferences of other users on the following matters:
1. Are vertical shifts needed as well as horizontal? I believe if I
do put in vertical shifts, they will have to be in integral multiples
of \internote .
Never do a half job.
2. If I do put in vertical shifts, should they come before the
horizontal shift? (e.g cs+1-.5 would shift up one \internote and left
by half a notehead width).
As of now, I'm leaning toward vertical first, then horizontal, and
requiring both always to be entered even if one is zero. I think
this would avoid backward incompatibilities with existing octave and
duration syntax. (Anyone disagree?) And the order is consistent with
existing syntax for slurs and dots.
So cs+2+1-0 would be a half-note c-sharp, one octave higher than the
default, with the accidental moved up one \internote, in the default
horizontal position? While cs+1-0 would be a c-sharp the same length
as the previous note, at the default position and with the accidental
moved as described above? The syntax seems slightly awkward and (more
to the point) confusing to read. I'd suggest adding a letter before
the accidental shift, e.g. cs+2m+1-0 or csm+1-0, respectively. ("m"
for "move") This would also avoid ambiguity if you decide to not
allow vertical shifts.
Alternatively, you could use different indicators for horizontal
vs. vertical movement. cs+2v1 or csv1 or csh.5. m, h, and v are all
available if I read the PMX reference table correctly. The
disadvantage of this is that it requires an extra letter before the
accidental shift (as compared with Don's proposal). The advantage is
that the composer can specify only one shift if so desired, and the
shifts can be in whichever order the composer prefers. (Also easier
to read -- you don't have to remember which order they come in.)(*)
If I do not allow vertical shifts, or allow them but don't require
both shifts to be entered (in either order), the syntax would not be
compatible, e.g. cs+1 now means something else.
3. Should shifts be cumulative? In other words, if a notehead has
been explicitly shifted (cse or csr), now the accidental is
automatically shifted left or right (I've fixed the error with
left-shifted chordal notes). Should explicitly specified accidental
shifts be relative to the already shifted position? In other
situaltions of shifts I have not been consistent on this.
Not sure. I haven't had occasion to need this feature yet.
4. What are the maximum vertical shifts (in \internote) or horizontal
shifts (in notehead widths) that will ever be needed?
Assume as large an amount as MusiXTeX can handle. Programming axiom:
the number 2 is inherently ridiculous.
5. Will there ever be a need for a positive horizontal shift (i.e.,
to the right?).
See comment on #4. Don't do a half-assed job.
6. I intend to use \loffset for this. Due to the way it is definied
in MusiXTeX, it cannot be nested with other copies of itself. So
these shifts will cause problems if someone tries to use them inside
another shift, e.g. X2.5S c44s+0-2.3 . I could possibly get around
this using \off{-...}\...\off{...} but that would make the TeX output
messier. Is it worth it? If I did it that way, I would need to give
the argument of \off in some length unit. Points? (Strangely, there
is no externally accessible length variable defined in MusiXTeX that
is the width of a notehead).
In about my 5th year of programming I tried making the assumption that
"no one would ever need to do that." I had to fix the program about 2
months later. If the syntax makes it possible, you should be able to
handle it.
(*) For those who think M-Tx and PMX are for people to write and only
software to read, I just found an appropriate quote in a magazine
article I'm reading: "The task, says Knuth, is not to describe to the
computer what to do, but to explain to another human being what we
want the computer to do." [Work: Cathedrals, Bazaars, and News
Readers, by Jeffreys Copeland and Haemer, SunExpert, July 1998,
Vol. 9, No. 7, p. 57.]
--
Approved by mutex-owner