# Problem with musixtex's mezzo piano dynamic

I am trying to use dynamics marks on my text by using the musixtex package. It works well except for the mezzo piano mark (\mp), which is not recognized. According to the manual (section 2.17.5) my code is correct (http://icking-music-archive.org/software/musixtex/musixdoc.pdf). Can someone spot what is wrong here?

\documentclass{article}
\usepackage{musixtex}
\begin{document}
\pppp, \ppp, \pp, \p, \mf, \f, \ff, \fff, \ffff, \sF % all these work fine
\mp % but this doesn't
\end{document}

-

\mp is actually a command defined by \LaTeX itself and it can only be used in maths mode (where it yields ∓), that's why you get an error. To overwrite the command, just add \let\mp\mezzopiano after \usepackage{musixtex}.

Be aware, that in doing so you overwrite a LaTeX command, that other packages may or may not heavily rely on - or at least expect to work in a certain way.

You could also just use the longer name \mezzopiano if you do not want to overwrite \mp.

As \mp is a LaTeX macro, the package is wary of overwriting it. While all the other commands are defined as you would expect, e.g. mezzo-forte: \def\mf{{\ppff m\p@kern\f@kern f}} in musixtex.tex, mezzo-piano is defined as: \def\mp@{{\ppff m\p@kern p}} (note the @); just after that, the longer command \mezzopiano is defined: \let\mezzopiano\mp@.

Similarly, the macro for sforzando is not called \sf but \sF to avoid clashes with important LaTeX macros (\sf switches to sans serif font). Following that example, you could use \let\mP\mezzopiano instead of \let\mp\mezzopiano, so you do not overwrite standard commands.

\documentclass{article}
\usepackage{musixtex}
\let\mp\mezzopiano
\begin{document}
\pppp, \ppp, \pp, \p, \mf, \f, \ff, \fff, \ffff, \sF
\mp
\end{document}

-
Could you explain what the extra @ does in the definition of \mf, possibly? – Peter LeFanu Lumsdaine Sep 4 '13 at 16:00
The @ makes sure \mp@ is not \mp, so the latter is not automatically overwritten - as \def would normally do. Macros that are (normally) not supposed to be accessed by the user on a document level often contain an @ read more about that here or here. That is why the package provides the longer macro \mezzopiano. – moewe Sep 4 '13 at 16:03
Ah — so it’s in a \makeatletter section, and the @ is part of the name of the command. Got it, thanks! – Peter LeFanu Lumsdaine Sep 4 '13 at 16:16
Yep somewhat, it is within a .sty file and thus automatically in a \makeatletter section. – moewe Sep 4 '13 at 16:19