Introduction to the Melisma System

The Melisma Music Analyzer is a program for analyzing music and extracting information from it. The analyzer takes a piece represented as an "event list"--a list of notes, with pitch, on-time, and off-time--and sometimes other input as well. It then subjects this input to various kinds of analysis and processing.

The Melisma system consists of several modules which can be run independently or in combination, depending on the kind of analysis that is desired. (We call it the MELISMA system because it is a Modular Event-List-Input System for Music Analysis.) The METER program produces a metrical analysis, consisting of a framework of rows of beats. The GROUPER program takes a melody (only "monophonic" input is permitted) and groups the notes into phrases. The STREAMER program takes the notes of a piece and groups them into contrapuntal lines: for example, separating out the melody, bass line, and accompaniment lines. The HARMONY program produces a harmonic analysis, consisting of a series of segments labeled with roots and a spelling assigned to each pitch-event. Finally, the KEY program produces a key analysis, consisting of a series of sections labeled with keys, and (optionally) a Roman numeral analysis showing the function of each chord relative to the current key.

Our main goal in this project has been to develop models of musical cognition. The components of the Melisma system are all based on the concept of preference rules; our aim in developing the system was to find out if the preference rule approach was adequate to the task of extracting musical information from inputs. However, the Melisma system may also prove useful for practical problems of musical information processing: e.g. automatic transcription, chord labeling, segmentation, stylistic identification, etc..

The source code for the entire Melisma system can be downloaded at our ftp site. (Some browsers cannot access this link. If you have this problem you can ftp directly from You can also grab the entire music analysis directory tarred and compressed here.) The system, written in C, runs on a UNIX platform. We also provide a utility for converting Midifiles into the "notelist" format suitable for input to the Melisma system. In addition, we provide various kinds of input files that may be useful in exploring the capabilities of the Melisma system.

Anyone is welcome to download the system and work with it. If you are interested in using the system for commercial purposes, please contact us via electronic mail.

We also provide documentation about the Melisma system at this website. This documentation is designed to provide a practical guide to using the system. Information about the theory, implementation, and testing of the system can be found in our publications. In particular, Temperley's book The Cognition of Basic Musical Structures (MIT Press) contains much information about these matters. See also "An Algorithm for Harmonic Analysis", by Temperley, published in Music Perception, Fall 1997; "Modeling Meter and Harmony: A Preference-Rule Approach", by Temperley and Sleator, in Computer Music Journal, vol. 23, issue 1 (Spring 1999); "What's Key for Key? The Krumhansl-Schmuckler Key-Finding Algorithm", by Temperley, in Music Perception, Fall 1999.

Some general information

Pages about each of the five components of the Melisma system (accessible from the Melisma home page) provide much further detail about how to use them and how they work. The following section gives some information that applies to all five programs.

Running and compiling the programs. Each program must be compiled before it can be run. To compile one of the programs, enter the corresponding directory (each one has its own directory) and type "make".

To run one of the programs, simply type the name of the program ("meter", "grouper", "streamer", "harmony", or "key") followed by the name of the input file to be processed. For the meter program, for example:

	meter [input-file]

Input format. As input, each of the programs requires a "notelist": a list of notes with ontimes and offtimes (both in milliseconds) and pitch. However, some of the programs require or allow other kinds of input as well. Here is a summary:

Program Required input
Meter Program Note list
Grouper Program Note list AND optional beat list
Counterpoint Program Note list AND beat list
Harmony Program Note list AND beat list
Key Program (Note list OR TPCNote list) AND beat list AND optional chord list

See pages on the individual programs for further details on the input required.

Note that all the programs except the meter program require a beat list as input (the grouper program can be run without it, but this is not recommended); such a beat list is produced as output, along with the inputted note list, by the meter program. Thus it is often convenient to input a file to the meter program, and then use the output from that as input to one of the other programs. The UNIX "pipe" command is very useful for this purpose. For example, the output of the meter program can be piped into the harmony program, as shown below.

     meter/meter [input-file] | harmony/harmony   

(It is probably easiest to do this from within the "top-level" melisma directory; the meter program can be then run by typing "meter/meter", as shown above, and similarly for the other programs. Bear in mind that the parameter file within the METER directory will not be accessed; rather the default parameters will be used.)

Parameters. Each of the programs has a number of parameters that can be adjusted by the user. These are listed in a parameter file. A parameter file is simply a list of statements, each one consisting of the parameter name, a "=" sign, and a numerical value. The parameter file is read in each time the program is run; thus the program does not have to be recompiled each time the parameters are changed. A parameter file can be specified when the program is run, as follows (using the meter program as an example):

        meter -p [parameter-file] [input-file]

If no parameter file is specified, the program will look for a file in the current directory called "parameters" and use that. If no such file is found, the program has default values for the parameters that it will use. Similarly, if the parameter file specifies only some of the parameters, default values will be used for the others. (The files called "parameters" included in the ftp site simply contain the default parameters for each program.)