Muse2ps

From CCARH Wiki
Revision as of 19:27, 19 December 2010 by Craig (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

Overview

The dmuse2ps program is a command-line version of the autoset, mskpage and pspage programs which are usually run within the dmuse editor using the built-in zbex language interpreter. The dmuse2ps program reads MuseData stage2 files or page files from standard input and converts them into PostScript data representing graphical musical notation, sent to standard output. The following diagram illustrates the flow of data through muse2ps:

Muse2ps-dataflow.svg


Download

The dmuse2ps program executables for various operating systems or source code can be downloaded from the following table. Instructions on setting up the program for use can be found here.


File Description
muse2ps.tar.bz2    Tar file containing source code and test examples.
muse2ps-linux    Program executable compiled statically for linux.
muse2ps-osx    Program executable compiled for Apple OS X, version 10.4 and higher.
muse2ps.exe    Program executable compiled for Microsoft Windows (prone to stack overflows in older versions of Windows). It is currently advised to download the source code and compile within a Cygwin terminal if you want to run on Windows (not suitable for the amateur Windows user who is not familiar with Unix).

Online

Command-line example usages

To compile dmuse2ps, type the command:

   make

Once the program has been compiled, you can go into the tests/ directory and type either "make" to create PostScript files for three test works, or type "make pdf" to create PDFs for the test works. Example output of dmuse2ps can be found in tests/pdf.

Input and output files

Options can be given to muse2ps. For example, "z21" is the option which sets the music size to 21 (21 pixels at 300 dpi between staves):

    cat work.md2 | muse2ps =z21 > work.ps

When inputting MPG (Music PaGe) files you must specify the "P" option:

    cat work.mpg | muse2ps =P > work.ps

If you are inputting multiple MPG files (each MPG file represents one page of a score or part), add the letter "P" on a line by itself after the single-page MPG content.


muse2ps options

Below is a list of the options which muse2ps understands. Options are given as the first argument to the program, staring with an equals sign (=) and followed by the options in any order, with no spaces between the options. For example, to set the music size to 18 and right-justify the last system on the last page, use the option string =z21j:

   cat file.md2 | muse2ps =z21j > file.ps

In option strings such as "=c<#>", replace <#> with an integer.

=c<#> compression factor: This is measured as a percentage of the default. 100 = no compression.
=d<#> putc Diagnostics and Error Messages.
            bit 0 of #:  ON = print error messages
            bit 1 of #:  ON = print all diagnostics
            bit 2 of #:  ON = print diagnostics from autoset
            bit 3 of #:  ON = print diagnostics from mskpage
            bit 4 of #:  ON = print diagnostics from pspage
            no number = 0x01: print error messages
=F fill pages to the bottom by adding to the intersystem space only. Default is don't change the vertical spacings.
=f fill pages to the bottom by proportionally stretching all spacings. Default is don't change the vertical spacings.
=g<#> grand staff intra-space measured in multiples of ledger lines times 10. The default is 100, which is 10 ledger lines.
=h<#> alter the minimum allowed space between notes. This is measured as a percentage of the default. 100 = no change (100%).
=j right justify the last system. The default is NOT to right justify.
=l<#> length of a page. Distance is measured dots, at 300 dots to the inch. Default is 2740 dots. The default starting height is 120 dots. This will not be lowered, but may be raised to accommodate a longer page.
=m<#> left margin, measured in at 300 dots/inch. The default is 200 dots
=n<#> maximum number of systems on a page. The default is no maximum.
=Q<#> duration which is assigned the minimum distance
              1 = whole notes
             ...   . . .
              8 = eighth notes
             16 = sixteenth notes, etc
=s^string^ custom left-hand spine. If the format is incorrect for any reason, the program will revert to the default. example:
            	=s^[(....)][(..)](.)[({..}..)]^
=t<#> top of page. Default is 120 dots
=v<#,#,#...#> custom spacings. If the format is incorrect for any reason, the program will revert to the default. example:
            =v192,192,192,208,192,192,208,176,176,176,200
=w<#> system width, measured in at 300 dots/inch. The default is 2050 dots
=x defeat all part inclusion suggestions in the data
=y defeat all line control suggestions in the data
=z<#> notesize: choices are 6,14,16,18,21. 14 is the default.
=M include a listing of the MuseData source files in the Trailer section of the file
=P include listings of the page specific i-files, which are the source of the .ps files
=p The source is a concatinated set of page specific i-files (also called .mpg files), not a set of Musedate files.
=G^group-name^ group name to process. The default is "score"
=E /END = /eof

Multi-file input specification

When inputting MuseData stage 2 files, each input file (which contains one part), should be ended by:

/END
/eof

The "/END" is probably optional. After "/END", any commentary text may occur which will be ignored by programs which process MuseData stage 2 files. The "/eof" marker is used specifically by muse2ps to locate the end of the current file (part). The very last line of input to muse2ps should be "//". So the end of the last part file send to muse2ps should look like this:

/END
/eof
//


Zprogs: autoset.z and pspage.z

The sub-directory zprogs contains programs used to generate the file zfun32.c. Most necessary files are in that directory, but perhaps not all of them. These programs are not used directly by muse2ps, but are compiled into zbex executable code within zfun32.c. The muse2ps is essentially a non-interactive version of dmuse (see http://dmuse.ccarh.org). The dmuse program is a text editor which also has a built-in zbex language interpreter. The intepreter portion of dmuse has been extracted for non-interactive use in dmuse2ps.