Hello again,
In my last mail which I wrote:
- In Line 17 and 18 of the following file you find "%%%Ar" and "%%%K-1+2".
- So if you take off one of the %-characters, MusiXTeX should transpose the
- whole Arioso to D-major.
I apologize for not having read the manual (page 36 in version 75) properly.
Because of this I thought that giving "\relativeaccid" MusiXTeX would be able
to interpret the 'original' accidentals as 'relative' ones and change them
according to their relative meaning and the intended transposition.
In the lenghthy discussion of my last mail the longest part was about how
MusiXTeX could do this conversion on its own because I was not aware of the
fact that in fact it is the user's job to do this conversion.
(MusiXTeX does the *RE*conversion within the transposed signature.)
(Truely the relative coding has a history:
The natural sign does not appear in many old manuscripts and prints and
would have been replaced by sharps resp. flats depending on its effect.
See the Song 'Music for while' by H.Purcell which I recently posted.)
The smaller part of my discussion though gave an alternative approach
to do the whole transposition matter which I still think is worth considering:
It is absolutely safe, concise and does not require the distinction between
a relative and an absolute input: It handles the absolute one
and could be coded in an elegant way (see 2 arrows "------>" towards the end
of this mail).
Therefore I would like to expose it once more in a concise way
so (hopefully) you are not repelled by the lenghth of the
surrounding comments:
The method (algorithm) is based on the interpretaion of transposition
======================= as a rotatation of the *spiral* of fifths
which only by enharmonic identification becomes
the well known circle of fifths.
Let us attach an integer number to each note endowed with any accidental
in the following manner: (I use MusiXTeX's way of coding the accidentals)
Endow all the notes f, c, g, d, a, e, b with the possible accidentals
(we restrict ourselves of course to the ones in common use) and receive
the following 'chain'.
note: ... <b _f _c _g _d _a _e _b f c g d a e b ^f ^c ^g ^d ^a ^e
^b >f ...
integer attached:
int(note) = ... -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11
12 13 ...
[Actually we are viewing a bijection 'int'
but practically we will need only a restriction of 'int' to
the subset consisting of the notes in use.
'In use' would mean: Everything which MusiXTeX is capable of.
So since MusiXTeX knows the five accidentals
\dfl, \fl, \na, \sh and \dsh
we would have a subset 7 x 5 = 35 possible notes,
ranging from int(<f)=-15 to int(>b)=19.
In the following we establish the 'transposition operator'
on the complete set of all notes and give its formula
using the bijection 'int'.]
To transpose correctly we only need to know the DIFFERENCE of the
*old* and the *new* current signatures which in fact equals the
DIFFERENCE of the old and new *general*signatures:
diff := newCurrSign - oldCurrSign = newGenSign - oldGenSign.
To do the transposing you only have to add this integer number called "diff"
to the integers above, each one representing a note of the whole
chromatical spectrum.
The result gives you the note needed for the transposed version.
So put *its* accidental!
In my Example posted with my last mail
(Tranposition E flat major ---> D major) we would have:
diff = 2 - (-3) = 5.
So the E natural (voice #1, Violone, bar 3) would be
transposed to a D sharp:
int(e nat) = 4 ---> 4 + 5 = 9 = int(^d)
So let MusiXTeX put the accidental of a D sharp which is a sharp sign!
The E flat (same voice, bar 4) would run along the same line:
int(e fl) = -3 ---> -3 + 5 = 2 = int(d)
So let MusiXTeX put the accidental of a D which is a natural sign!
(I could have written `=d� instead of merely `d� in the chain above.)
The accidentals belonging to any note can be computed by calculating
modulo 7, using more or less Euklids Division Algorithm.....
suggested commands:
===================
So I would suggest the following commands to code transpositions:
\generalsignature{-3} %as usual, referring to the original signature.
\shiftsignature{5} %giving the integer, which I called
% "diff := newgeneralsignature minus
% oldgeneralsignature"
%Its default should be 0.
%If MusiXTeX discovers its value not to be zero,
%MusiXTeX needs to learn the value the function 'int'.
\transpose=-1 %as usual (shift the noteheads to the right place,
%in this case 1 \internote down.
%Could as well be \transpose=6, if the
%piece should be transposed a seventh upwards.
Actually I would ask MusixTeX to offer a check if the dates fit together.
The number passed to \transpose has to fulfill a certain condition given
by the number given to \shiftsignature: This condition reads
\transpose congruent 4 * \shiftsignature modulo 7
In our case:
-1 congruent 4 * 5 = 20 modulo 7
which is in fact true.
"\transpose=6" would satisfy this condition just as well.
But \transpose=4 would not, and the user should be warned.
Further simplifications:
========================
I would even suggest that MusiXTeX computes a default value
for \transpose in order not to shift the piece more than a fourth,
unless it is explicitly wanted.
The calculation of this default value is
based on the given value for \shiftsignature:
Let \transpose be the rest if you divide 4*\shiftsignature by 7
following the Euclidean Division Algorithm.
So it is a number between 0 and 6.
If it is greater than 3 (so 4, 5 or 6), subtract 7.
Then its absolute value is less or equal to 3.
This would mean what we have been aiming for: Shift the piece
at maximum a fourth up or down.
Finally I would suggest a shorter possibility to pass the value
for \shiftsignature: Let \generalsignature have an optional argument,
the default of which is 0. If it is not zero, MusiXTeX automatically
enables \relativeaccid.
So the commands quoted above could be shortened to
------> \generalsignature[5]{-3}
You could also think about a second optional argument
telling MusiXTeX to shift the piece [d]ownwards or [up]wards.
[d] would mean to force \transpose to be negative (subtract 7 in any case).
(so \transpose < 0 )
[u] would mean the opposite (never subtact 7). (so \transpose > 0)
Then you could code
------> \generalsignature[5][u]{-3}
to shift the piece a seventh up, transposing from E flat major to D major.
This would be my dream about a transposition capacity of MusiXTeX.
## Eckart