2

What am I doing wrong? Just to clarify, that my confusion stems from lack of obvious line numbers and poistions that would point at the location inside the sample file where an error occurred.

I borrowed a PMX bat file from the p. 11 of the manual Typesetting music with PMX, Version 2.821 / May 2013 by Cornelius C. Noack and adjusted it for my MikTex setup paths.

:::::::::::::::::::::::: runpmx.bat ::::::::::::::::::::::::
Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pmxab.exe" %1.pmx
if errorlevel 1 goto pmxerr
if exist %1.pml del %1.pml
if exist %1.mx2 del %1.mx2
if exist %1.mx1 del %1.mx1
if exist pmxaerr.dat del pmxaerr.dat
::
Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\etex.exe" %1.tex
if errorlevel 1 goto texerr
::
Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\musixflx.exe" %1.mx1
::
Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\etex.exe" %1.tex
if errorlevel 1 goto texerr
if exist %1.log del %1.log
::
Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\dvips.exe" %1.dvi
if errorlevel 1 goto dvierr
if exist %1.log del %1.log
::
@rem Call C:\Programme\GhostScript\Ghostgum\gsview\gsview32.exe %1.ps
::
goto :end
:::::::::::::::::::
:: error exits :
::
:pmxerr
echo.
echo PMX has found errors when processing %1.pmx !
echo.
pause
goto :end
::
:texerr
echo.
echo TeX has found errors when processing %1.tex !
echo check %1.log for details.
echo.
pause
goto :end
::
:dvierr
echo.
echo *** dvips had errors ! ***
echo.
pause
::
:end
:::::::::::::::::::: end of runpmx.bat ::::::::::::::::::::

Then I copy/pasted a Haydn sample from the p. 14 of the same manual into a file haydn.pmx in ANSI encoding:

F.J.\ Haydn, Quartet op.76, no.2, bars 1--4
PREAMBLE:
nstaves ninstr mtrnuml mtrdenl mtrnump mtrdenp
4 4 4 4 0 6
npickup nkeys
0 -1
npages nsystems musicsize fracindent
1 1 16 .08
Violoncello
Viola
Violin II
Violin I
batt
./
% BODY:
% HEADER:
Tc
F.J. Haydn
Tt
String Quartet op. 76, No.2
h
Allegro
Abep
w170m
% begin of music input -
% bar 1
d82 Df o. d+ o. d o. d o. r d o. d o. d o. /
f83 Df o. f o. f o. f o. r f o. f o. f o. /
r8 a83 Df o. a o. a o. r a o. a o. a o. /
a24 Df d- /
% bar 2
r8 d o. d o. d o. r e o. e o. e o. /
r8 g o. g o. g o. r g o. g o. g o. /
r8 b o. b o. b o. r cs o. c o. c o. /
e2 a- /
% bars 3-4
f8 s e f cs s d4 a | b2 s a4 s o. r Rb /
a2 t a4 t .cs- | d8 s e f d s e4 o. r /
d8 s cs d e s e s d c s a1+ s g s | f s g f e s d8 o. d o. cs4 r /
d8 s cs d e s g s f e s a | d4- zd+ cn1 s b a gs s a4 o. r /
% end of PMX source file

and finally ran the bat file against that sample. That resulted in the following errors:

I:\LaTeX\MusixTex\work>pmx.cmd haydn

I:\LaTeX\MusixTex\work>Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pmxab.exe" haydn.pmx
 This is PMX, Version 2.7  , 3 Apr 13
 Opening haydn.pmx

 Starting first PMX pass
forrtl: severe (64): input conversion error, unit -5, file Internal Formatted Read

I:\LaTeX\MusixTex\work>if errorlevel 1 goto pmxerr

I:\LaTeX\MusixTex\work>if exist haydn.pml del haydn.pml

I:\LaTeX\MusixTex\work>if exist haydn.mx2 del haydn.mx2

I:\LaTeX\MusixTex\work>if exist haydn.mx1 del haydn.mx1

I:\LaTeX\MusixTex\work>if exist pmxaerr.dat del pmxaerr.dat

I:\LaTeX\MusixTex\work>Call "D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\etex.exe" haydn.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)
entering extended mode
! I can't find file `haydn.tex'.
<*> haydn.tex

Please type another input file name:
! Emergency stop.
<*> haydn.tex

No pages of output.
Transcript written on texput.log.
Terminate batch job (Y/N)? y

After the process is complete, the following haydn.pml file is created:

This is PMX, Version 2.7  , 3 Apr 13 
Opening haydn.pmx                                      
 Starting first PMX pass

and a file pmxaerr.dat which contains only one line with 0 after 5 spaces:

 0
6
  • 1
    If I try to run this on Linux, I get a slightly different error, but still related to the input. I would guess that one of the characters got messed up when you copied it from the PDF. You should create a MWE to locate where the error is.
    – darthbith
    Oct 2, 2014 at 21:10
  • This is an MWE. But your suggestion is good! +1. I will need to compare the pasted code with the source in the manual character by character. It is worth noting that the other examples that I copied from that manual worked. But they were in LaTeX, not PMX script.
    – ajeh
    Oct 2, 2014 at 21:16
  • Well, its not really an MWE since you have 4 bars of music... a true MWE would have only 1 bar, or perhaps even just 1 note! :-) The library that's throwing the error indicates (I think) that it's written in Fortran which is notoriously finicky about input... not to say LaTeX isn't, but I would guess its better, especially if you use a more modern engine :-)
    – darthbith
    Oct 2, 2014 at 21:43
  • @darthbith It is impossible to satisfy your requirement. The question is Why does an example from the manual not work?. If I modified the example in any way, that would invalidate the question. I have no choice than to leave it exactly same as in the manual.
    – ajeh
    Oct 3, 2014 at 14:01
  • 1
    The answer to that question is "Because there is a character that cannot be read" - that is what the error message says. The follow up question, which I suspect you really want the answer to, is "Where does the error occur?" By constructing ever smaller MWEs you can find where the error lies. I recommend the bisection method - delete the second half of the code and check for error messages. If you have the same message, remove half of the remainder. Otherwise, add back half of the original removal. It is a simple and effective method of troubleshooting, although perhaps a bit tedious :-)
    – darthbith
    Oct 3, 2014 at 14:23

1 Answer 1

3

The example is indeed wrong, it is missing a number of comment characters on early lines. The first thing pmx expects to see in the file is a list of numbers, corresponding to the variables nstaves etc. In this example this list starts 4 4 4 4 0 6. All the lines before this need to be commented out with %, as do the lines starting npickup and npages. Here is a correct file and its output

Sample output

% F.J.\ Haydn, Quartet op.76, no.2, bars 1--4
% PREAMBLE:
% nstaves ninstr mtrnuml mtrdenl mtrnump mtrdenp
4 4 4 4 0 6
% npickup nkeys
0 -1
% npages nsystems musicsize fracindent
1 1 16 .08
Violoncello
Viola
Violin II
Violin I
batt
./
% BODY:
% HEADER:
Tc
F.J. Haydn
Tt
String Quartet op. 76, No.2
h
Allegro
Abep
w170m
% begin of music input -
% bar 1
d82 Df o. d+ o. d o. d o. r d o. d o. d o. /
f83 Df o. f o. f o. f o. r f o. f o. f o. /
r8 a83 Df o. a o. a o. r a o. a o. a o. /
a24 Df d- /
% bar 2
r8 d o. d o. d o. r e o. e o. e o. /
r8 g o. g o. g o. r g o. g o. g o. /
r8 b o. b o. b o. r cs o. c o. c o. /
e2 a- /
% bars 3-4
f8 s e f cs s d4 a | b2 s a4 s o. r Rb /
a2 t a4 t .cs- | d8 s e f d s e4 o. r /
d8 s cs d e s e s d c s a1+ s g s | f s g f e s d8 o. d o. cs4 r /
d8 s cs d e s g s f e s a | d4- zd+ cn1 s b a gs s a4 o. r /
% end of PMX source file

I suggest you contact the author of the tutorial pointing out this error. Generally it would be nice of if the pmx document and introductory material has some really short simple example one could try first, much as @darthbin was requesting in the comments. Perhaps such an example might be

1 1 4 4 4 4 0 0 
1 1 20 0.12 
Violin
t
./
% Bars 1
c2 g4+ e /
% End of file

where

1 1 4 4 4 4 0 0 

means one staff per system, one instrument, 4/4 time printed as 4/4 with 0 beats in the pickup bar and key signature 0, meaning no sharps or flats. Line 2

1 1 20 0.12 

says 1 page with 1 system, music size 20 and an indent of 0.12 for the first system.
Line 3 is the name of the instrument, line 4 t says it is a treble clef. The ./ line says put the output in the current directory. Finally c2 g4+ e / is the bar of music, starting with a C minimum rising to a G chrochet followed by an E chrochet.

Sample output

My installation (texlive) comes with a command pmx2pdf that will process this to a pdf file you.

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.