2

I want to include a MusiXTeX script into a normal LaTeX document, in order to be able to add another piece of music to the same output pdf document (which will be one DIN A4 page).

When working only with MusiXTeX, the scripts won't contain a \documentclass (e.g. {scrartcl}) or a \begin{document}, whereas some commands from MusiXTeX seem to be unnecessary when loading MusiXTeX into LaTeX as a package (\usepackage{musixtex}) (I think this holds true for the \input commands) or even error causing (such as \nopagenumbers or \bye).

Let's take the following PMX preprocessed MusiXTeX code as an example:

%%%%%%%%%%%%%%%%%
%
% Saabund.tex
%
%%%%%%%%%%%%%%%%
\input musixtex
\input pmx
\setmaxslurs{24}\setmaxinstruments{24}%
\normalmusicsize%
\nopagenumbers
\tracingstats=2\relax
\hsize=524pt
\vsize740pt
\def\nbinstruments{1}
\setstaffs11
\setclef10
\setname1{ }
\generalsignature{-1}%
\generalmeter\meterC%
\parindent 0pt
\elemskip1pt\afterruleskip1.000pt\beforeruleskip0pt\relax
\stafftopmarg0pt\staffbotmarg5\Interligne\interstaff{10}\relax
\nostartrule
\readmod{Saabund}
\nobarnumbers%
\input musixlyr %
\startmuflex\startpiece\addspace\afterruleskip%
\global\parskip 0pt plus 12\Interligne minus 99\Interligne%
\def\upstrut{\znotes&\zcharnote{\upamt}{~}\en}%
\znotes\zcharnote{16}{\titles{2.0}{}{0}%
{Saabund on j\"{a}lle \"{o}\"{o}}{2.0}{}{0}}\en%
% Bar count 1
\starteq%
\pnotes{4.00}%
\pmxlyr{Saa-bund on j\"{a}-lle \"{o}\"{o}, mis mei-le t\"{a}h-te-de vaik-set ra-hu toob.}\spread{-6}%
\hu f\en%
\pnotes{2.83}\qu f\qu f\en%
% Bar count 2
\xbar
\pnotes{3.46}\qup g\en%
\pnotes{2.00}\cu{'a}\en%
\pnotes{2.83}\pcaesura00\qu f\qu f\en%
% Bar count 3
\xbar
\pnotes{3.46}\qlp{'b}\en%
\pnotes{2.00}\cl{'c}\en%
\pnotes{2.83}\qu{'a}\en%
\pnotes{2.00}\ibu1f2\qb1f\tbu1\qb1{'a}\en%
% Bar count 4
\alaligne
\pnotes{2.00}\spread{-6}\ibu1g{-1}\qb1{'a}\qb1{`g}\qb1f\tbu1\qb1e\en%
\pnotes{4.00}\pcaesura00\hu f\en%
% Bar count 5
\xbar
\pnotes{4.00}%
\pmxlyr{L\~{o}pp-e-nud p\"{a}ev-a-t\"{o}\"{o} ja puh-ke-aeg ta-sa v\"{a}rs-keid j\~{o}u-de koob.}%
\hu{'a}\en%
\pnotes{2.83}\qu{'a}\qu a\en%
% Bar count 6
\xbar
\pnotes{3.46}\qlp{'b}\en%
\pnotes{2.00}\cl{'c}\en%
\pnotes{2.83}\pcaesura00\qu{'a}\qu a\en%
% Bar count 7
\alaligne
\endeq%
\pnotes{3.46}\spread{-6}\qup g\en%
\pnotes{2.00}\cu{'a}\en%
\pnotes{2.83}\pcaesura00\qu f\en%
\pnotes{2.00}\ibl1{'a}2\qb1a\tbl1\qb1c\en%
% Bar count 8
\xbar
\pnotes{2.00}\ibu1{'b}{-1}\qb1c\qb1b\qb1a\tbu1\qb1{`g}\en%
\pnotes{4.00}\pcaesura00\hu{'a}\en%
% Bar count 9
\xbar
\pnotes{4.00}%
\pmxlyr{Kuu, s\"{a}-rav kuu, h\~{o}-be-da-ne kuu uj-ub o-ma val-gus-voos.}%
\hl{'c}\en%
\pnotes{2.83}\qu{'a}\qu{`f}\en%
% Bar count 10
\alaligne
\pnotes{4.00}\spread{-6}\pcaesura00\hu c\en%
\pnotes{2.00}\ibu1{'a}0\qb1{`f}\qb1{'c}\qb1a\tbu1\qb1{`f}\en%
% Bar count 11
\xbar
\pnotes{4.00}\pcaesura00\hu c\en%
\pnotes{2.00}\ibu1e{-1}\qb1f\qb1e\qb1d\tbu1\qb1c\en%
% Bar count 12
\xbar
\pnotes{2.83}\qu b\qu c\en%
\pnotes{4.00}\hu f\en%
\Endpiece
\vfill\eject\endmuflex
\bye

Even bigger problems arise after editing the script as suggested above (compare end of post). At first all the notes are stacked in about no space, then trying to run musixflx on it, as suggested in this question, throws the error message: "File not found: jobname.mx1". So I am trying to run etex on the script, which on its part can't read the \documentclass and stuff...

How to break this vicious circle?


\documentclass{scrartcl}
\usepackage[utf8]{inputenc} % for characters in lyrics
\usepackage{musixtex}

\input musixtex
\input pmx
\setmaxslurs{24}\setmaxinstruments{24}%
\normalmusicsize%
%\nopagenumbers
\begin{document}
\tracingstats=2\relax
\hsize=524pt
\vsize740pt
\def\nbinstruments{1}
\setstaffs11
\setclef10
\setname1{ }
\generalsignature{-1}%
\generalmeter\meterC%
\parindent 0pt
\elemskip1pt\afterruleskip1.000pt\beforeruleskip0pt\relax
\stafftopmarg0pt\staffbotmarg5\Interligne\interstaff{10}\relax
\nostartrule
\readmod{Saabund}
\nobarnumbers%
\input musixlyr %
\startmuflex\startpiece\addspace\afterruleskip%
\global\parskip 0pt plus 12\Interligne minus 99\Interligne%
\def\upstrut{\znotes&\zcharnote{\upamt}{~}\en}%
\znotes\zcharnote{16}{\titles{2.0}{}{0}%
{Saabund on j\"{a}lle \"{o}\"{o}}{2.0}{}{0}}\en%
% Bar count 1
\starteq%
\pnotes{4.00}%
\pmxlyr{Saa-bund on j\"{a}-lle \"{o}\"{o}, mis mei-le t\"{a}h-te-de vaik-set ra-hu toob.}\spread{-6}%
\hu f\en%
\pnotes{2.83}\qu f\qu f\en%
% Bar count 2
\xbar
\pnotes{3.46}\qup g\en%
\pnotes{2.00}\cu{'a}\en%
\pnotes{2.83}\pcaesura00\qu f\qu f\en%
% Bar count 3
\xbar
\pnotes{3.46}\qlp{'b}\en%
\pnotes{2.00}\cl{'c}\en%
\pnotes{2.83}\qu{'a}\en%
\pnotes{2.00}\ibu1f2\qb1f\tbu1\qb1{'a}\en%
% Bar count 4
\alaligne
\pnotes{2.00}\spread{-6}\ibu1g{-1}\qb1{'a}\qb1{`g}\qb1f\tbu1\qb1e\en%
\pnotes{4.00}\pcaesura00\hu f\en%
% Bar count 5
\xbar
\pnotes{4.00}%
\pmxlyr{L\~{o}pp-e-nud p\"{a}ev-a-t\"{o}\"{o} ja puh-ke-aeg ta-sa v\"{a}rs-keid j\~{o}u-de koob.}%
\hu{'a}\en%
\pnotes{2.83}\qu{'a}\qu a\en%
% Bar count 6
\xbar
\pnotes{3.46}\qlp{'b}\en%
\pnotes{2.00}\cl{'c}\en%
\pnotes{2.83}\pcaesura00\qu{'a}\qu a\en%
% Bar count 7
\alaligne
\endeq%
\pnotes{3.46}\spread{-6}\qup g\en%
\pnotes{2.00}\cu{'a}\en%
\pnotes{2.83}\pcaesura00\qu f\en%
\pnotes{2.00}\ibl1{'a}2\qb1a\tbl1\qb1c\en%
% Bar count 8
\xbar
\pnotes{2.00}\ibu1{'b}{-1}\qb1c\qb1b\qb1a\tbu1\qb1{`g}\en%
\pnotes{4.00}\pcaesura00\hu{'a}\en%
% Bar count 9
\xbar
\pnotes{4.00}%
\pmxlyr{Kuu, s\"{a}-rav kuu, h\~{o}-be-da-ne kuu uj-ub o-ma val-gus-voos.}%
\hl{'c}\en%
\pnotes{2.83}\qu{'a}\qu{`f}\en%
% Bar count 10
\alaligne
\pnotes{4.00}\spread{-6}\pcaesura00\hu c\en%
\pnotes{2.00}\ibu1{'a}0\qb1{`f}\qb1{'c}\qb1a\tbu1\qb1{`f}\en%
% Bar count 11
\xbar
\pnotes{4.00}\pcaesura00\hu c\en%
\pnotes{2.00}\ibu1e{-1}\qb1f\qb1e\qb1d\tbu1\qb1c\en%
% Bar count 12
\xbar
\pnotes{2.83}\qu b\qu c\en%
\pnotes{4.00}\hu f\en%
\Endpiece
\vfill\eject\endmuflex
%\bye
\end{document}
  • Could someone add a PMX tag, please? – mattu Apr 13 '18 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.