# MusixTex apparent bug in wh

I have just started trying to write music with musixtex. I am currently throwing together an example, that shows a basic way to do everything I might eventually need.

But now I've run into a problem. The following code is a minified example:

\documentclass[15pt, oneside, a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{musixtex}

\begin{document}
\begin{music}

\instrumentnumber{2}

\setstaffs1{2}

\startpiece
\notes \qa{a} | \wh{j} | \csong{asd} \wh{c} \enotes
\endpiece
\end{music}
\end{document}


When I compile this, I get an error in line 18: "Staff number (3) out of specified range(2)!"

The pdf is compiled anyway and everything is correct, except that the \ws{c} is missing. If I change that to a \qa{c}, \ha{c}, \ca{c} or any other length it compiles fine and shows correctly. If I change \setstaffs1{2} to \setstaffs1{3} it compiles as expected as well (\wh{c} is placed in the second row from the top). If I change \setstaffs1{2} to \setstaffs2{3} on the other hand, it does not work.

I am assuming this is a bug in musixtex; \wh seems to be checking the staff number of only the first instrument, not of all instruments put together.

Is there a mistake on my part? If not: how can I work around this?

You need to tell it that you are giving it notes for the second instrument. Until you do so, it assumes you are still on notes for the first. See page 18 of the manual for information about different ways to do this. Here is one:

\documentclass[oneside, a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{musixtex}

\begin{document}
\begin{music}

\instrumentnumber{2}

\setstaffs2{3}
\startpiece
\notes & \qa{a} | \wh{j} | \csong{asd} \wh{c} \enotes
\endpiece
\end{music}
\end{document}


By the way, there is no point in passing article the 15pt option as it does not exist. The available point sizes are 10pt, 11pt and 12pt. [Unless this is intended as a global option which musixtex will use?]

• Thanks for this! The behavior is still inconsistent between \wh and the other tone lengths, which isn't optimal, but my problem is solved. About the 15p; I honestly do not know. That is a line I've copy-pasted into all of my documents and so far it has never been necessary to look up what the parameters actually do... – Wutz Oct 27 '14 at 18:05
• @Wutz It does nothing. You may get a warning in the log or console. I'm not sure whether it will default to 10pt fonts in that case or 12pt but it would be better to pick the size you want (10, 11 or 12). If you really needed 15pt, you would need to use a class/package supporting extended sizes. – cfr Oct 27 '14 at 19:24