Ok, let's make this a little bit like a tutorial, just because I'm
in the mood to.
First of all: as I understand it you're trying to typeset a whole piece and not a series of extracts. For this case
\startextract
and
\endextract
are the wrong choice. The whole piece should be placed inside
\startpiece
and
\endpiece
(or
\stoppiece
or the uppercase variants
\Endpiece
or
\Stoppiece
for the double bar that terminates a piece). (Using more that one of the ending commands will double the bar lines which is what causes your problem at the end of the piece.) The breaking into lines should be left to TeX or more precisely the program
musixflx
. Most of your problems will be solved following this rationale.
Creating a piece normally has the following routine. Suppose your main file is called
mycoolmusic.tex
. Now, after typing the piece you run
pdflatex mycoolmusic
as you would normally do. Additional to the usual
mycoolmusic.aux
and
mycoolmusic.log
files a file named
mycoolmusic.mx1
is created. This file serves as input for
musixflx
. So you now
have to run
musixflx mycoolmusic
. This will create an additional file named
mycoolmusic.mx2
. This serves as help file for the next latex run to get the right alignment and spacing. So you need to run
pdflatex mycoolmusic
another time.
If you now see that you have to change details of the piece you have go through this whole routine again. In order to get it right you should delete both
mycoolmusic.mx1
and
mycoolmusic.mx2
before doing so or you might observe strange displacements and the like.
Now, just like with LaTeX and normal text one sometimes has to help
musixflx
to get the line breaking right. Every
\bar
(
\barre
is an alias) is considered as potential break point. If you want to prohibit this for a certain
\bar
you can use
\xbar
instead. You can also insert a potential break point without creating a bar line with
\zbar
. If you want to force a line break you can use
\alaligne
(as equivalent to
\bar
) or
\zalaligne
(as equivalent to
\zbar
).
The next problem: I guess you want to insert some tempo information above the first bar. As you have noticed
\qu{<pitch>}
won't help here. Raising it with a box will at best lead to strange effects. Specifically
\qu{p}
creates a
quarter note with a stem pointing
up at pitch
p. Pitch p corresponds to b'' which is exactly what you're getting. I'll present a better solution later using a combination of
\metron
,
\Uptext
and
\qu
. A little more on
\qu{<pitch>}
first. There are to siblings,
\ql{<pitch>}
which creates a
quarter note with a
lower stem and
\qa{<pitch>}
which creates a quarter note with
automatic stem placement.
The
\qu
in
\metron
below unfortunately is not hidden from
musixlyr
. In order to get it ignored we have to remove the
%
I suggested in my last posting. So at the beginning we'll place something like
Code: Select all
\notes\Uptext{\metron{\qu}{100}}\en
Hiding the system bar number at the beginning can be done via a conditional. In the following code I test if the number is
1
. It will only be printed if otherwise:
Code: Select all
\def\thebarno{\ifnum\barno=1\relax\else\the\barno\fi}
\def\writebarno{\llap{\thebarno\barnoadd}}
Now, - at last - let's put everything together (to be compiled twice with one run of
musixflx
in between):
Code: Select all
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{musixtex}
\usepackage[left=1in,right=1in]{geometry}
\input{musixlyr}
\begin{document}
\begin{music}
% general settings:
\setlength\parindent{0pt}
\generalsignature{2}
% more vertical space above of staffs, default is 3\Interligne:
\stafftopmarg=5\Interligne
\smallmusicsize
% hide bar number if bar number is 1, use systemnumbers:
\def\thebarno{\ifnum\barno=1\relax\else\the\barno\fi}
\def\writebarno{\llap{\thebarno\barnoadd}}
\def\raisebarno{2\internote}
\def\shiftbarno{1.3\Interligne}
\systemnumbers
% lyrics:
\setlyrics{text}{
Ra-dosť krás-na isk-ra bo-hov E-ly-zej-ská dcé-ra ty, o-má-me-ní
žia-rou oh-ňov poď-me ktvo-jej svä-to-sti. Tvo-je ča-ro zno-vu_ zvia-že
to čo_ mó-da de-lí dnes všet – kým ľu-ďom brat-mi ká-že stať sa tvo-jich
krí-del let tvo-je ča-ro zno-vu_ zvia-že to čo_ mó-da
de-lí dnes všet – kým ľu-ďom brat-mi ká-že stať sa tvo-jich krí-del let.
}
\assignlyrics1{text}
% the actual piece:
\startpiece
\notes\Uptext{\metron{\qu}{100}}\en
\NOTes\qu{ffgh}\enotes
\bar
\NOTes\qu{hgfe}\enotes
\bar
\NOtes\qu{ddef}\enotes
\bar
\NOTes\qup f\cu e\hu e\enotes
\bar
\NOtes\qu{ffgh}\enotes
\bar
\NOtes\qu{hgfe}\enotes
\bar
\NOtes\qu{ddef}\enotes
\bar
\NOTes\qup e\cu d\hu d\enotes
% get a double bar line to indicate that a new part starts
% and force line break:
\setdoublebar\alaligne
\NOtes\uptext{REF.:}\qu{e}\enotes
\NOtes\qu{efd}\enotes
\bar
\NOtes\qu{e}\enotes
\Notes\Dqbu fg\en
\NOtes\qu{fd}\enotes
\bar
\NOtes\qu{e}\enotes
\Notes\Dqbu fg\en
\NOtes\qu{fe}\enotes
\bar
\NOTes\qu{dea}\enotes
\NOTes\isslurd0e\qu f\enotes
\bar
\NOTes\tsslur0e\qu f\enotes
\NOTes\qu {fgh}\enotes
\bar
\NOtes\qu{hgfe}\enotes
\bar
\NOtes\qu{ddef}\enotes
\bar
\NOTes\qup e\cu d\hu d\enotes
\setdoublebar\alaligne
\NOtes\uptext{REF.:}\qu{e}\enotes
\NOtes\qu{efd}\enotes
\bar
\NOtes\qu{e}\enotes
\Notes\Dqbu fg\en
\NOtes\qu{fd}\enotes
\bar
\NOtes\qu{e}\enotes
\Notes\Dqbu fg\en
\NOtes\qu{fe}\enotes
\bar
\NOTes\qu{dea}\enotes
\NOTes\isslurd0e\qu f\enotes
\bar
\NOTes\tsslur0e\qu f\enotes
\NOTes\qu {fgh}\enotes
\bar
\NOtes\qu{hgfe}\enotes
\bar
\NOtes\qu{ddef}\enotes
\bar
\NOTes\qup e\cu d\hu d\en
\Endpiece
\end{music}
\end{document}

- musixtexpiece.png (32.87 KiB) Viewed 15607 times
Last but not least: it really is worth reading through the whole
documentation of musixtex. Admittedly: it is rather long. Also, it is in English which is not perfect for us non-native speakers. And third, since musixtex is a generic package the syntax often is more plainTeX- than LaTeX-like. Nevertheless it pays off!
Regards