Melisma Stochastic Melody Generator

Designed by David Temperley / Web interface by Daniel Sleator

The Melisma Stochastic Melody Generator is a computer program that generates original melodies using stochastic (i.e. partly random) processes. From this site, you can generate a melody using parameters of your own choosing; the melody will be returned to you in the form of a midifile, which will then be played on your computer.

The MSMG is not designed to produce great art or number-one hits. Rather, it is intended as a way of testing and experimenting with certain basic constraints and principles that may operate in the way melodies are constructed and perceived. To learn more about this (and to try some fun experiments), click on one of the links below. (The MSMG incorporates some of the same principles used by the Melisma Music Analyzer for analyzing music, and explored in David Temperley's book The Cognition of Basic Musical Structures.)

Enter the parameters you want in the boxes below, then hit the "Generate Melody" button. The values currently in the boxes are "default" parameters, which have been found to lead to good results. The allowable range for each parameter is shown below the box. If the range numbers are shown with decimals ("0.0, 1.0"), real numbers are allowed; if shown without ("0, 1"), then only integers are allowed. If an entered parameter value is illegal (outside the range, or a real number entered for an integer parameter), it will be adjusted to the nearest allowable value.

Tonality Parameters
tonality factor:
(0.0, 1.0)
How tonal should the melody be? (0.0 = not at all, 1.0 = very)
key profile type:
(0, 1)
If tonal, should the melody use all scale tones equally or emphasize tonic triad notes more? (1 = yes, 0 = no)
(-1, 11)
What key should it be in? (0 = C, 1 = C#...etc; -1 = the program chooses randomly)
(-1, 1)
What mode should it be in? (0 = major, 1 = minor, -1 = the program chooses randomly)
tonic endpoints:
(0, 1)
Should it begin and end on the tonic pitch? (1 = yes, 0 = no)
Proximity and Range Parameters
proximity factor:
(0.0, 1.0)
Should there be a preference for small intervals? (1.0 = a strong preference, 0.0 = no preference at all)
bottom of range:
(36, 96)
What should the bottom of the range be? (36 = 2 octaves below middle C, 96 = 3 octaves above)
top of range:
(36, 96)
What should the top of the range be? (36 = 2 octaves below middle C, 96 = 3 octaves above)
repeated notes:
(0, 1)
Should immediately-repeated notes be allowed? (1 = yes, 0 = no)
Rhythm and Meter Parameters
meter factor:
(0.0, 1.0)
How metrical should the melody be, i.e. how much pressure should there be for notes to coincide with strong beats? (1.0 = very much, 0.0 = none at all)
rubato factor:
(0.0, 1.0)
How much rubato should there be, i.e. should the tempo be perfectly regular or very irregular? (0.0 = very regular, 1.0 = very irregular)
rhythmic anchoring:
(0, 2)
Should notes on very weak (16th-note or 8th-note) beats be restricted to occur only when a note occurs on a neighboring strong beat? (0 = no restriction, 1 = only when there is a note on the preceding or following strong beat, 2 = only when there is a note on the following strong beat.)
number of beats:
(1, 200)
How long should the melody be in terms of the number of basic-level "tactus" beats? (number indicates number of beats)
beat interval (msec):
(200, 1000)
What should the basic tempo of the tactus beats be? (Number indicates time interval in milliseconds)
Random Process
(0, 1000000)
Any positive integer entered here will generate the same melody each time it is entered. If left at -1, the program will choose its own seed on every run.