Musical Information (Mus 253/CS 275A)

Musical Dice Games

Several 18th century composers such as Mozart and Haydn composed music which is performed by rolling dice to determine the sequence of measures in the music. The table below contains one of these dice-game compositions: Musikalische Würfelspiele (Musical Dice Game), Kontre-Tänze (Contra-Dance), K6 Anh. C30.01 (K3 Anh. 294d) by Wolfgang Mozart.

The piece is generated by rolling a pair of dice. The outcome of the dice roll is a number between 2 and 12. For each measure in the composition there is a set of 11 possible measures which are chosen by the dice roll. For example, if a 9 is rolled for the first measure of the piece, pre-composed measure #142 will be the first measure of the generated composition. If a three is rolled for the second measure, then measure #64 will be the second measure of the generated composition. You can view the individual measures in Humdrum text format or in MIDI file format in the table below.

Humdrum


 ROLL:  2   3   4   5   6   7   8   9  10  11  12
 A1 = 070 010 033 036 105 165 007 142 099 085 145 
 A2 = 014 064 001 114 150 152 081 106 068 045 097 
 A3 = 164 100 160 008 057 112 131 040 086 090 006 
 A4 = 122 012 163 035 071 015 037 069 139 158 121 
 A5 = 025 149 077 111 117 147 021 043 120 082 056 
 A6 = 153 030 156 039 052 027 125 140 092 123 067 
 A7 = 018 161 168 137 132 073 049 023 143 078 063 
 A8 = 167 011 172 044 130 102 115 089 083 058 016

MIDI


 ROLL:  2   3   4   5   6   7   8   9  10  11  12
 A1 = 070 010 033 036 105 165 007 142 099 085 145 
 A2 = 014 064 001 114 150 152 081 106 068 045 097 
 A3 = 164 100 160 008 057 112 131 040 086 090 006 
 A4 = 122 012 163 035 071 015 037 069 139 158 121 
 A5 = 025 149 077 111 117 147 021 043 120 082 056 
 A6 = 153 030 156 039 052 027 125 140 092 123 067 
 A7 = 018 161 168 137 132 073 049 023 143 078 063 
 A8 = 167 011 172 044 130 102 115 089 083 058 016

 ROLL:  2   3   4   5   6   7   8   9  10  11  12
 B1 = 155 148 022 004 136 144 116 066 093 061 050
 B2 = 003 028 176 157 091 104 133 124 055 034 079 
 B3 = 162 135 062 038 138 087 072 026 029 119 175 
 B4 = 170 173 126 009 019 107 141 084 051 046 076 
 B5 = 013 169 031 151 134 128 094 075 042 059 113 
 B6 = 166 174 024 032 101 048 080 103 110 054 088 
 B7 = 095 002 159 017 154 109 129 096 108 060 053 
 B8 = 005 020 041 171 146 074 065 127 098 047 118 

 ROLL:  2   3   4   5   6   7   8   9  10  11  12
 B1 = 155 148 022 004 136 144 116 066 093 061 050
 B2 = 003 028 176 157 091 104 133 124 055 034 079 
 B3 = 162 135 062 038 138 087 072 026 029 119 175 
 B4 = 170 173 126 009 019 107 141 084 051 046 076 
 B5 = 013 169 031 151 134 128 094 075 042 059 113 
 B6 = 166 174 024 032 101 048 080 103 110 054 088 
 B7 = 095 002 159 017 154 109 129 096 108 060 053 
 B8 = 005 020 041 171 146 074 065 127 098 047 118 

To generate a composition, you would roll the dice 16 times, and choose a measure for A1 through A8 and B1 through B8. The table below gives a list of 100 random realizations of the contra-dance. The set on the left contains the music in Humdrum format, and the set on the right contains the music as MIDI files.

Humdrum


001 002 003 004 005 006 007 008 009 010
011 012 013 014 015 016 017 018 019 020
021 022 023 024 025 026 027 028 029 030
031 032 033 034 035 036 037 038 039 040
041 042 043 044 045 046 047 048 049 050
051 052 053 054 055 056 057 058 059 060
061 062 063 064 065 066 067 068 069 070
071 072 073 074 075 076 077 078 079 080
081 082 083 084 085 086 087 088 089 090
091 092 093 094 095 096 097 098 099 100

MIDI


001 002 003 004 005 006 007 008 009 010
011 012 013 014 015 016 017 018 019 020
021 022 023 024 025 026 027 028 029 030
031 032 033 034 035 036 037 038 039 040
041 042 043 044 045 046 047 048 049 050
051 052 053 054 055 056 057 058 059 060
061 062 063 064 065 066 067 068 069 070
071 072 073 074 075 076 077 078 079 080
081 082 083 084 085 086 087 088 089 090
091 092 093 094 095 096 097 098 099 100

To combine the individual measures, use the humcat command. This command will join two or more Humdrum files into a single data stream. For example, with these two files:

file1.krn:
**kern	**kern
=122	=122
4C	8cc
.	8g
4CC	8e
.	8c
*-	*-
file2.krn:
**kern	**kern
=161	=161
4C	16ee
.	16gg
.	16ee
.	16cc
4D	16b
.	16a
.	16g
.	16f#
*-	*-
The command:
   humcat file1.krn file2.krn
will generate the following composite data:

**kern	**kern
=122	=122
4C	8cc
.	8g
4CC	8e
.	8c
=161	=161
4C	16ee
.	16gg
.	16ee
.	16cc
4D	16b
.	16a
.	16g
.	16f#
*-	*-

humcat can join any Humdrum files which contains the same number of spines and matched exclusive interpretations at the join points.

Suppose the you roll dice with this pattern: "2 5 10 6 3 8 9 9". Then, you can generate the A section of the contra-dance with the following command:

   humcat cda000.krn cda070.krn cda114.krn cda086.krn cda071.krn \
          cda149.krn cda125.krn cda023.krn cda089.krn > partA.krn

If you use the same dice rolls to generate the second section, this is the command which would be run:
   humcat cda155.krn cda157.krn cda029.krn cda019.krn cda031.krn \
          cda080.krn cda096.krn cda127.krn > partB.krn
To generate the final composition, combine partA.krn and partB.krn together:
   humcat partA.krn partA.krn partB.krn > full.krn



Exercises

  1. First, download the individual measures to your local computer. Or, alternatively go to the kernscores website and download a zip file of the source material. Click on the "Z" button on the page:
       http://kern.ccarh.org/cgi-bin/browse?l=dice/mozart
    
  2. Generate an example composition by rolling some dice and using humcat to combine the individual measures into a single Humdrum file. Then convert that file to MIDI and listen to it. Repeat until bored. To generate a large number of variants, download and run this PERL script.

    If you do not have real dice, you can borrow my pair of virtual dice, by typing the command (BASH shell version):

    	NUM=$RANDOM; let "NUM %= 12"; let "NUM += 1"; echo $NUM
    
    Or a PERL language version:
            perl -e "print 2+int(rand(6))+int(rand(6))"
    
    For example, if you roll a 7 and then an 11, then the combining command would be:
           humcat cda000.krn cda165.krn cda085.krn
    
    Which will start the composition with these two measures:

  3. Combine some of the measures in a non-proscribed way. For example, paste the measures together in reverse order. What does the music sound like?

  4. Examine the musical key of each individual measure in the composition. In particular, choose a row from the A or B columns and measure the key in each measure listed on that row. For example, the key of measure 060 which is for roll 11 in the B8 column is in the key of C Major:
       keycor h://dice/mozart/cda060.krn
    
    
          The best key is: C Major
    
    What is the pattern of musical keys for measures in a particular row? What is the pattern of keys in measures in a particular column?

  5. Create a set of realized contradances, then identify the musical key of the dance by using the Humdrum command "key", or the Humdrum Extras command "keycor". Are all of the compositions in the same key or different keys accoring to the key program?