This tutorial shows how I prepare printed scores and MIDI files using the MUP typesetting software.
The MUP program takes a text file containing music notation written in the MUP language and produces both MIDI and Postscript files. The MIDI file is used to perfom the piece with software synthesisers (for example, Reason or Cubase) and the Postscript file can be printed or converted into PDF format.
There is no graphical user interace to MUP. Instead, a text editor is used since MUP is just a plain text. My preferred editor is Emacs, but a MUP file can just as easily be edited with Windows notepad.
The User Guide explains the language with many examples and it is not necessary to learn another editor or fancy graphical user interface. Editing the music in plain text format requires thinking about the music in a different way, but I found it didn't take too long to visualise the printed score when viewing MUP code.
This tutorial follows the typesetting of the first Minuet from J S Bach's Partita Number 3 in E major for solo violin. Here is a scan from the printed page.
This piece has a total duration of 34 bars (measures), and divided into two sections of 8 and 26 bars each of which is repeated.
I use the GNU Emacs text editor extensively in my work. A MUP file is plain text and can be edited just like any other text file.
The Emacs editing environment can be greatly enhanced by using packages (coded in the Lisp language) for providing color-coding of the language and commands and menu itmes for common operations. I use Mup Mode for adding color to the language and providing shortcuts for compiling and displaying scores.
The Emacs screen is transformed into this colorful environment, now that MUP-Mode is enabled.
A menu is now visible (Mup-Menu) as well as many command key shortcuts available for compiling the code into Postscript or MIDI, viewing the Postscript or playing the MIDI file.
Let's have a look at the contents of a MUP file. A MUP file is comprised of several sections known as contexts each of which has a specific purpose. Comments are any lines that begin with two slashes ("//").
First of all some information is needed for the page layout.
The header context is used to set titles in various sized fonts. The header2 and footer2 contexts describe output that is only displayed on the second and subsequent pages of the score.
The score context is used to define the units of measure, in this case centimetres. Then the pageheight and pagewidth is set along with top, bottom, left and right margins.
The vscheme parameter says that each staff will contain two voices and the note stems should be set in opposite directions. The optional scale and packfact parameters are used to set the size of the printing and how closely to pack the notes together. There are many parameters for fine-tuning the layout of a score, but they don't need to be set as default values are usually sufficient.
The last part of this display sets the time signature (3/4 time in this score) and the key signature (4# means four sharps which is E major). The staffs parameter sets the number of staffs used in the score. This score only has one staff since it is a solo violin score.
Notes are automatically beamed based on the beamstyle parameter of 4,4,4. This means that notes adding up to one beat will be beamed together. Beaming can be manually overridden by enclosing notes between the bm (start beam) and ebm (end beam) parameters. This can be seen in bar 4.
The measnum parameter will cause the measure number to be printed at the beginning of each line, which is most useful for comparing the original and printed scores.
This part of the file is used to define the characteristic of each staff. There is only one staff in this score, a treble clef for the violin part. The label is the text displayed to the left of the first staff, and label2 is the text displayed on subsequent lines. In this example, the label is empty.
Following the change to music mode, are two MIDI directives. The first line sets the tempo of the piece to 120 beats a minutes. The second midi line sets voices 1 and 2 to MIDI channel 2 with an instrument selection of VIOLIN. The word VIOLIN is actually contained in the midi-instr.mup file included with the include directive and is a convenient means of mapping musical instrument names to MIDI instrument names.
Notes are entered in bar (measure) sequence. All information about a bar is grouped together and ended with a bar line directive such as bar (single vertical line), repeatboth and repeatend.
The staff number and voice number are followed by a list of notes and durations.
The image above is a compilation of the score and the MUP code to show how easy it is to create a score. Creating a score is just a matter of transcribing the music information note by note!
Once the score has been entered, it is compiled by choosing a menu item or entering a keyboard shortcut to create a Postscript file or MIDI file.
A new window is display showing the results:
The MIDI file can be played by choosing the menu item or entering the shortcut C-c C-v C-d. The choice of MIDI file player is a Mup-mode configuration option, and I have used Van Basco's MIDI player from Van Basco Software.
The Postscript file can be viewed by choosing the menu item or entering the shortcut C-c C-v C-t. The choice of Postscript viewer is a Mup-mode configuration option, and I use Ghostscript and Ghostview.
A PDF file can be created from Ghostview using the Convert option.
And finally, the PDF file can be viewed (and printed) using Adobe Acrobat Reader software.
The MUP Language is powerful and provides a rich set of features for creating scores and MIDI files. The software is shareware, but inexpensive ($US29). A mailing list is available for registered users, and the developers of the software are helpful and responsive to bug reports and feature requests.
Files used in this tutorial:
Author: Charles Cave <charlesweb@optusnet.com.au>
Date: 2007/09/16