\input musicnft
\input musicvbm
\input musictex
\input musicsty
\input musictrp
\input dblecols
\def\footnotehsize{\hsize\Pagewidth}
\topskip 0pt\splittopskip 0pt%
%  OUTPUT
%
\def\gwidth@hpl{24pt}
%\check
\newdimen\Pagewidth
\newdimen\Pageheight
\Pagewidth=170mm
\hsize=\Pagewidth
\Pageheight=262mm
\vsize=\Pageheight
%
\linepenalty=100
\hyphenpenalty=500
%
%\divide\topskip by 2\relax
%\topskip=0pt\relax
%
\def\outputlaserjet{\shipout\hbox to 190mm{\hss\vbox to 270mm{\vfil
\vbox to \Pageheight{\boxmaxdepth=\maxdepth\pagecontents\vfil}%
\vfil\vskip 2mm
\hbox to \Pagewidth{\hfil \tenpoint -- \number\count0\ --\hfil}}\hss}%
\global\advance\count0 by 1
 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}%
%
\parindent 8mm
\output={\outputlaserjet}%
%
%
\def\text#1{\hbox{\rm #1}}%
%\check
%
\def\eightpoint{\Eightpoint}
\font\sixi=cmmi6%
\font\sixrm=cmr6%
\font\sixbf=cmbx6%
\font\sixsy=cmsy6%
\def\Eightpoint{\normalbaselineskip=10pt
 \def\rm{\fam0\eightrm}%
 \def\it{\fam\itfam\eightit}%
 \def\sl{\fam\slfam\eightsl}%
 \def\bf{\fam\bffam\eightbf}%
 \def\mit{\fam 1}%
 \def\cal{\fam 2}%
 \textfont0=\eightrm   \scriptfont0=\sixrm   \scriptscriptfont0=\sixrm
 \textfont1=\eighti    \scriptfont1=\sixi    \scriptscriptfont1=\sixi
 \textfont2=\eightsy   \scriptfont2=\sixsy   \scriptscriptfont2=\sixsy
 \textfont3=\tenex   \scriptfont3=\tenex     \scriptscriptfont3=\tenex
 \textfont\itfam=\tenit
 \textfont\slfam=\eightsl
 \textfont\bffam=\eightbf \scriptfont\bffam=\eightbf
   \scriptscriptfont\bffam=\sixbf
\setbox\strutbox=\hbox{\vrule height 7pt depth 3pt width 0pt}%
\normalbaselines\rm}
%
\def\ital#1{{\sl #1\/}}%
\def\no{N$^\circ$~}
\def\mutex{M\raise 2pt\hbox{\kern -1pt u\kern -1pt}\TeX}
\catcode`\&=13
\catcode`\|=13
\def\\{{\tt\char'134}}%
\def\|{{\tt\char'174}}%
\def\#{{\tt\char'043}}%
\def\{{{\char'173}}%
\def\}{{\char'175}}%
\def\@{{\char'100}}%
\def\musictex{Music\TeX}%
%
\centerline{\enorme \musictex}\medskip
\centerline{\moyen Using \TeX\ to write polyphonic or instrumental music}
\smallskip\centerline{\sl Version 4.4 -- \today}\smallskip
\centerline{\sl Daniel TAUPIN}
\centerline{\sl Laboratoire de Physique des Solides}
\centerline{\sl (associ\'e au C.N.R.S.)}
\centerline{\sl b\^atiment 510, Centre Universitaire, F-91405 ORSAY Cedex}
\medskip
%
\newdimen\heightbeforesection
%
\def\section#1{\removelastskip\par
   \heightbeforesection=\pagetotal
   \ifvoid\footins\relax\else
   \advance\heightbeforesection by \ht\footins
   \advance\heightbeforesection by \skip\footins
   \advance\heightbeforesection by \baselineskip
 \fi 
 \ifvoid\topins\relax\else
   \advance\heightbeforesection by \ht\topins
   \advance\heightbeforesection by \skip\topins
   \advance\heightbeforesection by \baselineskip
 \fi
   \advance\heightbeforesection by 4\baselineskip
%   \message{Section: #1, p.\the\count0, Vsize=\the\vsize,
%      before=\the\heightbeforesection, Pagegoal=\the\pagegoal}\relax
   \ifdim\heightbeforesection>\vsize\eject\else\medskip\penalty -1000\fi
   \noindent{\moyen #1}\medskip\penalty 4000\rm}
%   
\def\subsect#1{\removelastskip\medskip\penalty -300\noindent{\bf #1}\smallskip
\penalty 4000\rm}
%
\savepenalties
\begindoublecolumns
\musictex\ is a set of \TeX\ macros to typeset polyphonic, orchestral
or polyphonic music.
\medskip
Two sizes are available~: 16pt and 20pt (standard) staff heights.
For that purpose, it uses special fonts~: \hskip 2pt\hbox{\tt  musicn16},
  \hbox{\tt  slurn16}, \hbox{\tt  beamn16} and \hskip 2pt\hbox{\tt  musicn20},
  \hbox{\tt  slurn20}, \hbox{\tt  beamn20} respectively. \medskip It is to be emphasized
that \musictex\ is not intended to be a compiler which would translate into
\TeX\ some standard musical notations, nor to decide by itself about
aesthetic problems in music typing. \musictex\ only typesets staves, notes,
chords, beams, slurs and ornaments as requested by the composer. Since it
makes very few typesetting decisions, \musictex\ appears to be a versatile
and rather powerful tool. However, due to the important amount of
informations to be provided to the typesetting process, coding \musictex\
might appear to be awfully complicated, just as the real keyboard or
orchestral music.  It should be interfaced therefore by some pre-compiler
in the case of the composer/typesetter wanting aesthetic decisions to be
automatically made by somebody (or something) else.
 \enddoublecolumns
\section{Music typesetting is two-dimensional}
 \begindoublecolumns Most of the people who just learnt a bit of music at
college probably think that music is a linear sequence of symbols, just as
litterary texts to be \TeX-ed. In fact, with the exception of strictly
monodic instruments like most orchestral wind instruments, one should be
aware that reading music actually is a matricial operation~: the musician
successively reads \ital{columns} of simultaneous notes.  This is the reason
why, in {\bf \musictex} the  fundamental \ital{macro}  is of the form
 %
$$\text{\tt \\notes \dots\ \& \dots\ \& \dots\ \\enotes}$$
 %
 where the character {\tt\&} is used to separate the notes to be typeset on
respective staffs of the various instruments, starting from the bottom.
 \medskip\penalty -600
In the case of an instrument whose score has to be written with
several staffs, these staffs are separated by the
character \|. Thus, a score written for a keyboard instrument and
a monodic instrument (for example piano and violin)
will be coded as follows
$$\text{\tt \\notes \dots\ \| \dots\ \& \dots\ \\enotes}$$
for each column of simultaneous notes.
\enddoublecolumns
%
\section{The spacing of the notes}
\begindoublecolumns
It seems that many books have dealt with this problem.
Although it can lead to interesting algorithms, we think it is
a rather minor one.
 \medskip In fact, each column of notes has not necessarily the same spacing
and, in principle, this spacing should depend on the shortest duration of the
simultaneous notes. But this cannot be established as a rule, for at least
two reasons~:
 \item{1)} spacing does not depend only of the local notes,
but also on the context, at least in the same bar.
\item{2)} in the case of polyphonic music, exceptions can easily be found.
Here is an example~: 


{\computewidths
\def\nbinstruments{1}\relax
\generalmeter{\meterfrac{4}{4}}\relax
\debutextrait
\normal\elemskip=0.115\hsize
\temps\Notes\rlap{\hu j}\ql h\enotes
\temps\Notes\hl g\enotes
\temps\Notes\hu k\enotes
\temps\Notes\ql f\enotes
\finextrait}\restorepenalties
%\check

\noindent where it can be clearly seen that the half notes at beats 2 and 3
must be spaced as if they were quarter notes, since they overlap, which is
obvious only because of the presence of the indication of the meter 4/4.
%
 \medskip Therefore, we prefered to provide the composer/typesetter with a
set of macros, the spacing of which increases by a factor of $\sqrt 2$
(incidentally, this can be adjusted)~:
\enddoublecolumns\leftrule
\centerline{\tt \\notes \dots\ \& \dots\ \& \dots\ \\enotes\ \ \%
\hbox to 2.5cm{\rm 1 spatial unit\hss}}
\par\centerline{\tt \\Notes \dots\ \& \dots\ \& \dots\ \\enotes\ \ \%
\hbox to 2.5cm{\rm 1.4 spacial unit\hss}}
\par\centerline{\tt \\NOtes \dots\ \& \dots\ \& \dots\ \\enotes\ \ \%
\hbox to 2.5cm{\rm 2 spatial units\hss}}
\par\centerline{\tt \\NOTes \dots\ \& \dots\ \& \dots\ \\enotes\ \ \%
\hbox to 2.5cm{\rm 2.8 spatial units\hss}}
\par\penalty -2000
\centerline{\tt \\NOTEs \dots\ \& \dots\ \& \dots\ \\enotes\ \ \%
\hbox to 2.5cm{\rm 4 spatial units\hss}}
\par\centerline{\tt \\NOTES \dots\ \& \dots\ \& \dots\ \\enotes\ \ \%
\hbox to 2.5cm{\rm 5.6 spatial units\hss}}
\rightrule
 %\showthe\pagegoal\showthe\pagetotal\showthe\vsize
\begindoublecolumns
%\check
The size of the spatial unit ({\tt\\elemskip}) can be freely adjusted. In addition,
\musictex\ provides a means of adjusting the note spacing according to
an average number of elementary spaces within a line (macro \hbox{\tt \\autolines}).
\enddoublecolumns
\section{Music tokens, rather than a readymade generator}
%\check
\begindoublecolumns
The tokens provided by \musictex\  are~:
\item{--} the note symbols \ital{without stem}~;
\item{--} the note symbols \ital{with stems, and hooks for eighth notes and
beyond}~;
\item{--} the indications of beam beginnings and beam ends~;
\item{--} the indications of beginnings and ends of ties and slurs~;
\item{--} the indications of accidentals~;
\item{--} the ornaments~: arpeggios, trills, mordents, pinc\'es, turns, staccatos
and pizzicatos, fermatas~;
\item{--} the bars, the meter and signature changes, etc.
 \medskip Thus, {\tt\\wh g} produces an \ital{A  (445~Hz)} whose duration is
a \ital{whole note}. In the same way, {\tt\\qu~c} produces a \ital{C (250~Hz
approx.)} whose value is a \ital{quarter note with stem up}, \hbox{\tt \\cl J}
produces a \ital{C (125~Hz approx.)} whose duration is an \ital{eighth note
with stem down}, etc.
 \medskip To generate quarter, eighth, sixteenth, etc. chords, the macro
{\tt\\zq} can be used~: it produces a quarter note head whose position is
memorized and recalled when another stemmed note (possibly with a hook) is
coded~; then the stem is adjusted to link all simultaneous notes. Thus, the
perfect C-major chord, i.e.

%\check
{\def\nbinstruments{1}\relax
\cleftoksi={{0}{0}{0}{0}}\generalmeter{}\relax
\debutextrait
\normal
\NOTes\zq c\zq e\zq g\qu j\enotes
\finextrait}\restorepenalties


%\check
\noindent is coded
 \hbox{\tt\\zq~c\\zq~e\\zq~g\\qu~j}
or, in a more concise way, \hbox{\tt\\zq\{ceg\}\\qu~j} (stem up)~:
in fact, single notes are treated\dots\ like one-note chords.
\medskip
\ital{Beams} are generated using  macros which definise
their beginning (at the current horizontal position), together with
their altitude, their sense (upper of lower), their multiplicity,
their slope and their reference number.
This latter feature -- the reference number -- appears to be necessary,
since one may want to write beams whose horizontal extents overlap~:
therefore, it is necessary to specify which beam the notes hang on
and which beam is terminated at a given position.
%\check
 \medskip Besides, a general macro (\hbox{\tt \\zcharnote}) provides a means of
putting any sequence of symbols (in fact, some \hbox{\tt \\hbox\{...\}}) at any
pitch of any staff of any instrument. Thus, any symbol defined in a font
(letters, math symbols, etc.) can be used to typeset music.
 \medskip Before entering details, we give below an example of the two first
bars of the  sonata in C-major by Mozart (Mozart, K545)~:
\enddoublecolumns
\leftrule

\def\nbinstruments{1}\relax
\def\instrumenti{Piano}%
\nbporteesi=2\relax
\generalmeter{\meterfrac{4}{4}}\relax
\debutextrait
\normal
\temps\Notes\ibu0f0\qh0{cge}\tbu0\qh0g|\hl j\enotes
\temps\Notes\ibu0f0\qh0{cge}\tbu0\qh0g|\ql l\sk\ql n\enotes
\barre
\Notes\ibu0f0\qh0{dgf}|\qlp i\enotes
\notes\tbu0\qh0g|\ibbl1j3\qb1j\tbl1\qb1k\enotes
\temps\Notes\ibu0f0\qh0{cge}\tbu0\qh0g|\hl j\enotes
\finextrait
\restorepenalties
%\check
\par The \ital{coding} is set as follows~:
\medskip
\def\rmcom{\ \ \ \% \rm}
{\tt\\def\\nbinstruments\{1\}\\relax\rmcom a single instrument
\par\tt\\nbporteesi=2\\relax\ \ \ \ \ \ \ \ \rmcom  with two staffs
\par\tt\\generalmeter\{\\meterfrac\{4\}\{4\}\}\\relax\rmcom meter is 4/4
\par\tt\\debutmorceau\ \ \ \ \rmcom initiates staffs, clefs, indication
of the meter.
\par\tt\\normal \ \ \ \ \ \ \ \ \ \rmcom normal spacing (14pt for {\tt\\Notes})
\par\tt\\temps\\Notes\\ibu0f0\\qh0\{cge\}\\tbu0\\qh0g\|\\hl j\\enotes
\par\tt\rmcom\tt\\ibu0f0 \rm begins an upper beam, aligned on the
\ital{f}, reference number 0, slope 0.
\par\tt\rmcom\tt\\tbu0 \rm terminates this beam before writing
the second \ital{g}
by means of \tt\\qh0g,
\par\rmcom where \tt\\qh..\rm indicates a  note hanging on a beam.
\par\tt\\temps\\Notes\\ibu0f0\\qh0\{cge\}\\tbu0\\qh0g\|\\ql l\\sk\\ql n\\enotes
\par\tt\rmcom\tt\\sk \ \rm sets a space between the two quarters at the right
hand, so that
\par\tt\rmcom the second is aligned with the third eighth of the left hand.
\par\tt\\barre \rmcom bar.
\par\tt\\Notes\\ibu0f0\\qh0\{dgf\}\|\\qlp i\\enotes \rmcom \tt\\qlp\ \rm =
 quarter with a point.
\par\tt\\notes\\tbu0\\qh0g\|\\ibbl1j3\\qb1j\\tbl1\\qb1k\\enotes
\par\tt\rmcom\tt\\ibbl1j3\ \rm begins
 a double beam, aligned on the \ital{C} (coded {\tt j} at this pitch)
with slope 0.15.
\par\tt\\temps\\Notes\\ibu0f0\\qh0\{cge\}\\tbu0\\qh0g\|\\hl j\\enotes
\par\tt\\suspmorceau \rmcom closing with a simple bar
(for short excerpts).}
\section{Other highlights}
\begindoublecolumns
\musictex\ is intended to handle up to six instruments, each of which may
be typeset on zero to four staffs (zero staff is used to record the text of
vocal parts).\medskip
Signatures are stated either for all instruments, such as~:
\hbox{\tt \\generalsignature=-2} which sets two flats on each staff, but this
can be partly overrided by \hbox{\tt \\signatureii=1} which puts one sharp
on the staffs of instrument number 2 (ii). Of course, signature may change
at any time as well as meters and clefs.
 \medskip
 Besides, two frequently posed questions deserve an answer. The first one
is~: \ital{``can \musictex\ transpose a score~?''}. The answer is now 99.5~\%
\ital{yes}. If fact, there is an internal register named \hbox{\tt \\transpose} the
default value of which is zero, but it may be set to any positive of negative
reasonable value. Then, it offsets all symbols pitched with letter symbols by
that number of pitch steps. However, it will not change the signature, and if
-- for example -- you transpose by 1 pitch a piece written in $C$, it will
not know whether you yant it in $D\flat$, in $D$ or in $D\sharp$. This might
become tricky if accidentals occur within the piece, which might have to be
converted into flats, naturals, sharps or double sharps, depending on the new
choosen signature. To circumvent this trouble, \ital{relative} accidentals
have been implemented, the actual output of which depends of the pitch of
this accidental and of the current signature.
 \medskip
 The second question is~: \ital{``can I write an orchestral score and extract
the separate scores for individual instruments~?''} The answer is 95~\%
\ital{yes}~: in fact, you can define your own macros \hbox{\tt \\mynotes...\\enotes},
\hbox{\tt \\myNotes...\\enotes} with as many arguments as there are in the orchestral
score (hope this is less or equal to 9, but \TeX perts know how to work around)
and change its definition depending on the selected instrument (or insert
a test on the value of some selection register). But the limitation is that
the numbering of instruments may change, so that \hbox{\tt \\signatureiii} may
have to become \hbox{\tt \\signaturei} if instrument $iii$ is alone. But this is not
a serious problem for average \TeX\ wizard apprentices.
 \enddoublecolumns
\section{How to get it}
 \begindoublecolumns The whole distribution fits into a single 1.2Mbyte or
1.44Mbyte diskette. It can also be obtained through an \ital{anonymous ftp}
at \hbox{\tt  rsovax.ups.circe.fr} (130.84.128.100), after selecting the
subdirectory \hbox{\tt [.musictex]}. All sources (including fonts) are provided,
either separately, or ``zipped'' or as VMS `savesets''.
 \enddoublecolumns
\section{Implementation and restrictions}
\begindoublecolumns
The macroinstruction file \musictex\ contains approximately 2500 lines of
code, that is 80~000 bytes approximately. This requires your score to be
compiled by the most extended versions of \TeX\ (65~000 words of working
memory).  In desperate situations, we
recommend using the ``big\TeX'' processors which, unfortunately, perform
a great deal of disk input/outputs (on PCs) which make them awfully slow.
\medskip
In particular, the number of registers it uses makes it doubtfully
compatible with La\TeX.
\medskip Ties and slurs have been implemented in a way which may
look rather ugly, but we think it is the only way of implementing
\ital{in one pass} ties and slurs which run \ital{across glue}. The principle
is to have tie/slur symbols with a rather long part of horizontal stuff.
Then, at each time a glue occurs and at each time a group of notes is coded
while a slur or tie is pending, an \hbox{\tt \\hrule} is issued which overlaps
the preceeding tie/slur symbol so that the final output seems to contain
a continuous line. Unfortunately, this is possible only in the glue expansion
direction, namely in the horizontal direction.
\enddoublecolumns
\section{Acknowledgements}
\begindoublecolumns
The idea of implementing the present package is due to the previous work
(Mu\TeX) of Andrea Steinbach and Angelika Schofer\footnote{$\ddag$}{Steinbach
A. \& Schofer A., \ital{Theses} (1987, 1988),
 Rheinische Friedrich-Wilhelms Universit\"at, Bonn, Germany.}. This work
provided the basis of the Metafont codes and some line breaking procedures,
which both are still used here... with 99\% corrections and updates.
\enddoublecolumns
\section{Examples}
\begindoublecolumns
Three examples are displayed in the following pages, namely a transcription
for organ and song of the beginning of the
 \ital{Aria} of \ital{The Creation} by Joseph Haydn, a \ital{motet} for
Christmas by Praetorius -- in the original pitch and transposed down by
one pitch in smaller size -- and a transcription of a concerto for oboe by
Benedetto Marcello.
\enddoublecolumns\vfill\eject
%
\vbox to \vsize{\vss
\hbox to \hsize{\hss
\computewidths
\vbox{%
\input creation
}%
\hss}\vss}
\vfill\eject
%
\vsize=26.5cm
\hsize=18.5cm
\parindent 15mm
\advance\bottommargin by 2\Interligne
%
\def\Transpose{0}%
\def\Signature{3}\relax % trois diezes a la clef
\input praetorx
\eject
\musicsize=16\computespecifics
\def\Transpose{-2}\relax
\def\Signature{-1}\relax % un bemol a la clef
\input praetorx
\eject\transpose=0\relax
\vsize 270mm
\advance\bottommargin by -2\Interligne
\musicsize=20\computespecifics
\resetsignatures
\input marcellx
\eject
\output={\outputlaserjet}%
%
\def\instrumenti{}\def\instrumentii{}\Pagewidth=170mm
\hsize=\Pagewidth
\Pageheight=260mm
\vsize=\Pageheight
%
\centerline{\moyen The Creation~: source text}\bigskip
%
\parindent 0pt
%\check
\tt
\par\tt\\def\\nbinstruments\{2\}\%
\par\tt\\generalmeter\{\\meterfrac\{4\}\{4\}\}\%
\par\tt\\generalsignature\{0\}\%
\par\tt\\hsize 18.5cm
\par\tt\\vsize 270mm
\par\tt\\centerline\{\\enorme Aria No. 24\}
\par\tt\\medskip\\centerline\{\\moyen (La Cr\\'eation)\}
\par\tt\\medskip\\centerline\{\\moyen Joseph HAYDN\}
\par\tt\%
\par\tt\\rightline\{Transcription pour Orgue et T\\'enor, D. Taupin (1990)\}
\par\tt\\medskip
\par\tt\\nbporteesii=2\\relax
\par\tt\\def\\qbl\#1\#2\#3\{\\ibl\{\#1\}\{\#2\}\{\#3\}\\qb\{\#1\}\{\#2\}\}\%
\par\tt\\def\\qbu\#1\#2\#3\{\\ibu\{\#1\}\{\#2\}\{\#3\}\\qh\{\#1\}\{\#2\}\}\%
\par\tt\\etroit \\def\\DS\{\\hbox\{\\ds\}\}\\def\\FS\{\\hbox\{\\kern
 0.3\\noteskip\\soupir\}\\kern -0.3\\noteskip\}
\par\tt\\cleftoksi=\{\{6\}\{0\}\{0\}\{0\}\}
\par\tt\\cleftoksii=\{\{6\}\{0\}\{0\}\{0\}\}
\par\tt\\debutmorceau
\par\tt\\NOTes\\soupir\&\\rlap\{\\rmidtwotext\{\\bf II\}\}\\soupir\|\\qu
 g\\enotes
\par\tt\% mesure 1
\par\tt\\advance\\barno by -1\\relax
\par\tt\\barre\\NOtes\\itenu2J\\wh J\&\\zw
 N\\ibl0c0\\qb0e\|\\itenl0j\\ibu1l0\\qh1j\\enotes
\par\tt\\notes\&\\qbl0c0\|\\nbbu1\\nbbbu1\\tten0\\qh1\{jkj\}\\tbu1\\qh1i\\enotes
\par\tt\\Notes\&\\qb0e\\tbl0\\qb0c\|\\qu j\\enotes
\par\tt\\temps\\Notes\&\\ibl0c0\\qb0\{ece\}\\tbl0\\qb0c\|\\ql l\\sk\\ql
 j\\enotes
\par\tt\% mesure 2
\par\tt\\barre\\Notes\\tten2\\wh J\&\\ql J\\sk\\ql L\|\\ppt g\\rlap\{\\qu
 g\}\\qbl1e0\\relax
\par\tt\ \ \ \ \ \ \ \\zq c\\qb1e\\zq c\\qb1e\\relax
\par\tt\ \ \ \ \ \ \ \\zq c\\tbl1\\rlap\{\\qb1e\}\\ \\ \\ccu h\\enotes
\par\tt\\temps\\Notes\&\\ql N\\sk\\pt L\\ibl0L\{-4\}\\qb0L\|\\ibl1e0\\zq
 c\\rlap\{\\qb1e\}\\cu g\\relax
\par\tt\ \ \ \ \ \ \ \\zq c\\rlap\{\\qb1e\}\\raise\\Interligne\\DS \\rlap\{\\qu
 g\}\\qb1g\\enotes
\par\tt\\notes\&\\sk\\tbbl0\\tbl0\\qb0J\|\\tbl1\\zq c\\qb1e\\enotes
\par\tt\% mesure 3
\par\tt\\barre\\NOtes\\itenl2G\\wh G\&\\zw N\\raise 3.5\\Interligne\\ds
\par\tt\|\\rlap\{\\cl f\}\\itenl0k\\ibu1m0\\qh1k\\enotes
\par\tt\\notes\&\\qbl0b0\|\\nbbu1\\nbbbu1\\tten0\\qh1\{klk\}\\tbu1\\qh1\{\^{
 }j\}\\enotes
\par\tt\\Notes\&\\zq d\\qb0f\\tbl0\\qb0b\|\\qu k\\enotes
\par\tt\\temps\\Notes\&\\ibl0d0\\zq d\\qb0\{fb\}\\zq d\\qb0f\|\\qu m\\sk\\pt
 k\\qbu1k\{-4\}\\enotes
\par\tt\\notes\&\\tbl0\\qb0b\|\\sk\\tbbu1\\tbu1\\qh1i\\enotes
\par\tt\% mesure 4
\par\tt\\barre\\Notes\\tten2\\wh G\&\\ql G\\sk\\ql I\|\\rlap\{\\qupp
 g\}\\ibl1c0\\qb1g\\relax
\par\tt\ \ \ \ \ \ \ \\zq\{bd\}\\qb1f\\zq\{bd\}\\qb1f\\relax
\par\tt\ \ \ \ \ \ \ \\zq\{bd\}\\tbl1\\rlap\{\\qb1f\}\\ \\ \\ccu h\\enotes
\par\tt\\temps\\Notes\&\\ql K\\sk\\pt
 I\\qbl0I\{-4\}\|\\ibl1d0\\rlap\{\\qb1b\}\\cu g\\relax
\par\tt\ \ \ \ \ \ \ \\zq\{bd\}\\rlap\{\\qb1f\}\\raise\\Interligne\\DS
 \\rlap\{\\qu g\}\\qb1g\\enotes
\par\tt\\notes\&\\sk\\tbbl0\\tbl0\\qb0G\|\\tbl1\\zq\{bd\}\\qb1f\\enotes
\par\tt\% mesure 5
\par\tt\\barre\\Notes\\hu J\&\\rlap\{\\hu J\}\\ibl0M0\\qb0J\\zq N\\qb0c\\zq
 N\\qb0c\\tbl0\\zq N\\qb0c\\relax
\par\tt\ \ \ \ \ \ \|\\rlap\{\\hl e\}\\qu j\\sk\\qbu1l\{-4\}\\tbu1\\qh1j\\enotes
\par\tt\\temps\\Notes\\hu K\&\\rlap\{\\hu K\}\\ibl0M0\\qb0K\\zq N\\qb0b\\zq
 N\\qb0b\\tbl0\\zq N\\qb0b\\relax
\par\tt\ \ \ \ \ \ \|\\rlap\{\\hl f\}\\ibu1k0\\qh1\{ikm\}\\tbu1\\qh1k\\enotes
%\check
\par\tt\% mesure 6
\par\tt\\barre\\Notes\\wh L\&\\zw N\\raise
 3.5\\Interligne\\ds\\qbl0c0\\qb0e\\relax
\par\tt\ \ \ \ \ \ \|\\rlap\{\\hl g\}\\ppt j\\qu j\\enotes
\par\tt\\notes\&\\tbl0\\qb0c\|\\sk\\ccu l\\enotes
\par\tt\\temps\\Notes\&\\ibl0c0\\qb0\{ece\}\|\\rlap\{\\hl g\}\\qu n\\sk\\raise
 2\\Interligne\\DS\\enotes
\par\tt\\notes\&\\tbl0\\qb0c\|\\ibbu1m\{-3\}\\qh1m\\tbu1\\qh1l\\enotes
%\check
\par\tt\% mesure 7
\par\tt\\barre\\Notes\\wh M\&\\zw a\\raise
 3.5\\Interligne\\ds\\qbl0d0\\qb0f\\tbl0\\qb0d\\relax
\par\tt\ \ \ \ \ \ \|\\rlap\{\\hlp h\}\\qu k\\sk\\qu m\\enotes
\par\tt\\temps\\Notes\&\\ibl0d0\\qb0f\|\\pt o\\qbu1o\{-3\}\\enotes
\par\tt\\notes\&\\zq d\\qb0f\\sk
\par\tt\\zq d\\qb0f\\sk\\tbl0\\zq d\\qb0f\|\\sk\\tbbu1\\tbu1\\qh1n\\relax
\par\tt\ \ \ \ \ \ \\ibbu1m\{-3\}\\rlap\{\\raise
 -\\Interligne\\qp\}\\qh1\{mlk\}\\tbu1\\qh1j\\enotes
%\check
\par\tt\% mesure 8
\par\tt\\alaligne\\Notes\\hu G\&\\lcharnote c\{\\bf I\}\\relax
\par\tt\\pz b\\ibl0M3\\qb0N\\pz d\\qb0b\\pz f\\qb0d\\pz d\\tqb0b\|\\ql
 i\\rlap\{\\uptext\{\\bf I\}\}\\sk\\ds\\ppz p\\zq\{km\}\\cl p\\enotes
\par\tt\\temps\\Notes\\hu G\&\\ibl0M3\\pz b\\qb0N\\pz e\\qb0c\\pz g\\qb0e\\pz
 e\\tqb0c\\relax
\par\tt\ \ \ \ \ \ \ \ \|\\zq\{jl\}\\ql q\\sk\\ds\\ppz l\\zq\{gj\}\\cl l\\enotes
%\check
\par\tt\% mesure 9
\par\tt\\barre\\Notes\\hu G\&\\pz b\\ibl0M3\\qb0N\|\\zq\{gi\}\\ql k\\enotes
\par\tt\\notes\&\\nbbl0\\qb0b\\tqb0c\\enotes
\par\tt\\zglu\\Notes\&\\pz f\\ibl0d\{-4\}\\qb0d\\pz d\\tqb0b\|\\ds\\ppz
 p\\zq\{km\}\\cl p\\enotes
\par\tt\\temps\\Notes\\hu G\&\\pz b\\ibl0M3\\qb0N\|\\ppz q\\ibl1m3\\zq
 l\\qb1q\\enotes
\par\tt\\notes\&\\nbbl0\\qb0c\\tqb0d\|\\nbbl1\\qb1q\\tqb1p\\enotes
\par\tt\\temps\\notes\&\\pz g\\ibl0e\{-4\}\\qb0e\\sk\\pz
 e\\tqb0c\|\\ibbl1p0\\qb1\{qpq\}\\tqb1s\\enotes
%\check
\par\tt\% mesure 10
\par\tt\\barre\\Notes\\hu G\&\\zq\{Nb\}\\ql d\|\\pz t\\ibl1o\{-3\}\\qb1r\\enotes
\par\tt\\notes\&\|\\nbbl1\\qb1n\\tqb1\{\^{ }m\}\\enotes
\par\tt\\zglu\\notes\&\\soupir\|\\ibbl1m0\\qb1\{nmn\}\\tqb1m\\enotes
\par\tt\\temps\\Notes\\hpause\&\\ibl0I6\\pz J\\qb0G\|\\pz p\\cl n\\enotes
\par\tt\\notes\&\\nbbl0\\qb0N\\tqb0\{\^{ }M\}\|\\ibbu1g\{-3\}\\qh1g\\tqh1\{\^{
 }f\}\\enotes
\par
\tt\\notes\&\\ibbl0N0\\qb0\{NMN\}\\tqb0M\|\\ibbu1g0\\qh1\{gfg\}\\tqh1f\\enotes
%\check
\par\tt\\suspmorceau
\par\tt\\def\\nbinstruments\{4\}\%
\par\tt\\nbporteesiii=0\\relax
\par\tt\% mesure 11
\par\tt\\reprmorceau
\par\tt\\NOtes\\qu G\&\\ql N\|\\st m\\qu g\&\&\\hpause\\enotes
\par\tt\\zglu\\NOtes\\soupir\&\\rlap\{\\rmidtwotext\{\\bf II\}\}\\soupir\|\\zq
 d\\qu\{=f\}\&\&\\enotes
\par\tt\\temps\\NOtes\\hpause\&\\hpause\|\\zq c\\qu e\&\&\\soupir\\enotes
\par\tt\\zglu\\NOtes\&\|\\zq b\\qu d\&Mit\~{ }\&\\ilegu0p\\qu g\\enotes
\par\tt\% mesure 12
\par\tt\\barre\\Notes\&\\qu J\|\\zw N\\zq c\\ibu0e0\\qh0e\\zq c\\qh0e\&W\\\"{
 }urd\~{ }\&\\ql j\\enotes
\par\tt\\Notes\&\\soupir\|\\zq c\\qh0e\\zq c\\tqh0e\&und\~{ }\&\\ql j\\enotes
\par\tt\\temps\\Notes\\pause\&\\hpause\|\\zq c\\ibu0e0\\qh0e\\zq
 c\\qh0e\&Ho-\&\\ql l\\enotes
\par\tt\\Notes\&\\zcharnote C\{\\bf I\}\|\\zq c\\qh0e\\zq c\\tqh0e\&heit\~{
 }\&\\ql j\\enotes
\par\tt\% mesure 13
\par\tt\\barre\\Notes\&\\qu C\|\\zw N\\zq c\\ibu0e0\\qh0e\\zq
 c\\qh0e\&an-\&\\qup g\\enotes
\par\tt\\Notes\&\\qu E\|\\zq c\\qh0e\\zq c\\tqh0e\&\\sk ge-\&\\sk\\cu h\\enotes
\par\tt\\temps\\Notes\\pause\&\\qu G\|\\zq c\\ibu0e0\\qh0e\\zq c\\qh0e\&tan,\~{
 }\&\\tleg0\\qu g\\enotes
\par\tt\\Notes\&\\ibu1E\{-3\}\\qhp1E\|\\zq c\\qh0e\&mit\~{ }\&\\ilegu0p\\qu
 g\\enotes
\par\tt\\notes\&\\sk\\tbbu1\\tqh1C\|\\zq c\\tqh0e\&\&\\enotes
\par\tt\% mesure 14
\par\tt\\barre\\Notes\&\\qu G\|\\zw
 N\\ibu0e0\\zq\{bd\}\\qh0f\\zq\{bd\}\\qh0f\\relax
\par\tt\ \ \ \ \&Sch\\\"{ }on-\&\\ql k\\enotes
\par\tt\\Notes\&\\soupir\|\\zq\{bd\}\\qh0f\\zq\{bd\}\\tqh0f\&heit,\~{ }\&\\ql
 k\\enotes
\par
\tt\\temps\\Notes\\pause\&\\hpause\|\\zq\{bd\}\\qh0f\\zq\{bd\}\\qh0f\&St\\\"{
 }ark\~{ }\&\\ql m\\enotes
\par\tt\\Notes\&\|\\zq\{bd\}\\qh0f\\zq\{bd\}\\tqh0f\&und\~{
 }\&\\ibu2k\{-4\}\\qh2k\\tqh2i\\enotes
\par\tt\\suspmorceau
%\check
\vfill\eject
\Pageheight=240mm\vsize=\Pageheight
\centerline{\moyen PRACTICAL USE}
\def\eightpoint{\Eightpoint}
\catcode`\@=13
\parindent 8mm
\section{Heading statements}
\def\m@essage{\message}\begindoublecolumns
Before any reference to \musictex\ macros~:
\medskip\tt\\input musicnft 

\tt\\input musictex
\rm\medskip\noindent which may be followed by \hbox{\tt \\input musicadd}
in the case you have more than six instruments (voice is two instruments:
one for the music, one for the text) or more than 6 simultaneous beams
or ties or slurs.
\medskip
After that, you may write a complete book of \TeX\ provided that you
do not use \hbox{\tt \&} as a tabulation character (its \hbox{\tt \\catcode}
has been changed) and that you do not overwrite \musictex's definitions.
This means that no special macros have been designed to help you write
titles, author names, comments, literature excerpts, etc.
 \enddoublecolumns
\section{Before you begin to write notes}
\begindoublecolumns
You should first specify whether you want to typeset music in size 20pt
par staff or 16pt. This only optional, the default value being 20pt. If you want
the 16pt size, then you have to say~:
\medskip\tt \\musicsize=16\medskip
\rm Then, the first compulsory declaration is~:
\medskip\tt\\def \\nbinstruments\{$n$\}
\rm\medskip\noindent where $n$ is the number of instruments, used by \musictex\
to performs loops building staffs, setting signatures, meters, etc. Therefore,
it must be defined before any other statements.
An instrument may consist of several staffs, e.g. the piano.
The difference between one instrument of several staffs and several instruments
is as follows~:
\Item{*} Distinct instruments may have distinct signatures, distinct staffs
of a unique instrument share the same signature.
\Item{*} Stems may be hung to beams belonging to differents staffs of the
same instrument.
\Item{*} Chords may extend across several staffs of the same instrument.
\Item{*} Staffs of a unique instrument are tied together with a big brace
at the beginning of each line.
\medskip
If the number of staffs (in french ``port\'ees'') is not equal to one,
this number must be specified by~:
\medskip
%\check
\tt\\nbportee$r$=$p$\\relax
\rm\medskip\noindent where $p$ is the number of staffs, and where $r$ is
the roman numeral of the instrument considered (e.g. \hbox{\tt \\nbporteesiii}
for the 3rd insrument, starting from the bottom).
\medskip
If the signature is not void, one should code~:
\medskip\tt\\generalsignature=$s$\\relax\rm\medskip\noindent
where $s>0$ indicates the number of \ital{sharps} in the signature and
$s<0$ the number of flats\Footnote{\hsize\Pagewidth\eightpoint
We have seen once a score in G-minor
where the signature consisted in two flats (B and E) plus one sharp (F).
This is not supported by \musictex.}. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\medskip
If there a \ital{meter} indication is to be posted,
it should be specified using the macro
\medskip\tt\\generalmeter\{$m$\}\%\rm\medskip\noindent
where $m$ is the description of the meter indication which should appear on
 each staff.
If it is a \ital{fraction} (e.g. 3/4) on should code
\medskip\tt\\generalmeter\{\\meterfrac\{3\}\{4\}\}\%\medskip\rm\noindent
or, in a simpler way (if the numbers are less than 10)~:
\medskip\tt\\generalmeter\{\\meterfrac 34\}\%\medskip\rm
Special denotations can be used, such as \hbox{\tt \\allabreve} to get \raise
 -6pt\hbox{\allabreve} and \hbox{\tt \\meterC} to get  \raise
 -6pt\hbox{\meterC}.
 \medskip However, not all music scores have the same meter in each staff.
Especially, some staffs may have \ital{ternary} meters while others have
\ital{binary}. This can be specified by using the \hbox{\tt \\generalmeter} macro
to set the meter for most of the scores and overriding it by means of a more
sophisticated command~:
 \enddoublecolumns \leftrule
%\check
\centerline
{\tt\\metertoksii=\{\{\\meterfrac\{12\}8\}\{\\allabreve\}\{\}\{\}\}\%}
 \rightrule \begindoublecolumns
 \rm\noindent which sets the meter to 12/8 for the first (lower) staff, and
\ital{alla breve} for the second staff of the instrument number 2
(\ital{ii}). Note that there is room for 4 staffs and that void items must be
specified, otherwise \TeX\ weird errors occur.
 \medskip
 If you want the name of the instruments (or the name of the voices) to be
displayed in front of their respective staffs at the beginning, you may
code~: \medskip\tt\\def\\instrument$r$\{\ital{name of the instrument}\}\%
 \medskip\noindent\rm where $r$ is
the roman numeral of the instrument considered.
In this case, you should also adjust the \hbox{\tt \\parindent} dimension so
that the long name of an instrument does not spill too far into the left
margin.
 \enddoublecolumns\rm
%\check
\section{Starting your masterpiece}
 \begindoublecolumns
Just code
\medskip\tt\\debutmorceau\rm\medskip\noindent
which will initiate (with indentation \hbox{\tt \\parindent}) the first set of
staffs for all instruments you have previously defined.  But that is not
sufficient to begin writing notes and silences.  In fact, you also must
choose the spacing of the notes. This is done by saying
\medskip\tt\\normal\rm\medskip\noindent
if you want a elementary spacing of {\tt 10pt}. If you say \hbox{\tt \\large} the
elementary spacing (\hbox{\tt \\elemskip}) is set to {\tt 12pt}.  Once this is
done, you can select $\sqrt 2$ multiples of this spacing by initiating
your column with \hbox{\tt \\notes} (spacing \hbox{\tt \\elemskip}), \hbox{\tt \\Notes}
(spacing \hbox{\tt  1.4\\elemskip}), etc.  If these values of \hbox{\tt \\elemskip}
are not fit to your needs, you can also say
\medskip\tt\\normal\\elemskip=15pt\rm
 \medskip Of course, if your are sufficiently skilled with \TeX, you can also
compute \hbox{\tt \\elemskip} according to the number of bars you want in a line
and the number of notes in each bar. Incidentally, this is done by the \hbox{\tt \\autolines}
macro which will be introduced later.
 \medskip In practice, the choice of the macro \hbox{\tt \\notes}, \hbox{\tt \\Notes},
\hbox{\tt \\NOtes}, etc., to initiate of column of notes sets an internal dimension
register, named \hbox{\tt \\noteskip} to the given multiple of \hbox{\tt \\elemskip}. The
text of the macros \hbox{\tt \\normal}, \hbox{\tt \\large} and \hbox{\tt \\etroit} is thus
rather simple~:
 \enddoublecolumns
\leftrule
%\check
\tt
\par\\def\\normal\{\\ifdim\\Interligne<0.1pt\\computewidths\\fi \%
  {\rm(ignore this safety)}
\par\\elemskip=2\\Interligne\\relax  {\rm(i.e. 10 points)}
\par\\def\\notes\{\\vnotes 1.0\\elemskip \}\%
\par\\def\\Notes\{\\vnotes 1.4\\elemskip \}\%
\par\\def\\NOtes\{\\vnotes 2.0\\elemskip \}\%
\par\\def\\NOTes\{\\vnotes 2.8\\elemskip \}\%
\par\\def\\NOTEs\{\\vnotes 4.0\\elemskip \}\%
\par\\def\\NOTES\{\\vnotes 5.6\\elemskip \}\}\%
\medskip
\par\\def\\large\{\\normal\\elemskip=2.4\\Interligne\}\%
\medskip
\par\\def\\etroit\{\\ifdim\\Interligne<0.1pt\\computewidths\\fi
\par\\elemskip=2\\Interligne\\relax
\par\\def\\notes\{\\vnotes 1.0\\elemskip \}\%
\par\\def\\Notes\{\\vnotes 1.3\\elemskip \}\%
\par\\def\\NOtes\{\\vnotes 1.8\\elemskip \}\%
\par\\def\\NOTes\{\\vnotes 2.6\\elemskip \}\%
\par\\def\\NOTEs\{\\vnotes 3.6\\elemskip \}\%
\par\\def\\NOTES\{\\vnotes 5.2\\elemskip \}\}\%
\medskip
\par\\def\\vnotes\#1\\elemskip\{\\noteskip=\#1\\elemskip\\n\@otes\}\%
 \medskip
\rightrule\begindoublecolumns
\rm As seen above, if these standard spacings
do not meet your requirements, you are welcome to define
other spacings, using the more basic macro \hbox{\tt \\vnotes}.
 \medskip However, you may also prefer to ask \musictex\ to compute the size
of \hbox{\tt \\elemskip} from the page width (\hbox{\tt \\hsize}) after assuming a
constant number of bars of a constant number of beats within each
line\Footnote{\hsize\Pagewidth\eightpoint
This does not meet the requirements of contemporaneous music,
but fits very well to baroque and romantic music.}. In this case, you have
better use the \hbox{\tt \\autolines} macro, which is described below (see~: ``Line
and page breaking'').
 \enddoublecolumns
%\check
 \section{Note pitch specification}
 \begindoublecolumns
 Note pitches are usually specified by letters ranging from {\tt a} to {\tt
z} for those which are usually written under the G-clef ({\tt a} corresponds
to the $A$ of frequency 222.5~Hz ~; the \ital{G} of the G-clef is denoted
{\tt g}). Lower pitch notes are specified using uppercase letters ranging
from  {\tt A} to {\tt N} (the \ital{F} of the F-clef is denoted {\tt M}, and
{\tt F} is one octave below).
%\check
 \medskip  If necessary, a numeric symbol can be used to place a symbol
independently of the active clef.
\medskip
 Besides, notes below {\tt A} (i.e. the $A$ of frequency  55.625~Hz), namely
the lowest octave of the modern pianos can only be coded using the
transposition features (see below~: \ital{transposition}
and \ital{octaviation}) or in absolute vertical position using numbers.
 \enddoublecolumns
\par\ifdim\pagetotal>0.8\vsize\vfil\eject\fi
\section{Writing notes}
 \begindoublecolumns
There are two major kinds of note macros~:
\Item{1.} those which terminate a note/chord stem and cause horizontal spacing,
 \item{2.} those which initiate or extend a note/chord stem and do not cause
horizontal spacing.
 \medskip The first kind is used to type a melody, the second kind is used to
type chords.
%\check
\subsect{Single (spacing) notes}
{\tt\\wh $p$} : whole note at pitch $p$.
 If $p$ may be either a letter (upper or lower case are distinct -- see above)
or an integer with a possible minus sign.
\par{\tt\\hu $p$} : half note at pitch $p$ with stem up.
\par{\tt\\hl $p$} : half note at pitch $p$ with stem down.
\par{\tt\\qu $p$} : quarter note at pitch $p$ with stem up.
\par{\tt\\ql $p$} : quarter note at pitch $p$ with stem down.
\par{\tt\\cu $p$} : eighth note\Footnote{The {\tt \\c} of this macro
 name is taken from the french word \ital{``croche''} which is by the way one
 half of the english \ital{crotchet}~; {\tt\\cc...}, {\tt\\ccc...}
 are standing for \ital{``double croche''}, \ital{``triple croche''}, etc.}
 at pitch $p$ with stem up.
\par{\tt\\cl $p$} : eighth note at pitch $p$ with stem down.
\par{\tt\\ccu $p$} : sixteenth note at pitch $p$ with stem up.
\par{\tt\\ccl $p$} : sixteenth note at pitch $p$ with stem down.
\par{\tt\\cccu $p$} : 32-th note at pitch $p$ with stem up.
\par{\tt\\cccl $p$} : 32-th note at pitch $p$ with stem down.
\par{\tt\\ccccu $p$} : 64-th note at pitch $p$ with stem up.
\par{\tt\\ccccl $p$} : 64-th note at pitch $p$ with stem down.
%\check
 \medskip As an example, the sequence~:

{\parindent=0pt\def\nbinstruments{1}\def\instrumenti{}
 \generalsignature{0}\savesignature\cleftoksi={{0}{0}{0}{0}}
 \debutextrait\normal
\notes\cu c\temps\cl j\enotes\barre
\notes\ccu c\temps\ccl j\enotes\barre
\notes\cccu c\temps\cccl j\enotes\barre
\notes\ccccu c\temps\ccccl j\enotes\finextrait }\medskip
\noindent was coded as~:
%\check
 {\tt\obeylines\parindent 0pt
\\notes\\cu c\\temps\\cl j\\enotes\\barre
\\notes\\ccu c\\temps\\ccl j\\enotes\\barre
\\notes\\cccu c\\temps\\cccl j\\enotes\\barre
\\notes\\ccccu c\\temps\\ccccl j\\enotes\\suspmorceau
 }\medskip
If these notes are preceeded by \ital{non-spacing}
notes (i.e. macros {\tt\\zq} or {\tt\\zh})
their stem is extended up or down so as to join all notes into a single chord.
 \subsect{Non-spacing (chord) notes}
{\tt\\zq $p$} : quarter (or shorter) note head at pitch $p$ with no
spacing after.
\par{\tt\\zh $p$} : half note head at pitch $p$ with no spacing after.
 \medskip It must be pointed out that the pitch $p$ of these notes is
memorized so that the stem of the further spacing note will join them into
a chord.  This stem top and bottom pitch is \ital{reset} at each spacing
note.
\medskip
\sl REMARK : Notes of duration longer than whole notes are always
non-spacing. This saves one useless definition, since this notes are
always longer than other simultaneous ones. If needed they can be followed
by {\tt\\sk} to force spacing.
\subsect{Shifted non-spacing (chord) heads}
These symbols are used mainly in chords where \ital{second} intervals are
 present.
It is the responsibility of the typist to choose which heads should be shifted
 left or right.
\medskip
\par{\tt\\rw $p$} : whole note head shifted right by one note width (ca. 6pt),
 no spacing.
\par{\tt\\lw $p$} : whole note head shifted left by one note width (ca. 6pt),
 no spacing.
\par{\tt\\rh $p$} : half note head shifted right by one note width (ca. 6pt),
 no spacing.
\par{\tt\\lh $p$} : half note head shifted left by one note width (ca. 6pt), no
 spacing.
\par{\tt\\rq $p$} : quarter note head shifted right by one note width (ca.
 6pt), no spacing.
\par{\tt\\lq $p$} : quarter note head shifted left by one note width (ca. 6pt),
 no spacing.
\medskip
Except that they are shifted left of right, these macros act like {\tt\\z...}
 macros for stem building.
\subsect{Shifted notes}
\par{\tt\\rqu} : acts like {\tt\\qu} but the note head is shifted one note
 width. This is used for chords
whose upper note has to be on the right side of the stem.
\par{\tt\\rhu} : same as above for a half note.
\subsect{Non-spacing single notes}
 \par{\tt\\zhu} : half note with stem up but no spacing. It acts like
{\tt\\hu} for stem building.
 \par{\tt\\zhl} : half note with stem down but no spacing. It acts like
{\tt\\hl} for stem building.
 \par{\tt\\zqu} : quarter note with stem up but no spacing. It acts like
{\tt\\qu} for stem building.
 \par{\tt\\zql	} : quarter note with stem down but no spacing. It acts like
{\tt\\ql	} for stem building.
 \medskip {\tt\\lhu}, {\tt\\lhl}, {\tt\\lqu}, {\tt\\lql} : same as above, but
the whole of the note is shifted one note width on the left.
 \par{\tt\\zw $p$} : whole note at pitch $p$ with no spacing after.
\par{\tt\\zwq $p$} : arbitrary duration note (\raise
2.5pt\hbox{\musicxx\char 125}) at pitch $p$ with no spacing after.
\par{\tt\\zbv $p$} : breve note  (\raise
2.5pt\hbox{\musicxx\char 36}) at pitch $p$ with no spacing after.
\par{\tt\\zsb $p$} : semi-breve note  (\raise
2.5pt\hbox{\musicxx\char 32}) at pitch $p$ with no spacing after.
\subsect{Pointed notes}
 One simple way of doing consists in putting {\tt\\pt
$p$} to get a \ital{dot} after the normal notehead at pitch $p$. Thus a
quarter note with a point can be coded \hbox{\tt \\pt h\\qu h}. \medskip A simpler
way of doing consists in using compact macros, namely~: {\tt\\qup},
{\tt\\qupp}, {\tt\\quppp}, {\tt\\zqp}, {\tt\\zhp},  {\tt\\zwp} (these three
{\tt\\z...p} are useful in chords), {\tt\\hup},
{\tt\\whp}, {\tt\\qhp}, {\tt\\qhpp}, {\tt\\qlp}, {\tt\\qlpp},
etc. \medskip You may also introduce
pointed notes, especially in groups by coding~: \hbox{\tt \\qu\{.a.\^{}b.c\}} which
is equivalent to~:
\medskip\centerline
{\tt\\pt\{a\}\\qu\{a\}\\pt\{b\}\\sh\{b\}\\qu\{b\}\\pt\{c\}\\qu\{c\}}
\enddoublecolumns
\section{Beams}
\begindoublecolumns
 Beams are not automatically handled, but they must be declared explicitely,
\ital{before} the first spacing note involving them is coded.
 \medskip\hbox{\tt \\ibu $nps$} : initiates an \ital{upper beam} 3 horizontal line
spacings above the pitch $p$. $m$ is its reference number, which must be in
the range [0-6] ([0-9] if \hbox{\tt  musicadd} file has been \hbox{\tt \\input}).
 \medskip $s$ is the slope of the beam. It is an integer in the range [-9,9].
$s=1$ means a slope of 5\%, $s=9$ means a slope of 45\% (the maximum with the
\hbox{\tt  beamn20} or \hbox{\tt  beamn16} fonts), $s=-3$ means a slope of -15\%, etc.
With usual spacings a slope of 2 or 3 is fit for ascending scales. A slope of
6 to 9 is fit for ascending arpeggios.
 \medskip {\tt\\ibl $nps$} : initiates a \ital{lower beam} 3 horizontal line
spacings below the pitch $p$. Other parameters as above.
 \medskip{\tt\\ibbu $nbs$} : initiates a \ital{double upper beam} (same
parameter meaning).
 \par{\tt\\ibbl $nbs$} : initiates a \ital{double lower beam} (same parameter
meaning).
 \par{\tt\\ibbbu $nbs$} : initiates a \ital{triple upper beam} (same
parameter meaning).
 \par{\tt\\ibbbl $nbs$} : initiates a \ital{triple lower beam} (same
parameter meaning).
 \par{\tt\\ibbbbu $nbs$} : initiates a \ital{quadruple upper beam} (same
parameter meaning).
 \par{\tt\\ibbbbl $nbs$} : initiates a \ital{quadruple lower beam} (same
parameter meaning).
 \medskip Beam termination is also not automatic. The termination of a given
beam must be explicitely declared
\ital{before} coding the last spacing note connected to that beam.
 \medskip
{\tt\\tbu $n$} : terminates upper beam number $n$ at current position.
\par{\tt\\tbl $n$} : terminates lower beam number $n$ at current position.
 \medskip {\tt\\tbu} and {\tt\\tbl} terminate beams of any multiplicity.
Therefore 32-th notes hanging on a triple beam are initiated by {\tt\\ibbbu
$nps$} and terminated by {\tt\\tbu $n$}.
 \medskip It is also possible to code beams whose multiplicity is not the
same at the beginning. The multiplicity can be increased at any position. For
instance,  {\tt\\nbbu $n$} which sets the muliplicity  of upper beam number
$n$ to 2 starting at the current position, {\tt\\nbbbu $n$} sets its
multiciplicity to 3, and \hbox{\tt \\nbbbbu $n$} sets it to 4. \hbox{\tt \\nbbl $n$ \dots
\\nbbbbl $n$} perform the same functions for lower beams.
 \medskip Notes hanging or standing on beams are coded in the form
\hbox{\tt \\qh$n\,\,p$} and  \hbox{\tt \\qb$n\,\,p$} where $n$ is the beam number and $p$
the pitch of the note head. \musictex\ adjusts the length of the note stem to
link the bottom of the chord to an upper beam (normally with {\tt\\qh}) and
the top of the chord to a lower beam (normally with {\tt\\qb}).
 \medskip Note that the difference between upper and lower beams does not
mainly consist in the beam being above or below the note heads~; rather, it
specifies whether the abscissa of the beginning and the end of this beam is
aligned on the right (upper beam) or on the left (lower) beam. Thus, the
sequence~:

 \medskip
{\def\nbinstruments{1}\nbporteesi=1\relax
\cleftoksi={{0}{0}{0}{0}}\def\instrumenti{}\resetsignatures\debutextrait
\large\temps
\notes\ibu0e0\qh0e\nbbu0\qh0e\nbbbu0\qh0e\tbu0\qh0e\enotes
\finextrait}\restorepenalties

 \eject
%\check
\noindent has been coded as\medskip
\tt\\notes\\ibu0e0\\qh0e\\nbbu0\\qh0e\\relax

\\nbbbu0\\qh0e\\tbu0\\qh0e\\enotes
%\check
 \rm\medskip It is quite possible to terminate with {\tt\\tbu} a beam
initiated with {\tt\\ibl}. This may give~:
 \medskip
{\def\nbinstruments{1}\nbporteesi=1\relax
\cleftoksi={{0}{0}{0}{0}}\def\instrumenti{}\resetsignatures\debutextrait
\large\temps
\notes\ibl0p0\qb0p\nbbl0\qb0p\nbbbl0\qb0p\tbu0\qh0e\enotes
\finextrait}\restorepenalties

%\check
\noindent which has been coded as
\medskip\tt
\\notes\\ibl0p0\\qb0p\\nbbl0\\qb0p\\relax

\\nbbbl0\\qb0p\\tbu0\\qh0e\\enotes
%\check
 \rm\medskip Partial termination of beams is also possible, by using
{\tt\\tbbu} or {\tt\\tbbl}~: these macros terminate the current beam except
that of order 1 (eights). {\tt\\tbbbu} or {\tt\\tbbbl} terminate the current
beam except those of order 1 and 2, etc.
 \medskip
The macros {\tt\\tbbu} and {\tt\\tbbl} may also be invoked when only
a single beam is active. Then, a second beam (upper or lower according
the initiating procedure) is opened \ital{one note width before
the current position, and closed immediately}. Thus the following sequence
\medskip
{\def\nbinstruments{1}\nbporteesi=1\relax
\cleftoksi={{0}{0}{0}{0}}\def\instrumenti{}\resetsignatures\debutextrait
\large          \temps
\notes\ibu0e0\qh0e\tbbu0\tbu0\qh0e\enotes
\finextrait}\restorepenalties

\medskip\noindent is coded~:
\medskip\centerline{\tt
\\notes\\ibu0e0\\qh0e\\tbbu0\\tbu0\\qh0e\\enotes
}
%\check
\rm\medskip
The same behaviour occurs in the case of {\tt\\tbbbu}, {\tt\\tbbbl},
{\tt\\tbbbbu} and {\tt\\tbbbbl}.
\medskip
 The symmetrical pattern is also possible. For example~:
\medskip{\def\nbinstruments{1}\nbporteesi=1\relax
\cleftoksi={{0}{0}{0}{0}}\def\instrumenti{}\resetsignatures
\debutextrait\normal
\Notes\ibbl0j0\rlap{\qsk\tbbl0}\qb0j\tbl0\qb0j\enotes
\finextrait}

\noindent has been coded as~:
\enddoublecolumns\leftrule

\centerline{\tt\\Notes\\ibbl0j0\\rlap\{\\qsk\\tbbl0\}\\qb0j\\tbl0\\qb0j\\enotes}


\medskip\rightrule\begindoublecolumns
\noindent{\sl REMARK~: these codings may seem complicated. In
fact, it is the responsability of the user to define macros which perform
the most common sequences in his masterpiece. For example, one could define
sets of four sixteenths by the macro~:}
\medskip\tt\\def\\qqh\#1\#2\#3\#4\#5\{\%

\\ibbl0\#2\#1\\qh \#2\\qh \#3\\tbl0\\qh \#4\}
\medskip\noindent\sl
%\check
 where the first argument is the slope and the other four arguments are the
pitches of the four consecutive sixteenths wanted.
\subsect{Semi-automatic beams}
 In order to avoid tedious checks to adjust the slope (and even the starting
pitch) of beams in music with a lot of steep beams, a set of automatically
slope computing has recently been implemented (file \hbox{\tt 
musicvbm.tex}). If you say \hbox{\tt \\Ibu2gj3} \musictex\ will understand
that you want to build an upper beam (beam number 2) horizontally extending
\hbox{3\tt\\noteskip} and whose first note is a {\tt g} and whose last note
is a{\tt j}. Knowing these parameters it will choose the highest slope number
which corresponds to a slope not more than $({\tt j}-{\tt
g})/(3\hbox{\tt \\noteskip})$. Moreover, if there is no sufficiently steep beam
slope available, then it will raise the starting point.
 \medskip Eight such macros are available~: {\tt\\Ibu}, {\tt\\Ibbu},
{\tt\\Ibbbu},  {\tt\\Ibbbbu},  {\tt\\Ibl}, {\tt\\Ibbl},
{\tt\\Ibbbl} and {\tt\\Ibbbbl}. Examples of their use is given in
{\tt marcello.tex}.
 \enddoublecolumns\par\penalty -8000
\rm
 \section{Phantom notes}
 \begindoublecolumns
It may be interesting, when coding a sequence of
notes within a unique pair \hbox{\tt \\notes...\\enotes}, to skip one note place
in order -- for example -- to set the third note of one staff at the same
abscissa as that of the second note of another staff.  This can be done by
inserting {\tt\\sk} which causes a spacing of one
\hbox{\tt \\noteskip}\Footnote{\hsize\Pagewidth\eightpoint
Do not use \hbox{\tt \\kern} nor \hbox{\tt \\hskip}~: in fact
{\tt\\sk} not only causes a space but also records that space for correct
handling of beams.}.
\medskip
If you just want to shift a note or a symbol by one note head width, you
may write {\tt\\qsk}.
\medskip
Note that these two latter macros must be used inside a pair
\hbox{\tt \\notes...\\enotes}. If you want to make a spacing of one note head
width oustside, write \hbox{\tt \\nspace}.
 \enddoublecolumns
\section{Collective coding~: sequences of notes}
 \begindoublecolumns
As seen in the Mozart example, it is not necessary to write a macro
sequence \hbox{\tt \\notes...\\enotes} for each column.  If, on all staffs of
all instruments, spacings are equal or multiple of a unique value, the
notes may be concatenated in each staff~:  each note in each staff makes
the current position horizontally advance by the elementary spacing
specified by the choice of \hbox{\tt \\notes}, \hbox{\tt \\Notes}, \hbox{\tt \\NOtes}, etc.
%\check
  \medskip The major interest of this feature resides in that fact that
the note macros are able to write several items~; for instance
\hbox{\tt \\qu\{cdefghij\}} writes the \ital{C-major} scale in quarters with
stem up. In the same way \hbox{\tt \\cl\{abcdef\^{ }gh\}} writes the
\ital{A-minor} scale in eighths. Not all note generating macros can be used
to perform collective coding, but most of them can. They are~:
\item{--} all the spacing notes~: \hbox{\tt \\wh}, \hbox{\tt \\hu}, \hbox{\tt \\hl}...
\hbox{\tt \\ccccl} and the beam hooked notes, i.e. \hbox{\tt \\qh$n$} and \hbox{\tt \\qb$n$}.
\item{--} all the chord notes whose name is of the form \hbox{\tt \\z...}.
\medskip
 Conversely, shifted notes are not supposed to be used in collective coding,
mainly because they are used in very special cases which do not deserve
wasting memory space to make them collective.
\medskip
If necessary a void space can be inserted in a collective coding by using
{\tt*}.
 \enddoublecolumns
%\check
\section{Accidentals}
 \begindoublecolumns
Accidentals can be introduced in two ways.
\medskip
The first way, the \ital{manual} way of coding them, consists for example
in coding \hbox{\tt \\fl a} to put a \ital{flat} at the pitch $a$, supposedly
before the further note of that pitch. There is no control upon the fact
that a note will be put at this position and at this pitch.
Naturals, sharps, double flats and double sharps are coded \hbox{\tt \\na $p$},
 \hbox{\tt \\sh $p$},
\hbox{\tt \\dfl $p$} and \hbox{\tt \\dsh $p$} respectively.
\medskip
Alternate procedures \hbox{\tt \\lfl}, \hbox{\tt \\lna}, \hbox{\tt \\lsh},
\hbox{\tt \\ldfl} and \hbox{\tt \\ldsh}
place the same accidentals, but their abscissa is shifted one note head width
on the left. The purpose of this is to avoid collision of accidentals
in a chord with narrow intervals.
\medskip
%\check
 The second way of coding accidentals consists in putting the symbol \hbox{\tt \^{
}} (sharp), the symbol {\tt\_} (flat), the symbol {\tt=} (natural), the
symbol {\tt>} (double sharp), or the symbol {\tt<} (double flat) within the
coding of the note, e.g.:  {\tt\\qh\{\^{ }g\}} yields a $G\sharp$. This may
very well be combined with collective coding, e.g.: {\tt\\qu\{ac\^{ }d\}}.
 \medskip
Two sizes are available for accidentals. They revert to the small version
when notes are supposed to be too close to each other. These two sizes can
be forces by coding {\tt\\bigfl}, {\tt\\bigsh}, etc., or \hbox{\tt \\smallfl},
\hbox{\tt \\smallsh}, etc. If one does not want to have any small accidentals,
then one can declare \hbox{\tt \\bigaccid} (conversely \hbox{\tt \\smallaccid} or
\hbox{\tt \\varaccid} -- the latter restoring variable sizes).
 \medskip It is also possible to put (small) accidentals \ital{above} the
note heads. This is done using \hbox{\tt \\uppersh $p$}, \hbox{\tt \\upperna $p$} or
\hbox{\tt \\upperfl $p$}.
 \enddoublecolumns
 \section{Transposition and octaviation}
 \begindoublecolumns
An important feature is the existence of a special register
\hbox{\tt \\transpose} whose normal value if 0. If you say
\medskip
\tt\\transpose=3\medskip\rm\noindent all subsequent pitches specified by
upper or lower case letters will be transposed 3 positions.  If you set
\hbox{\tt \\transpose} to 7 you may write your music one octave below its final
pitch.  Thus, you can define \ital{octaviation} macros like
%\check
\medskip
\tt\\def\\soqu\#1\{\\zq\{\#1\}\{\\transpose=7\\relax
\\qu\{\#1\}\}\}
\medskip\rm\noindent to build quarternote octaves in a single call.  Note
that the octaviated note is coded within braces so that the transposition
is only local.
%\check
 \medskip
 Octaviation can also be performed in is another way, namely unsing special
codes to transpose by multiples of 7 intervals. For example \hbox{\tt \\qu\{'ab\}}
is equivalent to \hbox{\tt \\qu\{hi\}} and \hbox{\tt \\qu\{\`{}kl\}} is equivalent to
\hbox{\tt \\qu\{de\}}. It should be emphasized here that the {\tt'} (acute accent)
and the {\tt\`{}} (grave accent) have cumulative effects, so that
\hbox{\tt \\qu\{''A'A\}} is equivalent to \hbox{\tt \\qu\{ah\}} and that the
\hbox{\tt \\transpose} parameter is only reset to its initial value (not
necessarily zero) when changing staff or instrument (i.e. \hbox{\tt \|} or \hbox{\tt \&})
or at \hbox{\tt \\enotes}. Since this may be confusing, it is useful tu use the
\hbox{\tt !} prefix to reset the \hbox{\tt \\transpose} register explicitely to the value
it had when entering \hbox{\tt \\notes}\Footnote{This value is saved in another
register named \hbox{\tt \\normaltranspose}.}. Thus \hbox{\tt \\qu\{!a'a\}} always gives
the note \hbox{\tt  a} and its upper octave \hbox{\tt  h} \ital{shifted by the value of
\hbox{\tt \\transpose} at the beginning of the current}\break
\enddoublecolumns
\eject
\begindoublecolumns
\noindent \hbox{\tt \\notes...\\enotes}
group
 (or \hbox{\tt \\Notes...\\enotes}, etc.)
whatever the number of previous grave and acute accents occurring inbetween.
\medskip
 The above processes indeed change the vertical position of the note heads
and associated symbols (note stems, accents and beams) but they do not
take care of the necessary changes of accidentals when transposing, i.e. the
fact that an $F\sharp$ occuring with a zero signature should become a
$B\natural$ when transposing from the tonality of $C$ major to $F$ major where
the normal $B$ is the $B\flat$. Since the intent of the composer is not
obvius -- he may want to shift a group of notes within the same tonality
or conversely to transpose it in another tonality -- this is not done
automatically. Thus the {\tt\\sh}, {\tt\\fl}, {\tt\\na}, {\tt\\dsh} and
{\tt\\dfl} symbols \ital{are not affected} by a change of the \hbox{\tt \\transpose}
register.
 \medskip
 But the composer/typesetter may ask \musictex\ to do that work. In this
case, he should code {\tt\\Sh}, {\tt\\Fl}, {\tt\\Na}, {\tt\\dSh} and
{\tt\\dFl} (or  {\tt\\bigSh}, {\tt\\bigFl}, {\tt\\bigNa}, {\tt\\bigdSh} and
{\tt\\bigdFl} or  {\tt\\smallSh}, {\tt\\smallFl}, {\tt\\smallNa},
{\tt\\smalldSh} and \hbox{\tt \\smalldFl}) instead of the usual lower case
accidental symbols. The symbol {\tt\\Sh} (resp. \hbox{\tt \\bigSh} and
\hbox{\tt \\smallSh}) means that the corresponding pitch has to be raised by
\ital{one half pitch} with respect to its normal value \ital{according to the
current signature}. Thus \hbox{\tt \\Sh b} means a $B\sharp$ if the signature
is zero or positive, and a $B\natural$ if it is negative. The same logic
applies for all accidentals having an upper case forelast letter.
 \medskip
 Obviously, the computation is done after taking account of the value of
the \hbox{\tt \\transpose} register.
 \medskip The compact codes \hbox{\tt \^{}}, \hbox{\tt \_}, \hbox{\tt =} are normally not
affected by transposition and signatures, but their behaviour can be changed by
saying \hbox{\tt \\relativeaccidentals} and reset by \hbox{\tt \\absoluteaccidentals} (the
default situation).
%\check
 \medskip Although \ital{relative accidental coding} is an easy and safe way
of coding \ital{transposable} scores, care should be exercised in getting rid
of the habit of saying \hbox{\tt \\na b} to rise the pitch of a $B$ when the tonality
is $F$ major (i.e. with \hbox{\tt \\signature$n$=-1} or
\hbox{\tt \\generalsignature\{-1\}}). An example of sophisticated transposition is
given in the score \hbox{\tt  souvenir.tex} (which \hbox{\tt \\input}s \hbox{\tt 
souvenix.tex}.\medskip
 Besides, the typical piano octave transposition \hbox{\sl 8 - - - - - } can
be obtained by coding~:

%\check
 {\tt\\octfin $p$ $n$}

\noindent which puts the 8 and dotted line symbols at the pitch $p$ (usually
\hbox{\tt  p} to \hbox{\tt  r}). The length is $n$\hbox{\tt \\noteskip}. This obviously fit for
short octaviation denotations. To transpose a whole line, use
\hbox{\tt \\octline}~$p$. Since \hbox{\tt \\octfin} terminates with a small hook down, to
indicate clearly where octaviation stops, you may also like to use
\hbox{\tt \\octsup} which behaves like \hbox{\tt \\octfin} without the final hook. All
this supposes you have an idea of the actual line breaking of your score in
that section, and this is admittedly difficult to handle when octave
transposition is supposed to long a large number of lines. In that latter
case, you can use the \hbox{\tt \\def\\everyline\{...\}} to insert whatever code
you like at each new line of score. This has been used to set octaviation in
the score of the \ital{Toccata in F} by Charles-Marie Widor\Footnote{A French
organist (1844-1937) and composer who was in charge of the organ of 
St-Sulpice in Paris, from 1864 to 1934.}~: at each bar (or virtual bar, namely
\hbox{\tt \\zbarre}), the {\\everystaff} procedure is updated to produce the
convenient code, in case of the line breaking happening before the next
definition.
%\check
 \enddoublecolumns
 \section{Ties and slurs} \begindoublecolumns
 They have been implemented in a way which may look
rather ugly, but we think it is the only way of implementing \ital{in one
pass} ties and slurs which run \ital{across glue}. \medskip Slurs and ties
must be initiated within the pair \hbox{\tt \\notes...\\notes} before the spacing
note is coded. They must be terminated also before the last note is coded.
 \medskip\tt\\itenu $np$
 \medskip\noindent\rm (\ital{ten} stands for the italian word
\ital{tenuto}) initiates an upper tie (convex) at pitch $p$. Just like beams,
ties have a reference number $n$, from 0 to 6 (or 9 if \hbox{\tt  musicadd} is
included. \hbox{\tt \\itenl $np$} initiates a lower tie (concave). \medskip The tie
of reference number $n$ is terminated by \hbox{\tt \\tten $n$}.
 \medskip Slurs are initiated with \hbox{\tt \\ilegu $np$} and \hbox{\tt \\ilegl $np$},
where \ital{leg} stands for the italian word \ital{legato}, and they are
terminated with \hbox{\tt \\tleg $n$}. Except that
slurs start before the note position and stop after, ties and slurs work the
same way with the same syntax. They also share the same registers so that slurs
nesting tied notes should have numbers $n$ distinct from each other.
 \enddoublecolumns
 \par\penalty -9000
\medskip\section{Bars and spacing}
 \begindoublecolumns
 Ordinary \ital{bars} a coded using the
macro \hbox{\tt \\barre} (this is a french word\Footnote{\hsize \Pagewidth\eightpoint
Whose advantage is that it
differs from \hbox{\tt \\bar} which is already defined in \TeX.}). This macro
provides an optional (discretionary) line or page break\Footnote{\hsize
\Pagewidth\eightpoint Unless it is
triggered according to bar counting when \hbox{\tt \\autolines} has been invoked.}.
It also provides some \ital{glue} in order to expand the text over an evenly
filled line. \medskip However, since the number of bars in a score line is
generally small, it may be convenient to allow \ital{glue} not only on each
sides of \ital{bars}.  This can be done using the macro \hbox{\tt \\temps} (the
french word for \ital{beat}).  This macro has two effects~: \item{1)} it
inserts some \ital{glue} but prevents line breaking\Footnote{\hsize
\Pagewidth\eightpoint This could
unpleasantly occur if you insert a space...}, \item{2)} if some ties or slurs
are pending it expands them across the glue by writing an \hbox{\tt \\hrule} which
overlaps the unfinished tie and makes it look prolungated.
 \medskip
 Whatever the care you exercize in adjusting the size of the \hbox{\tt \\elemskip},
you are still likely to find some broken ties (which indicate excessive glue
disassembling the gliding tie \hbox{\tt \\hrule}s) or some  unexpected (and
unwanted) line breaks or some Over[aw]full \hbox{\tt \\hbox}es. A useful means of
estimating the remaining space to be filled with glue consists in declaring
\hbox{\tt \\raggedlinestrue}~: after that, an \hbox{\tt \\hfil} will be inserted by
\musictex\ before each computed (when using \hbox{\tt \\autolines}) or forced line
break. Thus,  all the musical text will be packed on the left of the line and
you will clearly see the amount of remaining space. Then, it will be up to
you do decide changing some spacing parameters.
 
\medskip\noindent{\bf Important~: \sl do not use \hbox{\tt \\temps} when
\ital{beams} are pending, otherwise their spatial synchronization would fail.
 In other words, ties and slurs can jump over glue (because horizontal rules
may overlap and thus have some elasticity) but beams (as well as any oblique
lines) cannot.}
 \enddoublecolumns
\section{Line and page breaking}
 \begindoublecolumns
Bars provide a line breaking mechanism which is supposed to enable \TeX\
to break a full score into lines and pages, with an optimal distribution
of the text into lines and pages.  Unfortunately, this does not work
correctly for scores of more that approximately one page. The reason is
that \TeX\ must compile the entire contents of a paragraph, before it
tries to break it into lines and pages. Therefore, one cannot rely on \TeX\
to make that work which automatically results in the diagnostic {\tt TeX
capacity exceeded, memory...}.
%\check
\medskip
To circumvent this dramatically restrictive capacity\Footnote{\hsize
\Pagewidth\eightpoint \TeX\ has
been designed to type text, not music.} unless you use some
Big\TeX\Footnote{\hsize
\Pagewidth\eightpoint Whose drawback is that it is very slow on ordinary PCs.}
another mechanism must be invoked to break lines.
\medskip
The first one is the manual one~: you replace some of the \hbox{\tt \\barre}
macro calls by either \hbox{\tt \\alaligne} (equivalent to \hbox{\tt \\break}
within text (in fact it contains a \hbox{\tt \\break} plus some (many) other
things.  In the same way, you can code \hbox{\tt \\alapage} to force an \hbox{\tt \\eject}
with proper reinitialization of staffs, clefs and signatures.
\medskip
The second one is fit for scores whose bars are of regular length~:
after \hbox{\tt \\debutmorceau}, you code the following macro~:
\medskip\tt\\autolines $tml$\medskip\noindent\rm where $t$ is the number
of \ital{elementary spacings} (the lenghth of \hbox{\tt \\notes...\\enotes}) in
an average bar, $m$ is the number of bars you wish in a line and $l$ is
the number of lines you wish in a page\Footnote{\hsize
\Pagewidth\eightpoint After having coded nearly
one hundred of pages of music, I strongly recommend the use of
\hbox{\tt \\autolines} except when inserting short excerpts of less than one
line, such as in musicographic books.}.
\medskip
This sets some parameters, namely \hbox{\tt \\maxbarsinline} and
\hbox{\tt \\maxlinesinpage} which are simply used to count the bars, optionally
perform \hbox{\tt \\alaligne} or \hbox{\tt \\alapage} instead of the normal
\hbox{\tt \\barre}.  You may freely alter the values of these parameters, once
they have been established by \hbox{\tt \\autolines}. Moreover, you can still
force line breaking of page ejection using \hbox{\tt \\alaligne} or
\hbox{\tt \\alapage} without problem since these macroes actually reset the
bar counters appropriately.
\medskip
On the other hand, you may want to forbide line breaking at a bar, then you
replace \hbox{\tt \\barre} by \hbox{\tt \\xbarre}.
\medskip
Conversely, you may want to break a line \ital{not at a bar}\Footnote{\hsize
\Pagewidth\eightpoint For
example, you may prefer to turn the page at a place where the pianist has
one hand free.}. This is allowed by \hbox{\tt \\zbarre} (optional line break) or
forced by \hbox{\tt \\zalaligne} or \hbox{\tt \\zalapage}.
\medskip
The final heavy double bar of a piece is provided by \hbox{\tt \\finmorceau}.
If you just want to terminate the text with a simple bar, you say
\hbox{\tt \\suspmorceau}. If you want to terminate it without a bar, you code
\hbox{\tt \\zsuspmorceau}. Once you have stopped the score by any of these
means, you can restart it using \hbox{\tt \\reprmorceau}.
 \medskip If you want the next vertical bar to be a double bar, you have to
declare \hbox{\tt \\setdoublebar} before the \hbox{\tt \\barre} (or the
\hbox{\tt \\suspmorceau} or \hbox{\tt \\alaligne} or \hbox{\tt \\alapage}) to be marked with a
double thin bar.
 \enddoublecolumns
\section{Changing score attributes}
 \begindoublecolumns
 As seen before, you can change the
signature of the whole set of instruments by \hbox{\tt \\generalsignature $n$}
where $n>0$ means a number of sharps, $n<0$ means a number of flats.  Or, you
may prefer to change the signature of only one or two instruments by the
statement~:
 \medskip\tt\\signature$r$=$s$\medskip\rm\noindent %\check
 where $r$ is the roman numeral of the instrument considered, and
$s$ its specific signature. Since you may change simultaneously (with
respect to the score) but consecutively (with respect to your code) the
signatures of several instruments, this change takes place only when you
say \hbox{\tt \\changesignature} (within a bar) or \hbox{\tt \\changecontext} (after a
single vertical rule) or \hbox{\tt \\Changecontext} (after a double vertical
rule.
%\check
 In the same way, you may want to change the active clefs.
This is done by
\medskip\tt\\cleftoks$r$=\{\{$s1$\}\{$s2$\}\{$s3$\}\{$s4$\}\}\%
\medskip\rm\noindent where $r$ is the roman numeral of the instrument,
$s1$ specifies the clef of the lower staff, $s2$ the clef of the second staff,
etc. One must always give four values with the above syntax, otherwise\dots\
$s1=6$ means the \ital{bass} clef (\ital{clef de fa} in french),
$s1=0$ means the \ital{violin} clef (\ital{clef de sol} in french),
$s1=1$ through $s1=5$ mean the \ital{alto} clef set on first (lower)
through fifth (upper line of the staff). As seen above in the case of
 signatures,
several clefs may be changed at the same time~; thus all the clef changes
become operational only when the macro \hbox{\tt \\changeclefs} is coded.
Normal usage consists in issuing this command before the bar, not after
(this helps the music player when the change happens across
a line break).
%\check
\medskip \ital{Meter} changes are implemented the same way~:
\medskip\tt\\metertoks$r$=\{\{$m1$\}\{$m2$\}\{$m3$\}\{$m4$\}\}\%
\medskip\rm\noindent
 where $r$ is the roman numeral of the instrument,
$m1$ specifies the meter of the lower staff, $m2$ the meter of the second staff,
etc. One must always give four values with the above syntax, otherwise\dots\
Since meter changes are meaningful only across bars, they are actually
taken in account with \hbox{\tt \\changecontext} or \hbox{\tt \\Changecontext} or \hbox{\tt 
\\alaligne}
or \hbox{\tt \\alapage}.
 \enddoublecolumns
\section{Repeats}
%\check
 \begindoublecolumns
 To insert a \ital{repeat bar} you can use several sets of procedures. The
simplest consists in using  the commands \hbox{\tt \\leftrepeatsymbol}, 
\hbox{\tt \\rightrepeatsymbol} and  \hbox{\tt \\leftrightrepeatsymbol} -- coded outside
the \hbox{\tt \\notes...\\enotes} pairs -- which will simply insert these colon
adorned double bars at the requested place. For example~:

{\parindent 0pt
 \generalsignature{0}\savesignature
 \def\nbinstruments{1}\nbporteesi=1\cleftoksi={{0}{0}{0}{0}}\relax
 \debutextrait\normal
 \notes\hu g\enotes
 \leftrepeatsymbol
 \notes\hu h\enotes
 \leftrightrepeatsymbol
 \notes\hu i\enotes
 \rightrepeatsymbol
 \Notes\wh j\enotes
 \finextrait}

 \noindent has been coded as~:
%\check
 \medskip
 {\tt\obeylines\parindent 0pt
 \\notes\\hu g\\enotes
 \\leftrepeatsymbol
 \\notes\\hu h\\enotes
 \\leftrightrepeatsymbol
 \\notes\\hu i\\enotes
 \\rightrepeatsymbol
 \\Notes\\wh j\\enotes
 \\suspmorceau}
%\check
\medskip
 However, the previous way of coding does not provide for line breaking
at repeat bars, nor does it advance the bar numbering. In fact, this way of
coding if only fit for repeats occuring in the middle of a bar.
 \medskip A second way of coding consists in saying {\tt\\setleftrepeat},
\hbox{\tt \\setrightrepeat} or \hbox{\tt \\setleftrightrepeat} before a bar
(\hbox{\tt \\barre}), \hbox{\tt \\suspmorceau} or \hbox{\tt \\changecontext}). In this case,
the next next vertical bar will be replaced with the selected repeat bar.
This meets the traditional music typesetting conventions in the only case of
the \ital{right repeat} but, unfortunately, left and left/right repeats use
to behave in a different manner when in the middle of a line and at a line
break.
 \medskip The third coding, namely the correct coding -- i.e. transforming in
the correct manner when occuring at a line break -- is obtained by
substituting the \hbox{\tt \\barre} command with \hbox{\tt \\leftrepeat},
\hbox{\tt \\rightrepeat} and \hbox{\tt \\leftrightrepeat}.
%\check
 \medskip
 Now, if you want to force a new line at a repeat, you should code
respectively~:
 \medskip{\tt  \\setrightrepeat\\alaligne}

 {\tt \\setrightrepeat\\suspmorceau}

 {\tt\\alaligne\\leftrepeatsymbol}

 {\tt\\reprmorceau\\leftrepeatsymbol}
 
 {\tt\\debutmorceau\\leftrepeatsymbol}

 \medskip\noindent or the combination of two of these in the case of a
left/right repeat. 
  \enddoublecolumns
%\check
 \section{Miscellaneous}
 \begindoublecolumns
Special macros are provided to help the composer to set any \TeX\
text on the staffs. The macro
\medskip\tt\\charnote $p$\{ {\rm text} \}\medskip\rm\noindent
sets the given text with its base line at pitch $p$ of the current staff
(this means it must be coded inside \hbox{\tt \\notes...\\enotes}.
Whatever the length of the text, the spacing is \hbox{\tt \\noteskip}.
If you do not want it to cause spacing, you code \hbox{\tt \\zcharnote}.
If you want the possible spilling text to expand on the left rather than on the
right, then you can use \hbox{\tt \\lcharnote}.
%
\medskip
To place some text at the mid-position between the two staffs of
a keyboard instrument, you may code~:
\medskip\tt\\midtwotext\{ {\rm text} \}\ \ \% \rm (spacing)
\medskip\tt\\zmidtwotext\{ {\rm text} \}\ \ \% \rm (non spacing)
\medskip\rm\noindent being however
careful, a) to put it inside \hbox{\tt \\notes...\\enotes}, b) to code it in the
text of the lower staff.
\medskip
A text to be put above the current staff is introduced by
\hbox{\tt \\uptext\{...\}}.  This may however cause some collision with bar
numbering or notes above the staff~; it is then wise to use
\hbox{\tt \\Uptext\{...\}} which puts the text two pitches higher (recommended
to post the tempo).
\medskip Metronomic indication deserves a special macro. The mention~:
\par\centerline{\computewidths\metron{\hup}{60}}\smallskip\noindent
is coded by \hbox{\tt  \\metron\{\\hup\}\{60\}}
(normally embedded in \hbox{\tt \\Uptext} which is in turn embedded
within \hbox{\tt \\notes...\\enotes}).
\medskip
The macro \hbox{\tt \\zcharnote} is fit for coding special notations like
accents above or below the notes. It behaves like \hbox{\tt \\charnote} but
causes no spacing.
 \medskip
%\check
\ital{Arpeggios} (i.e. \raise -4pt\hbox{\musicxx\char92}\ ) can be coded with
 the macro
\medskip\tt\\arpeggio $pm$\medskip\rm\noindent where $p$ is the pitch of
the base of the arpeggio symbol and $m$ is its multiplicity (one period is
equal to one space between staff lines, i.e. 5 points).  This macro causes
a space of one note head width.  If should be issued before the concerned
chords.  Its variant \hbox{\tt \\larpeggio} sets the arpeggio symbol slightly
more on the left, in order to avoid collision with accidentals in front of
the chords.
\medskip
\ital{Trills} can be coded in several ways. \hbox{\tt \\trille~$l$} (where $l$ is a
 \TeX\ dimension) yields
\hbox{\trille{1cm}} while \hbox{\tt \\Trille~$l$} (where $l$ is a \TeX\
dimension) yields \hbox{\Trille{2cm}}.  To put these patterns at a given
pitch, one may use \hbox{\tt \\xtrille~$pl$} or \hbox{\tt \\xTrille~$pl$}.  On the
other hand \hbox{\tt \\ntrille~$pn$} is equivalent to
\hbox{\tt \\xtrille~$p$\{$n$\\noteskip\}} and \hbox{\tt \\nTrille~$pn$} is equivalent
to \hbox{\tt \\xTrille~$p$\{$n$\\noteskip\}}
 \medskip Other \ital{ornaments} are available~:
 \item{--} {\tt\\mordant $p$} for \hbox to 1.5em{\mordant 0\hss},
 \item{--} {\tt\\pince $p$} for \hbox to 1.5em{\pince 0\hss},
 \item{--} {\tt\\Pince $p$} for \hbox to 1.5em{\Pince 0\hss},
 \item{--} {\tt\\upz $p$} (upper \ital{pizzicato}) to put a dot above a note
head at pitch $p$,
 \item{--} {\tt\\lpz $p$} (lower \ital{pizzicato}) to put a dot below a note
head at pitch $p$,
 \item{--} {\tt\\usf $p$} (upper \ital{sforzando}) to put a $>$ accent above
a note head at pitch $p$,
 \item{--} {\tt\\lsf $p$} (lower \ital{pizzicato}) to put a $>$ accent below
a note head at pitch $p$,
 \item{--} {\tt\\ust $p$} (upper \ital{staccato} or \ital{portato}) to put a
hyphen above a note head at pitch $p$,
 \item{--} {\tt\\lst $p$} (lower \ital{staccato} or \ital{portato}) to put a
hyphen below a note head at pitch $p$,
 \item{--} {\tt\\Upz $p$} (upper strong \ital{pizzicato}) to put an
apostrophe above a note head at pitch $p$,
 \item{--} {\tt\\Lpz $p$} (lower strong \ital{pizzicato}) to put a reversed
apostrophe below a note head at pitch $p$.
 \medskip You may also want to write some parts of your score in 20pt
staff size and in 16pt staff size. This cannot be done -- at least presently --
in the same system, but only for distinct parts of pieces. Changing the size
is done by saying~:
\medskip\tt\\musicsize=16\\computespecifics\quad \rm or

\tt\\musicsize=20\\computespecifics\medskip\rm\noindent respectively.
 \medskip
 The procedure named {\tt\\everystaff} is executed each time a new system is typed.
 It is normally void, but it can be defined (simply by
\hbox{\tt \\def\\everystaff\{...\}}) to tell \musictex\ to post anything reasonable
at the beginning of each system.
 \medskip
 The procedure named \hbox{\tt \\atnextline}, normally void, is executed at the next
computed (through \hbox{\tt \\autolines}) or forced line break (using \hbox{\tt \\alaligne} or
\hbox{\tt \\alapage}). More precisely, it is executed after the break and before
the next system is typed. Thus it is fit for posting new definitions of layout parameters,
when no system is pending\Footnote{Its logic is similar to plain \TeX's \hbox{\tt \\vadjust}
command.}. 
 \enddoublecolumns
 \section{Layout parameters}
 \begindoublecolumns
 Most layout parameters are set by \musictex\ to reasonable default values.
However, sophisticated scores\Footnote{To our knowledge, the most complicated
scores are those written for the piano, during the romantic and post-romantic
periods.} may need more place below the lowest staff, between staves, etc.
 \medskip
\item{--}{\tt\\interligne} : vertical interval between lines

\item{--}{\tt\\nullthick} : reserved height above base line for zero staff lines (text
of songs)

\item{--}{\tt\\bottommargin} : margin below the first staff of the lowest instrument.
If not assigned a non zero dimension, it is set to \hbox{\tt \\bottomfacteur\\Interligne}
at the next system.

\item{--}{\tt\\topmargin} : margin above the upper staff ot the upper instrument

\item{--}{\tt\\internote} : the half of {\tt\\Interligne}

\item{--}{\tt\\interbeam} : vettical distance between beams

 \item{--}{\tt\\Interligne} : vertical distance between the base of staff
lines (\hbox{\tt \\interligne} is the size of the blank space between lines. The
difference is the line thickness \hbox{\tt \\lthick}.

 \item{--}{\tt\\interportee} : the distance between the top of one staff and
the bottom of the next one. If not assigned a non zero value, it is set to
\hbox{\tt \\interfacteur\\Interligne} at the next system.
 \item{--}{\tt\\interinstrument} : the additional vertical distance between
two different instruments. This means that the distance between the upper
staff of the previous instrument and the lowest line of the current
instrument is equal to \hbox{\tt \\interportee+\\interinstrum}. This vaoue is
normally zero, but it helps putting additional space between distinct
instruments for the sake of clarity. This is a general dimension which holds
for each of the vetical spaces between instruments, except the upper one, in
which case this interval is irrelevant. However, this parameter can be overriden
for the space above a specific instrument. For example (see the example \hbox{\tt 
angescao.tex}) one can state~:
\medskip
\centerline{\tt\\def\\interinstrumenti\{5pt\}}
\medskip
\noindent to force an additional spacing of 5 points above instrument $i$,
whatever the value of \hbox{\tt \\interinstrument}.

\item{--}{\tt\\systemheight} : the distance from the bottom of the lowest staff to the
top of the highest staff of the upper instrument. This is the height of the
vertical bars (single, double, repeats, etc.).
 \medskip
 In addition, when handling notes of a given staff of a given instrument, the
following dimensions are available (note these are not true registers, but
\ital{equivalenced symbols} through a \hbox{\tt \\def})~:
 \item{--}\hbox{\tt \\altitude} : the altitude of the lowest line of the lowest
staff of the current instrument.
 \item{--}\hbox{\tt \\altportee} : the altitude of the lowest line of the current
staff.

\medskip
 Most of these values can be changed, but only between the end of the
previous system and the beginning of the next one. This can be inserted
between a \hbox{\tt \\suspmorceau} and a \hbox{\tt \\reprmorceau}, but it is wiser to
say, for example~: \enddoublecolumns\leftrule

\centerline {\tt\\def\\atnextline\{\\global\\bottommargin=5\\Interligne\}}
\medskip\rightrule\begindoublecolumns
When doing so, the \musictex\ user should be aware that this could disturb
pending \ital{slurs} or \ital{ties}, since the altitude of these is stored in an
absolute way, starting from the baseline of the systems. Therefore, changing the
\hbox{\tt \\bottommargin} dimension can also be made by means of \hbox{\tt \\advancebottom\{$<dimension>$\}}
which updates all pending slur and tie altitudes by the given dimension. This
has been used in \hbox{\tt  pacifiqn} and \hbox{\tt  pacifiqb}.
\enddoublecolumns
 \section{Musicla\TeX}
  \begindoublecolumns
  As said before, the amount of memory used by \musictex\ makes it hardly
compatible with La\TeX. However, Nicolas Brouard succeded in building a
\hbox{\tt \\musictex.sty} which is now included in the distribution. This is not
recommended to make separate music scores. Its purpose is rather to provide
a means of inserting short musical excerpts in books or articles witten with latex.
Then, the \hbox{\tt \\documentstyle} command should include \hbox{\tt  musictex} in the options.
 \medskip
 {\tt\\musictex.sty} is the simple concatenation of the following files~:

 \vbox{\item{--} {\tt premusic.tex}
 \item{--} {\tt musicnft.tex}
 \item{--} {\tt musictex.tex}
 \item{--} {\tt musicvbm.tex}
 \item{--} {\tt posmusic.tex}\par}
 \medskip
 In the case of a La\TeX\ user wanting to use accidental transposition
facilities, he should copy \hbox{\tt  musictrp.tex} into \hbox{\tt  musictrp.sty} and
include ``\hbox{\tt  musictrp}'' in the options of the \hbox{\tt \\documentstyle}
command. The \hbox{\tt \\posmusic.tex} file merely overrides the \hbox{\tt \\catcodes}
of the {\tt\|} and {\tt\&} symbols which are modified by \musictex. To have
access to these symbols when coding music, on should then enclose the scores
or excerpts within \hbox{\tt \\begin\{music\}} and \hbox{\tt \\end\{music\}}. But there is
also another possibility, i.e.\ to say \hbox{\tt \\nextinstrument} instead of \hbox{\tt \&}
and \hbox{\tt \\nextstaff} instead of {\tt\|}.And in case of {\tt TeX capacity exceeded...},
use a ``bigLa\TeX'' (after checking there is no visible error in the
source code).
\enddoublecolumns
 \section{Implementation and restrictions}
 \begindoublecolumns The macroinstruction file \musictex\ contains
approximately 2500 lines of code, that is 80~000 bytes approximately. This
requires your score to be compiled by the most extended versions of \TeX\
(65~000 words of working memory). It is therefore wise to set \hbox{\tt
\\tracingsstats} to 2 in order to have an information about the memory used
in each page. In desperate situations, we recommend using the ``big\TeX''
processors which, unfortunately, perform a great deal of disk input/outputs
(on PCs) which make them awfully slow. \medskip In particular, the number of
registers it uses makes it doubtfully compatible with La\TeX. \medskip Other
precautions are necessary~: beware of end-of-line spaces~; they corrupt
layout and may cause unwanted line breakings after which music symbols seem
to \ital{float} in the air without staffs.  To avoid that, it is recommended
to use \hbox{\tt \\relax} rather than {\tt\%} at the end of source lines,
since it allows indentation at the following source line. \enddoublecolumns

 \bye

