Home ... FAQ ... Music ... Software ... Forums ... Articles ... Contact

Mozart's Dice Waltz

Program by Chris G. Earnshaw

Mozarts Dice Waltz Main screen

Mozarts Dice Waltz

by Chris G. Earnshaw
PD 1991

Fumbling through several PD discs I had, I was able to find a very unique program which takes Mozarts famous "Dice Waltz" and makes it into an interactive application enabling thousands of different variations from all the possabilites that Mozart specified in his "score". This is a wonderful educational program that also stands as an achievement in algorithmic music. The program is also "Steem" compatable, which means it will work on a PC (see my Steem page)

Musical Dice

W. A. MOZART (1756-1791) was not only a great composer who produced a huge variety of musical pieces, but he liked fun and jokes too. In his "Musikalisches Würfelspiel" (Musical Dice Game) for each of the 16 bars of a Wiener minuet, Mozart offered 2 choices for the 8th and the 16th bars, and 11 choices for each of the other bars. Mozart's idea was that from the stock of bars the player will be able to "generate" a huge variety of melodies himself, by selecting randomly from the offered choices per bar. Besides the musical experience, the piece provides challenges in probability theory, ranging from practical routine computations to fundamental and philosophical ones. Both the musical and mathematical aspects can be used well for educational purposes.


W. A. MOZART (1756-1791) 's "Musikalisches Würfelspiel" (Musical Dice Game) was first published only after the death of Mozart in 1793 by J.J. Hummel in Berlin-Amsterdam, and afterwards several times in different forms. The challenging idea had been known and tried out by other composers before Mozart, such as Ph. Em. Bach and J. Haydn [1]. However, it was Mozart's piece which became famous and successful. (Though neither the original manuscript of the "Musikalisches Würfelspiel" nor direct references to it by Mozart were ever found, his authorship was never really questioned by publishers or musicologists

All possible choices were given by Mozart in such a way that by any selection the resulting melody is a pretty minuet fulfilling the harmonic and compositional requirements of Wienese minuets of that time.

In all the publications, it was suggested to use two dice to make the random choices: throw with two dice, and take the sum of the thrown numbers. This is a number between 2 and 12. If you subtract one, you have got a number between 1 and 11, indicating the number of the alternative to choose.

Music Dice via Computer

In 1991, Chris G. Earnshaw from Cambridge, developed a computer implementation of Mozart's dice game as a public domain program for the Atari computers. His version was based on the 1798 edition by Simrock in Bonn (reprinted by the Liverpool Music Press) of Mozart's "Instructions to compose without the least knowledge of music so much german waltzer or schleifer as one pleases, by throwing a certain number with two dice" . Other programmers have written before him versions for the BBC micro and for the Sinclair Computer.


The program is intended to be used on a monochrome monitor, but it will work reasonably well with an emulator such as MONO_EMU.PRG. Start the program by double clicking on the MOZART.PRG icon. When the program and data files have loaded, you can compose and play music using the seven control buttons, described next.

COMPOSE - click this button to make the computer throw the dice, record the throws, and write the music on the stave.

PLAY - this option is disabled until some music has been COMPOSEd. Click to play the music, click and hold the right mouse button to stop playing.

INSTRUMENT - click here to bring up a dialogue box allowing you to choose between playback through the ST's internal sound chip, or a voice on an attached MIDI instrument. If more than ten MIDI voices are available a "scroll bar" at the right of the dialogue box will allow you to move through the list. Click on the desired voice to select it. The currently selected voice is marked with a tick. To dismiss the dialogue box click in the grey title panel at the top. If the INSTRUMENT button is disabled there are no MIDI definitions in your current .INS file. Click with the right mouse button to bring up a file selector and choose a .INS file appropriate for your MIDI instrument (see the section on .INS files later).

TEMPO - allows you to set the playing speed in the range 30 to 400 beats/minute. The default is 120 bpm. Click on the arrows above and below the numbers in the dialogue box to set the value you want. Click in the grey title panel to finish.

PRINT - will be disabled unless your printer is connected and on-line. Your printer must be able to make a graphics screen dump for this option to work. The dialogue box allows you to choose between making a simple copy of the current screen, and printing a "facsimile" of the Dice Waltz in one of the four languages of the original. You can only select one option at a time. Clicking on the current option (marked with a tick) will deselect it. Printing (if any) will not start until you click in the grey title panel. Note that the facsimiles print best on 12" paper. If you use 11" paper position the print head right at the top of the page, and be prepared for a blank sheet to be ejected between pages. I have reproduced the original instructions very carefully in the "facsimiles", so don't be surprised at the spelling and grammar!

QUIT - allows you to leave the program. Click in the box to toggle between NOT YET (the default) and BYE BYE. Again click in the grey title panel to finish.

DICE MODE - positioned above the stave, allows you some control over the behaviour of the COMPOSE button. Click on the options in the dialogue box to toggle them on and off. Roll Dice allows you to turn on and off the display of the rolling dice during composition. Load Dice allows you to fix in advance the values which the computer will throw, allowing you to reproduce a previous composition. When this option is selected, COMPOSE will bring up a copy of the current Dice Record, with a third row of numbers (from 2 to 12) on the bottom row, marked "Select". Click on the number (in the Select row) which you wish to place in the table; the mouse pointer will turn into this number. Then click on the table at the position this number is to be placed. When all the changes have been made click on the grey title panel, and your chosen piece of music will be composed.

You can also click on the "DICE WALTZ" title box at the top left of the screen to bring up a window with some brief historical notes about the piece. Again, click on the grey title panel to return to the program.


When MOZART.PRG is started it looks for a file called MOZART.INS, containing the names and MIDI voice numbers for an attached MIDI instrument. The default MOZART.INS file is simply a copy of NO_MIDI.INS, which tells the ST that MIDI is not available, and playback is to be through the internal sound chip. You can load a different .INS file by right-clicking on the INSTRUMENT button, but it is more convenient to create a MOZART.INS file for your own MIDI instrument. If you own a CASIO CPS-101 or a YAMAHA PSS-480, simply rename a copy of the appropriate file to MOZART.INS. Otherwise you will have to create a new file, most easily by editing one of the supplied files. Here is the CPS-101 file as an example:


Piano 1 000
Piano 2 001
Elec.Piano 002
Vibraphone 003
Harpsichord 1 004
Harpsichord 2 005
Pipe Organ 1 006
Pipe Organ 2 007
Strings 008
Chorus 009

The first line is the name of the instrument. This will appear in the left hand side of the INSTRUMENT dialogue box. The second line is the number of voices in the file. The following lines contain the names of the voices (in a field 14 characters wide) which you want to use on this instrument, followed by the MIDI voice number (in a field 3 characters wide - leading zeros are not needed, but they make it easier to format). The voices can be in any order in the file, so you can place the most useful ones at the top for easy access. The first voice in the file will be used by default. There can be no more than 999 voices, but this is probably not a serious limitation!


The program will attempt to turn off Local Mode on your instrument while the music is being played. This is not possible on some MIDI keyboards. On some keyboards, such as the Yamaha PSS-480, you will need to switch the keyboard into Sound Source mode for satisfactory polyphonic playback. You may have to experiment a little with the settings on other MIDI keyboards.


The Dice Waltz is able to compose rather more than 350,000,000,000,000 different pieces of music. To play all of these at 120 beats/minute will take over 500,000,000 years - so you'd better get started!

Happy composing!


Martin Tarenskeen has created a General MIDI (GM) compatible instrument definition file for the Atari Mozart's Dice program. Simply unzip this and put in the same directory as the Mozart Dice program. Then load the .INS file as mentioned above.Download it below

New! May 2003 Recieved a mail from the original programmer who has now provided me with an update to the program. In Chris Earnshaw's own words:


Dear Tim

Had a phone call from my son recently saying he'd been discussing algorithmic music generation with one of his friends, and when they searched Google for Mozart's Dice Waltz they found your web page with my old Atari program at the top of the list. This was a bit of a surprise - I'd expected the program would have been long gone by now! Thanks for your kind comments about it too.

I've been meaning to resurrect some of my old Atari stuff, so I've now installed Steem and tried out the Mozart download from your site. It works a treat - except that you have the early version of my program. I released an update which allows 2-voice playback, loading and saving of dice numbers and saving MIDI files. It also has a '.ins' file for the Roland JV-30 (general midi) as part of the distribution.

If you'd like to have this latest version - just over 10 years old :-) I'll be happy to email you the Zip file.

Best regards,

-- Chris Earnshaw


And emailed it he did! Download it below



Download the Mozart Dice Waltz Program

Download the GM definition file

Dice Game page

Dice Game Links page for more Info.