Musikalisches Würfelspiel

A Musikalisches Würfelspiel (German for "musical dice game") was a system for using dice to randomly generate music from precomposed options. These games were quite popular throughout Western Europe in the 18th century. Several different games were devised, some that did not require dice, but merely choosing a random number.

The earliest example is Johann Kirnberger's Der allezeit fertige Menuetten- und Polonaisencomponist (German for "The Ever-Ready Minuet and Polonaise Composer") (1757 [1st edition; revised 2nd 1783]). Examples by well known composers include C. P. E. Bach's Einfall, einen doppelten Contrapunct in der Octave von sechs Tacten zu machen, ohne die Regeln davon zu wissen (German for "A method for making six bars of double counterpoint at the octave without knowing the rules") (1758) and Maximilian Stadler's Table pour composer des minuets et des Trios à la infinie; avec deux dez à jouer (French for "A table for composing minuets and trios to infinity, by playing with two dice") (1780).

In the early 20th century the Kaleidacousticon System, using arbitrarily combinable playing cards, was unsuccessfully marketed in the Boston area as a parlour game.

Aesthetics
According to Lawrence Zbikowski, "In truth, chance played little part in the success of the music produced by such games. Instead, what was required of the compilers...[was] a little knowledge about how to put the game together and an understanding of the formal design of waltzes, etc."

According to Stephen Hedges, "The 'galant' middle class in Europe was playing with mathematics. In this atmosphere of investigation and cataloguing, a systematic device that would seem to make it possible for anyone to write music was practically guaranteed popularity.

According to Leonard Meyer, "Eighteenth-century composers constructed musical dice games while nineteenth century composers did not. ... [W]hat constrained the choice of figures [in seventeenth- and eighteenth-century music] were the claims of taste, coherent expression and propriety, given the genre of work being composed, rather than the inner necessity of a gradually unfolding, underlying process [as in nineteenth century music]". See: musical development.

The way these games work may be understood in analogy to sentence construction. 1 The cow  ran    past    the field. 2 The pig  walked through the yard. 3 The sheep ran   into    the marsh. One rolls one die for each word and selects the word from the appropriate column according to the number. Thus if one rolls 1 2 3 1 2 3 one is given, "The pig ran past the marsh." Each progression is essentially the same, there may be more or less choices for different slots, and the choices offered for each slot are slight variations rather than being entirely different.

Mozart
The best-known was published in 1792, by Mozart's publisher Nikolaus Simrock in Berlin (K. 294d$K3$ or K. 516f$K6$). On its cover, the game was attributed to Mozart, but this attribution has not been authenticated.

The dice rolls randomly selected small sections of music, which would be patched together to create a musical piece. All measures except 8 and 16 have different possibilities for each roll (i.e. 11 different versions), with measure 8 only having one possibility and measure 16 having two. This gives a total of 2×1114 = 759,499,667,166,482 different yet similar waltzes. If the game is played with dice (as intended), then these different pieces are not equally likely due to the different probabilities for different dice sums.

Mozart's manuscript, written in 1787, consisting of 176 one-bar fragments of music, appears to be some kind of game or system for constructing music out of two-bar fragments, but contains no instructions and there is no evidence that dice were involved.

The titles of the supposed Mozart compositions are:
 * Anleitung zum Componieren von Walzern so viele man will vermittelst zweier Würfel, ohne etwas von der Musik oder Composition zu verstehen (German for "Instructions for the composition of as many waltzes as one desires with two dice, without understanding anything about music or composition")
 * Anleitung zum Componieren von Polonaisen... (German for "Instructions for the composition of polonaises...")

Robert Xavier Rodríguez composed his Musical Dice Game for string orchestra based on K. 516f.

Other examples
The attribution to Joseph Haydn of Gioco filarmonico o sia maniera facile per comporre un infinito numero de minuetti e trio anche senza sapere il contrappunto (Italian for "The game of harmony, or an easy method for composing an infinite number of minuet-trios, without any knowledge of counterpoint") has not been authenticated either.