musixpss - a MusiXTeX Extension Package: PostScript Slurs by MetaPost

version 0.54 [2017/08/17]

Introduction

MusiXTeX is a very powerful system to writing a musical score. However, the appearance of slurs (including ties) are not so beautiful, because of their drawing method: combination of fonts.

This package provides a new method for slurs and ties to improve them: using Encapsulated PostScript (EPS) code generated by MetaPost.

Features

Disadvantages

Contents

* All readable files (html, tex, mp, c) are in CRLF line termination (MS-DOS/Windows style).

Requirement

Installation

  1. Assume that TeX (or pdfTeX), MusiXTeX, and MetaPost work well on your system.
  2. Put musixpss.tex into the directory where the working score exists or where "TeX input files directory" in TEXMF tree (for example $TEXMF/tex/generic/musixtex/misc/ ).
  3. Put musixpss.mp into the directory where the working score exists or where "MetaPost input files directory" in TEXMF tree (for example $TEXMF/metapost/musixtex/misc/ ).
  4. If your OS is Microsoft Windows, put musixpss.exe into an appropriate directory registered in PATH environment variable; for example the directory where musixflx.exe is located.
    If not, modify musixpss.c line 44-45, compile it with an ANSI C compiler (for example: gcc -Wall -O2 -o musixpss musixpss.c ), and put the executable into appropriate directory.

Usage

Assume that the MusiXTeX score source is named foo.tex.

  1. Make a MusiXTeX score source foo.tex in conventional way.
  2. add a line \input musixpss.tex\relax after \input musixtex.tex .
  3. Run usual MusiXTeX procedure (pass 1, 2, 3):
    tex foo
    musixflx foo
    tex foo
    In pass 3, some messages such as No file foo.slu.1.mps. or (foo.slu.1.mps) will appear on the terminal and LOG file, and a file foo.slu containing parameters of slurs will be additionally generated.
  4. (Pass 4) Run the support program.
    musixpss foo
    The program musixpss.exe will translate foo.slu into MetaPost input, foo.mp. Filename extension is forcely regarded as .slu , regardless of its existence.
  5. (Pass 5) Run MetaPost.
    mpost foo
    where command line is system dependent. See the manual of your MetaPost system. EPS files foo.slu.1.mps, foo.slu.2.mps ... containing each slur will be generated.
  6. (Pass 6 -- except for dvips/dvipdfm optimized mode) Run TeX once more.
    tex foo
    The warnings will disappear and \special for inclusion of EPS files will be written into DVI file.
  7. Run DVIware, Ghostscript, Acrobat Reader, etc.

When correcting and retypesetting the score, it is not required deleting intermediate EPS files such as foo.slu.1.mps. If there is no change in both foo.mx2 and foo.slu (this is relatively rare case), only one execution of TeX will go.
Deleting EPS files before retypesetting will speed up operation of Pass 3, in case of a large change of score and using general mode or pdfTeX exclusive mode.

Options and some advanced functions

Operation mode selection

This package has 3 basic operation modes to adapt itself to various environment.

The default is 'general mode'. This mode guarantees the same compatibility of dvi file as LaTeX2e graphicx package with [dvips] option, since the internal procedures are almost same. Use this mode in general.

'dvips/dvipdfm optimized mode' is designed for dvips and dvipdfm/dvipdfmx. This mode makes the 6th pass of typesetting procedure unnecessary and thus provides much faster operation than 'general mode', because the internal procedures of this mode is much simpler. Also, this mode provides slightly good alignment. The resulting dvi file is, however, not compatible with some DVIwares, because of the difference of low-level (not LaTeX2e-level) implementation of \special{PSfile=...} from dvips.

'pdfTeX exclusive mode' is just as the naming. This mode works well with pdfTeX ver.1.10a-devel or later. It is known that some old version of support macro files supp-pdf.tex and supp-mis.tex lead to unaccountable error. In that case please update these two files at first.

The author hopes to adapt this package to DVIwares not listed above (xdvi, etc.) but has no environment of such DVIwares, other TeX distributions and OS's. Informations and trial reports are welcome.

Since ver.0.52, following two definitions for automatic mode selection are added. In these settings, musixpss.tex detects whether the using engine is conventional TeX or pdfTeX and selects appropriate operation mode automatically. Other characteristics are identical to the selected basic mode.

operation mode general mode dvips / dvipdfm optimized mode pdfTeX exclusive mode auto selection for general and pdfTeX auto selection for dvips and pdfTeX
general DVIwares* OK dependent on DVIware NG OK dependent on DVIware
dvips/dvipdfm(x) OK OK NG OK OK
pdfTeX NG NG OK OK OK
*Any DVIware compatible with LaTeX2e graphicx package with [dvips] option. for example dviout, etc.
operation mode general mode dvips / dvipdfm optimized mode pdfTeX exclusive mode
code \input musixtex
\input musixpss
\relax
\input musixtex
\input musixpss
\relax
\psslurmode{dvips}%
\input musixtex
\input musixpss
\relax
\psslurmode{pdftex}%
procedure Total 6 pass
+ DVIware
  1. tex foo
  2. musixflx foo
  3. tex foo
  4. musixpss foo
  5. mpost foo
  6. tex foo
  7. %DVIWARE% foo
Total 5 pass
+ dvips or dvipdfm(x)
  1. tex foo
  2. musixflx foo
  3. tex foo
  4. musixpss foo
  5. mpost foo
  6. dvips foo
    (or dvipdfm(x) foo)
Total 6 pass
+ Acrobat Reader
  1. pdftex foo
  2. musixflx foo
  3. pdftex foo
  4. musixpss foo
  5. mpost foo
  6. pdftex foo
  7. (AcroRd32) foo
operation mode auto selection for general and pdfTeX auto selection for dvips and pdfTeX
code \input musixtex
\input musixpss
\psslurmode{auto-pdftex-general}%
\input musixtex
\input musixpss
\psslurmode{auto-pdftex-dvips}%

Slur thickness adjustment

The thickness of slurs can be changed by redefining a macro \psslurthickadj . For example, \def\psslurthickadj{2.5} makes the slurs 2.5 times thicker than the default.

Switching EPS-based slurs and font-based slurs

EPS-based slurs can be switched on and off at any place in the score source by:

Support program: cleaning intermediate EPS files

The support program has a function for deleting intermediate EPS files. This function is useful when deleting EPS files before total retypesetting and so on.

musixpss -clean foo.slu
(filename extension .slu can be omitted.) or the same
musixpss foo.slu -clean

removes all intermediate EPS files foo.slu.1.mps, foo.slu.2.mps, ...foo.slu.n.mps .

Note: the implementation is very simple, so please check the C source code and use this function with care. The author do not guarantee any responsibility of losing important files.

License

GNU GPL ver.2 or any later version. See the file gpl-2.0.txt for details.
For the time being, the author myself select GNU GPL version 2 as this package's basic criteria of license. However, the author of course do not prohibit shifting to latest GNU GPL version 3 when anyone combine a part of this package into another program.

See also

Author

Hiroaki MORIMOTO <CQX05646 (atmark) nifty (dot) com>

Acknowledgement

The author would like to express a great grarirude to Luigi Cataldi for his Italian version document and pdfTeX trial reports and so on.


History

version 0.10 [2001/02/10]

version 0.20 [2001/02/23]

version 0.21 [2001/04/30]

version 0.22 [2001/06/15]

version 0.23 [2001/10/17]

version 0.30 [2001/10/21] (first announcement to TeX-music Mailing List)

version 0.40 [2001/11/03]

version 0.41 [2002/06/01]

version 0.50 [2003/01/05]

version 0.51 [2004/02/21]

version 0.51.1 [2004/03/21]

version 0.52 [2007/01/01]

version 0.53 [2009/07/21]

version 0.54 [core modules on 2017/08/12, documents on 2017/08/17]

TODO:


Copyright (C) 2001-2017 Hiroaki MORIMOTO
All kinds of comments, suggestions, and bug reports are welcome. If you find any problems or ideas, please tell me via 'TeX-music Mailing List'.