Mozart’s musical dice game

Dice animation
Source: MaskOfVirtue

The fol­low­ing is a ver­sion of a Musikalisches Würfelspiel attrib­uted to the Austrian com­pos­er Wolfgang Amadeus Mozart (1756-1791). The source is a man­u­script pub­lished by B. Schott's Söhne (Mainz 39542) con­tain­ing musi­cal frag­ments and their cor­re­spon­dances to num­bers select­ed by rolling two dice.

We will show an imple­men­ta­tion of this game that works with both BP2.9.8 and BP3. The BP3 exam­ple has already been intro­duced in the page Bol Processor ‘BP3’ and its PHP inter­face. Here we will focus on the impro­vi­sa­tion­al aspects.

The imple­men­ta­tion took time because the score frag­ments were not avail­able in dig­i­tal for­mat. Today, sim­i­lar projects can be eas­i­ly han­dled using MusicXML scores and the import pro­ce­dure imple­ment­ed in the Bol Processor BP3.

Set up options

Settings of “-gr.Mozart”
Settings of "-gr.Mozart"

In the set­tings of the gram­mar "-gr.Mozart" (see pic­ture), the option "Non-stop improvize" is checked. This means that the machine is expect­ed to cre­ate and play new vari­a­tions of the theme for­ev­er. On the BP3, in the absence of real-time MIDI, only 10 vari­a­tions are pro­duced, saved in a MIDI or Csound file and imme­di­ate­ly avail­able for lis­ten­ing via the inter­face players.

At the bot­tom of the set­tings, the note con­ven­tion has been set to "French". At the top of it is the "seed for ran­dom­iza­tion" which deserves a comment.

Computers pro­duce sequences of ran­dom num­bers deter­mined by suc­ces­sive calls to the rand() func­tion in the C pro­gram­ming lan­guage. Another func­tion called srand(x) reseeds the sequence with num­ber "x": the seed. A giv­en seed will pro­duce the same sequence for sub­se­quent calls of rand(). The only way to get unpre­dictable sequences is to use a dif­fer­ent seed each time a ran­dom sequence is required. In oth­er words, shuf­fle the cards. To do this, the Bol Processor picks up a seed in the time() func­tion which returns the cur­rent date/time as an inte­ger number.

Here, the seed is set to "999". Unless mod­i­fied, the sequence of vari­a­tions of Mozart's dice game should be iden­ti­cal (on the same com­put­er). In order to gen­er­ate ran­dom sequences we need to instruct the machine to reseed the sequence with an arbi­trary num­ber of its choice. By con­ven­tion, this is done by set­ting the seed to 0.

The result

Below you can hear a sequence of 10 vari­a­tions cre­at­ed with seed = 999. The MIDI file was down­loaded and sent to a PianoTeq syn­the­sis­er tuned to equal temperament:

Ten vari­a­tions of "-gr.Mozart" pro­duced with seed = 999

I remem­ber play­ing vari­a­tions of "-gr.Mozart" to a team of music teach­ers who con­clud­ed enthu­si­as­ti­cal­ly: "That must be Mozart!"

You can also down­load the MIDI file and send it to a MIDI device. Below is anoth­er set of vari­a­tions sent by BP2.9.8 to a Roland D-50 syn­the­sis­er whose split patch assigned notes to dif­fer­ent instru­ments accord­ing to their tonal position:

Variations of "-gr.mozart" played on a split patch of Roland D-50

The same can be achieved by using _chan() or _ins() instruc­tions in the gram­mar to assign instru­ments via reserved MIDI chan­nels or their indices in Csound.

These exam­ples are played on elec­tron­ic instru­ments tuned to equal tem­pera­ment. However, Bol Processor + Csound can pro­duce the same by exploit­ing micro­tonal­i­ty to pro­duce works tuned in dif­fer­ent tem­pera­ments or in pure into­na­tion. Below is the same set of pieces using Zarlino's mean­tone tem­pera­ment (Asselin 2000 p. 85):

Mozart's musi­cal dice game in Zarlino's mean­tone temperament

Finally, "just into­na­tion" can be achieved by retun­ing the instru­ment at each mea­sure to match the har­mon­ic con­text, as explained on the page Just into­na­tion, a gen­er­al frame­work. This gives the fol­low­ing inter­pre­ta­tion — the best tun­ing, in my opinion:

Mozart's musi­cal dice game in just intonation

The MIDI for­mat does not allow for these pre­cise context-sensitive micro­ton­al adjustments.

The stochastic model

A chal­leng­ing aspect of this game is that there is no equal prob­a­bil­i­ty of get­ting num­bers in the range 2 … 12. For exam­ple, a sum of 7 is six times more like­ly than a sum of 2 or 12. The design­er of this game may have been aware of this, as the less like­ly num­bers have been mapped to musi­cal sequences that sound more "dis­so­nant".

In order to sim­u­late the dice game, it was there­fore nec­es­sary to assign weights to the rules that reflect­ed the real prob­a­bil­i­ties. This was achieved in the gram­mar (below) by assign­ing weights K1, K2 etc. to all rules acti­vat­ed by dice rolls.

-se.Mozart
// Use a harp­si­chord or piano sound
LIN [Select rules ran­dom­ly and apply from left to right]
gram#1[1] S --> _vel(80) A B
gram#1[2] A --> A1 A2 A3 A4 A5 A6 A7 A8 A1 A2 A3 A4 A5 A6 A7 A'8
gram#1[3] B --> B1 B2 B3 B4 B5 B6 B7 B8 B1 B2 B3 B4 B5 B6 B7 B8
LIN
gram#2[1] <K1=1> A1 --> T96
gram#2[2] <K2=2> A1 --> T32
gram#2[3] <K3=3> A1 --> T69
gram#2[4] <K4=4> A1 --> T40
gram#2[5] <K5=5> A1 --> T148
gram#2[6] <K6=6> A1 --> T104
gram#2[7] <K7=5> A1 --> T152
gram#2[8] <K8=4> A1 --> T119
gram#2[9] <K9=3> A1 --> T98
gram#2[10] <K10=2> A1 --> T3
gram#2[11] <K11=1> A1 --> T54
LIN [These rules could be mixed with the pre­ced­ing ones. But pro­duc­tion is faster in this way.]
gram#3[1] <K1> A2 --> T22
gram#3[2] <K2> A2 --> T6
gram#3[3] <K3> A2 --> T95
gram#3[4] <K4> A2 --> T17
gram#3[5] <K5> A2 --> T74
gram#3[6] <K6> A2 --> T157
gram#3[7] <K7> A2 --> T60
gram#3[8] <K8> A2 --> T84
gram#3[9] <K9> A2 --> T142
gram#3[10] <K10> A2 --> T87
gram#3[11] <K11> A2 --> T130
LIN
gram#4[1] <K1> A3 --> T141
gram#4[2] <K2> A3 --> T128
gram#4[3] <K3> A3 --> T158
gram#4[4] <K4> A3 --> T113
gram#4[5] <K5> A3 --> T163
gram#4[6] <K6> A3 --> T27
gram#4[7] <K7> A3 --> T171
gram#4[8] <K8> A3 --> T114
gram#4[9] <K9> A3 --> T42
gram#4[10] <K10> A3 --> T165
gram#4[11] <K11> A3 --> T10
LIN
gram#5[1] <K1> A4 --> T41
gram#5[2] <K2> A4 --> T63
gram#5[3] <K3> A4 --> T13
gram#5[4] <K4> A4 --> T85
gram#5[5] <K5> A4 --> T45
gram#5[6] <K6> A4 --> T167
gram#5[7] <K7> A4 --> T53
gram#5[8] <K8> A4 --> T50
gram#5[9] <K9> A4 --> T156
gram#5[10] <K10> A4 --> T61
gram#5[11] <K11> A4 --> T103
LIN
gram#6[1] <K1> A5 --> T105
gram#6[2] <K2> A5 --> T146
gram#6[3] <K3> A5 --> T153
gram#6[4] <K4> A5 --> T161
gram#6[5] <K5> A5 --> T80
gram#6[6] <K6> A5 --> T154
gram#6[7] <K7> A5 --> T99
gram#6[8] <K8> A5 --> T140
gram#6[9] <K9> A5 --> T75
gram#6[10] <K10> A5 --> T135
gram#6[11] <K11> A5 --> T28
LIN
gram#7[1] <K1> A6 --> T122
gram#7[2] <K2> A6 --> T46
gram#7[3] <K3> A6 --> T55
gram#7[4] <K4> A6 --> T2
gram#7[5] <K5> A6 --> T97
gram#7[6] <K6> A6 --> T68
gram#7[7] <K7> A6 --> T133
gram#7[8] <K8> A6 --> T86
gram#7[9] <K9> A6 --> T129
gram#7[10] <K10> A6 --> T47
gram#7[11] <K11> A6 --> T37
LIN
gram#8[1] <K1> A7 --> T11
gram#8[2] <K2> A7 --> T134
gram#8[3] <K3> A7 --> T110
gram#8[4] <K4> A7 --> T159
gram#8[5] <K5> A7 --> T36
gram#8[6] <K6> A7 --> T118
gram#8[7] <K7> A7 --> T21
gram#8[8] <K8> A7 --> T169
gram#8[9] <K9> A7 --> T62
gram#8[10] <K10> A7 --> T147
gram#8[11] <K11> A7 --> T106
LIN
gram#9[1] A8 --> T5
gram#9[2] A'8 --> T'5
LIN
gram#10[1] <K1> B1 --> T70
gram#10[2] <K2> B1 --> T117
gram#10[3] <K3> B1 --> T66
gram#10[4] <K4> B1 --> T90
gram#10[5] <K5> B1 --> T25
gram#10[6] <K6> B1 --> T138
gram#10[7] <K7> B1 --> T16
gram#10[8] <K8> B1 --> T120
gram#10[9] <K9> B1 --> T65
gram#10[10] <K10> B1 --> T102
gram#10[11] <K11> B1 --> T35
LIN
gram#11[1] <K1> B2 --> T121
gram#11[2] <K2> B2 --> T39
gram#11[3] <K3> B2 --> T139
gram#11[4] <K4> B2 --> T176
gram#11[5] <K5> B2 --> T143
gram#11[6] <K6> B2 --> T71
gram#11[7] <K7> B2 --> T155
gram#11[8] <K8> B2 --> T88
gram#11[9] <K9> B2 --> T77
gram#11[10] <K10> B2 --> T4
gram#11[11] <K11> B2 --> T20
LIN
gram#12[1] <K1> B3 --> T26
gram#12[2] <K2> B3 --> T126
gram#12[3] <K3> B3 --> T15
gram#12[4] <K4> B3 --> T7
gram#12[5] <K5> B3 --> T64
gram#12[6] <K6> B3 --> T150
gram#12[7] <K7> B3 --> T57
gram#12[8] <K8> B3 --> T48
gram#12[9] <K9> B3 --> T19
gram#12[10] <K10> B3 --> T31
gram#12[11] <K11> B3 --> T108
LIN
gram#13[1] <K1> B4 --> T9
gram#13[2] <K2> B4 --> T56
gram#13[3] <K3> B4 --> T132
gram#13[4] <K4> B4 --> T34
gram#13[5] <K5> B4 --> T125
gram#13[6] <K6> B4 --> T29
gram#13[7] <K7> B4 --> T175
gram#13[8] <K8> B4 --> T166
gram#13[9] <K9> B4 --> T82
gram#13[10] <K10> B4 --> T164
gram#13[11] <K11> B4 --> T92
LIN
gram#14[1] <K1> B5 --> T112
gram#14[2] <K2> B5 --> T174
gram#14[3] <K3> B5 --> T73
gram#14[4] <K4> B5 --> T67
gram#14[5] <K5> B5 --> T76
gram#14[6] <K6> B5 --> T101
gram#14[7] <K7> B5 --> T43
gram#14[8] <K8> B5 --> T51
gram#14[9] <K9> B5 --> T137
gram#14[10] <K10> B5 --> T144
gram#14[11] <K11> B5 --> T12
LIN
gram#15[1] <K1> B6 --> T49
gram#15[2] <K2> B6 --> T18
gram#15[3] <K3> B6 --> T58
gram#15[4] <K4> B6 --> T160
gram#15[5] <K5> B6 --> T136
gram#15[6] <K6> B6 --> T162
gram#15[7] <K7> B6 --> T168
gram#15[8] <K8> B6 --> T115
gram#15[9] <K9> B6 --> T38
gram#15[10] <K10> B6 --> T59
gram#15[11] <K11> B6 --> T124
LIN
gram#16[1] <K1> B7 --> T109
gram#16[2] <K2> B7 --> T116
gram#16[3] <K3> B7 --> T145
gram#16[4] <K4> B7 --> T52
gram#16[5] <K5> B7 --> T1
gram#16[6] <K6> B7 --> T23
gram#16[7] <K7> B7 --> T89
gram#16[8] <K8> B7 --> T72
gram#16[9] <K9> B7 --> T149
gram#16[10] <K10> B7 --> T173
gram#16[11] <K11> B7 --> T44
LIN
gram#17[1] <K1> B8 --> T8
gram#17[2] <K2> B8 --> T78
gram#17[3] <K3> B8 --> T8
gram#17[4] <K4> B8 --> T8
gram#17[5] <K5> B8 --> T8
gram#17[6] <K6> B8 --> T8
gram#17[7] <K7> B8 --> T8
gram#17[8] <K8> B8 --> T8
gram#17[9] <K9> B8 --> T8
gram#17[10] <K10> B8 --> T8
gram#17[11] <K11> B8 --> T8
SUB1 [Substitute only once.]
gram#18[1] T1 --> {fa3 re3 sol3,fa5 re5 sol5}
gram#18[2] T2 --> {{2,si2,sol3}-,la4 {2,fa#4 sol4 si4 sol5}}
gram#18[3] T3 --> {{2,do3,mi3}-,sol5 do5 mi5}
gram#18[4] T4 --> {{1,sol2 si2} sol3 si2,sol5 re5_}
gram#18[5] T5 --> {sol2 {2,sol3 fa3 mi3 re3}, {2,sol4,si4,re5,sol5}-}
gram#18[6] T'5 --> {sol2 {2,si3 sol3 fa#3 mi3}, {2,sol4,si4,re5,sol5}-}
gram#18[7] T6 --> {{2,do3,mi3}-,sol4 do5 mi5}
gram#18[8] T7 --> {{2,do3,sol3}-,mi5 do5 mi5 sol5 do6 sol5}
gram#18[9] T8 --> {do3 sol2 do2,do5_ -}
gram#18[10] T9 --> {sol3_ sol2,{do5,mi5}{si4,re5}-}
gram#18[11] T10 --> {sol3_ -,si4 la4 si4 do5 re5 si4}
gram#18[12] T11 --> {do3 re3 re2,mi5 do5 si4 la4 sol4 fa#4}
gram#18[13] T12 --> {do3 do3 do3,{mi4 mi4 mi4},{do5 do5 do5}}
gram#18[14] T13 --> {{2,mi3,sol3}-,do5 sol4 mi4}
gram#18[15] T15 --> {{2,do3,sol3}{do3,mi3},mi5 {1,sol5 mi5}do5}
gram#18[16] T16 --> {{2,re3,fa#3}{do3,fa#3},la5 fa#5 re5}
gram#18[17] T17 --> {{2,mi3,sol3}-,do5 sol4 do5 mi5 sol4 do5}
gram#18[18] T18 --> {{2,do3,mi3}{do3,sol3},sol4 do5 mi5}
gram#18[19] T19 --> {{2,do3,sol3}{do3,mi3},{1,mi5 do5}mi5 sol5}
gram#18[20] T20 --> {si2_ -,sol5{1,si5 re6}re5}
gram#18[21] T21 --> {do3 re3 re2,do5 mi5 sol5 re5 la4 fa#5}
gram#18[22] T22 --> {do3_ -,mi5 do5 sol4}
gram#18[23] T23 --> {{3,fa3 mi3 re3 mi3 fa3 sol3},fa5 mi5 re5 mi5 fa5 sol5}
gram#18[24] T25 --> {re3_ do3,re4 fa#4 la4 re5 fa#5 la5}
gram#18[25] T26 --> {{3,do3 mi3 sol3 mi3 do4 do3}, {do5,mi5}{do5,mi5}{do5,mi5}}
gram#18[26] T27 --> {{2,sol3,si3}-,fa5 mi5 fa5 re5 do5 si4}
gram#18[27] T28 --> {{2,do3,la3}-,fa#5 re5 la4 la5 fa#5 re5}
gram#18[28] T29 --> {sol3_ sol2,{2,si4 re5 sol5 re5}si4}
gram#18[29] T31 --> {{2,do3,sol3}{do3,sol3},{1,mi5 do5}sol4 mi5}
gram#18[30] T32 --> {{2,do3,mi3}-,sol4 do5 mi5}
gram#18[31] T34 --> {sol3_ -,{2,mi5 do5 re5 si4} sol4}
gram#18[32] T35 --> {{2,re3,fa#3}{do3,la3},la4 re5 fa#5}
gram#18[33] T36 --> {do3 re3 re2,la4 mi5 re5 sol5 fa#5 la5}
gram#18[34] T37 --> {{2,si2,re3}-,{2,sol5 si5 sol5 re5}si4}
gram#18[35] T38 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_}, do5 sol4 mi5}
gram#18[36] T39 --> {{3,si2 re3 sol3 re3 si2 sol2},sol5 sol4 sol4}
gram#18[37] T40 --> {{2,do3,mi3}-,do5 si4 do5 mi5 sol4 do5}
gram#18[38] T41 --> {{2,do3,mi3}-,{2,do5 si4 do5 mi5} sol4}
gram#18[39] T42 --> {sol2_ -,si4 do5 re5 si4 la4 sol4}
gram#18[40] T43 --> {{2,do3,mi3}-,sol5{2,fa5 mi5 re5 do5}}
gram#18[41] T44 --> {fa3_ sol3,la4{2,fa5 re5 la4 si4}}
gram#18[42] T45 --> {{2,mi3,sol3}-,do5 si4 do5 sol4 mi4 do4}
gram#18[43] T46 --> {{2,si2,re3}-,sol5{2,si5 sol5 re5 si4}}
gram#18[44] T47 --> {{2,si2,re3}-,sol5{1,sol5 re5}si5}
gram#18[45] T48 --> {{2,do3,sol3}{do3,mi3},mi5{2,do5 mi5 sol5 do6}}
gram#18[46] T49 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},mi5 do5 sol4}
gram#18[47] T50 --> {{2,mi3,sol3}-,do5{1,mi5 do5}sol4}
gram#18[48] T51 --> {{2,do3,mi3}-,do5 sol4 mi5 do5 sol5 mi5}
gram#18[49] T52 --> {fa3_ sol3,re5 do#5 re5 fa5 sol4 si4}
gram#18[50] T53 --> {do3_ -,{do5,mi5}{1,do5 re5,mi5 fa5}{mi5,sol5}}
gram#18[51] T54 --> {do3 do3 do3,{mi4,do5}{mi4,do5}{mi4,do5}}
gram#18[52] T55 --> {{2,si2,re3}-,sol5 si5 re5}
gram#18[53] T56 --> {{2,sol2,sol3}sol3,{1,re5 si4}sol4 -}
gram#18[54] T57 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},mi5 do5 sol4}
gram#18[55] T58 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 mi5 do5}
gram#18[56] T59 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 do5 mi5}
gram#18[57] T60 --> {{2,do3,mi3}-,sol5{2,fa5 mi5 re5 do5}}
gram#18[58] T61 --> {{2,mi3,sol3}-,do5{1,mi5 do5}sol5}
gram#18[59] T62 --> {do3 re3 re2,mi5 do5 si4 sol4 la4 fa#4}
gram#18[60] T63 --> {do3_ -,{2,mi5 do5 si4 do5} sol4}
gram#18[61] T64 --> {{2,do3,sol3}{do3,sol3},mi5 sol5 do6 sol5 mi5 do5}
gram#18[62] T65 --> {{2,re3 fa#3}-,{1,re5 la4}re5 fa#5}
gram#18[63] T66 --> {{re3,la3}{re3,fa#3}{do3,re3},fa#5 la5 fa#5}
gram#18[64] T67 --> {{2,do3,mi3}{mi3,sol3},do5 si4 do5 mi5 sol4 do5}
gram#18[65] T68 --> {si2_ -,sol5{2,si5 sol5 re5 sol5}}
gram#18[66] T69 --> {{2,do3,mi3}-,sol5 mi5 do5}
gram#18[67] T70 --> {re3_ do3,fa#5{2,la5 fa#5 re5 fa#5}}
gram#18[68] T71 --> {{2,si2,re3}{si2,re3},{2,sol5 si5 re6 si5} sol5}
gram#18[69] T72 --> {fa3_ sol3,fa5 mi5 re5 do5 si4 re5}
gram#18[70] T73 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 mi5 do5}
gram#18[71] T74 --> {{2,do3,mi3}-,do6 si5 do6 sol5 mi5 do5}
gram#18[72] T75 --> {do3 do3 do3,{re5,fa#5}{re5,fa#5}{re5,fa#5}}
gram#18[73] T76 --> {{2,do3,mi3}{do3,sol3},do6 si5 do6 sol5 mi5 do5}
gram#18[74] T77 --> {{2,si2,re3}{si2,sol3},{1,sol5 si5}sol5 re5}
gram#18[75] T78 --> {do3_ do2,do5 do4 -}
gram#18[76] T80 --> {do3_ -,re5 la4 fa#5}
gram#18[77] T82 --> {{2,si2,sol3}{si2,re3},{1,re5 si4}sol4 sol5}
gram#18[78] T84 --> {{2,do3,mi3}-,do5 sol4 mi5 do5 sol5 mi5}
gram#18[79] T85 --> {{2,mi3,sol3}-,do5 mi5 sol4}
gram#18[80] T86 --> {{2,si2,sol3}-,re5{1,re5 sol5}si5}
gram#18[81] T87 --> {{2,do3,mi3}{do3,sol3},sol5 do5 mi5}
gram#18[82] T88 --> {{2,si2,re3}{si2,re3},sol5 re5 sol5 si5 sol5 re5}
gram#18[83] T89 --> {{1,fa3 mi3}re3 sol3,{1,fa5 mi5}re5 sol5}
gram#18[84] T90 --> {{2,do3,la3}{do3,la3},fa#5 la5 re6 la5 fa#5 la5}
gram#18[85] T92 --> {{2,sol2,sol3}sol3,{si4,re5}{1,sol5 si5}re5}
gram#18[86] T95 --> {{2,do3,mi3}-,sol5 mi5 do5}
gram#18[87] T96 --> {do3_ -,mi5 do5 sol4}
gram#18[88] T97 --> {{2,si2,re3}{si2,sol3},sol5 fa#5 sol5 re5 si4 sol4}
gram#18[89] T98 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},do5 sol4 mi5}
gram#18[90] T99 --> {{2,do3,la3}{do3,la3},fa#5 la5 re5}
gram#18[91] T101 --> {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5}
gram#18[92] T102 --> {{2,do3,la3}{do3,la3},{1,fa#5 re5}la4 fa#5}
gram#18[93] T103 --> {{2,mi3,sol3}-,{2,do5 mi5 do5 sol4} mi4}
gram#18[94] T104 --> {do3_ -,mi5 re5 mi5 sol5 do6 sol5}
gram#18[95] T105 --> {do3_ -,fa#5{2,la5 fa#5 re5 fa#5}}
gram#18[96] T106 --> {do3 re3 re2,la4{2,re5 do5 si4 la4}}
gram#18[97] T108 --> {{2,do3,sol3}{do3,mi3},mi5 sol5 do6}
gram#18[98] T109 --> {{2,fa3,la3}{sol3,re4},re5 fa5 re5 fa5 si4 re5}
gram#18[99] T110 --> {do3 re3 re2,si4 la4 la4 sol4 sol4 fa#4,re5 do5 do5 si4 si4 la4}
gram#18[100] T112 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},mi5 do5 sol4}
gram#18[101] T113 --> {{2,sol3,si3}-,fa5 re5 si4}
gram#18[102] T114 --> {sol3 sol3 sol3,{si4,re5}{si4,re5}{si4,re5}}
gram#18[103] T115 --> {{2,do3,mi3}-,do5 sol4 mi5 do5 sol5 mi5}
gram#18[104] T116 --> {fa3_ sol3,re5 fa5 la5 fa5 re5 si4}
gram#18[105] T117 --> {{2,re3,fa#3}-,re5 la4 re5 fa#5 la5 fa#5}
gram#18[106] T118 --> {do3 re3 re2,mi5 la5 sol5 si5 fa#5 la5}
gram#18[107] T119 --> {{2,do3,mi3}-,mi5 do5 sol5 mi5 do6 sol5}
gram#18[108] T120 --> {{2,re3,fa#3}{do3,fa#3},re6{2,la5 fa#5 re5 la4}}
gram#18[109] T121 --> {{2,si2,sol3}-,sol5{1,si5 sol5}re5}
gram#18[110] T122 --> {{si2,re3}{si2,re3}{si2,re3},{2,sol5 fa#5 sol5 si5} re5}
gram#18[111] T124 --> {do3 do3 do3,{mi4,do5}{mi4,do5}{mi4,do5}}
gram#18[112] T125 --> {sol3 sol2 -,{2,sol5 mi5 re5 si4}sol4}
gram#18[113] T126 --> {mi3_ {1,mi3 do3},do5 sol4 do5 mi5 sol5 {do5,mi5}}
gram#18[114] T128 --> {sol2_ -,si4 re5 sol5}
gram#18[115] T129 --> {{si2,re3}{si2,re3}{si2,sol3},{2,la5 sol5 fa#5 sol5}re5}
gram#18[116] T130 --> {do3 do3 do3,mi4 mi4 mi4,do5 do5 do5}
gram#18[117] T132 --> {sol3 sol2 -,{do5,mi5}{1,si4 sol4,re5 si4}sol4}
gram#18[118] T133 --> {{2,si2,sol3}-,re5{2,sol5 re5 si4 re5}}
gram#18[119] T134 --> {do3 re3 re2,la4 mi5{si4,re5}{la4,do5}{sol4,si4}{fa#4,la4}}
gram#18[120] T135 --> {{do3,re3}{do3,re3}{do3,re3},fa#5{1,fa#5 re5}la5}
gram#18[121] T136 --> {{2,do3,mi3}-,do6 si5 do6 sol5 mi5 do5}
gram#18[122] T137 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},do5 sol4 mi5}
gram#18[123] T138 --> {{3,re2 re3 do#3 re3 do3 re3},{la4,re5,fa#5}fa#5_}
gram#18[124] T139 --> {si2_ -,{2,sol5 si5 sol5 si5}re5}
gram#18[125] T140 --> {{do3,fa#3}{do3,fa#3}{do3,la3},la4{1,la4 re5}fa#5}
gram#18[126] T141 --> {{2,si2,sol3}sol2,re5 mi5 fa5 re5 do5 si4}
gram#18[127] T142 --> {{2,do3,mi3}-,do5 sol4 mi5}
gram#18[128] T143 --> {{2,si2,re3}{si2,re3},sol5{1,re5 si4}sol4}
gram#18[129] T144 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 do5 mi5}
gram#18[130] T145 --> {fa3_ sol3,re5 fa5 la4 re5 si4 re5}
gram#18[131] T146 --> {do3 do3 do3,{fa#4,re5}{re5,fa#5}{fa#5,la5}}
gram#18[132] T147 --> {do3 re3 re2,mi5 do6 si5 sol5 la5 fa#5}
gram#18[133] T148 --> {{2,do3,mi3}-,do6 si5 do6 sol5 mi5 do5}
gram#18[134] T149 --> {fa3_ sol3,{1,fa5 re5}la4 si4}
gram#18[135] T150 --> {{3,do3 si2 do3 re3 mi3 fa#3},{sol4,do5,mi5}mi5_}
gram#18[136] T152 --> {{2,do3,mi3}-,sol5{2,fa5 mi5 re5 do5}}
gram#18[137] T153 --> {do3_ -,re5 la4 fa#5 re5 la5 fa#5}
gram#18[138] T154 --> {do3_ -,re5 do#5 re5 fa#5 la5 fa#5}
gram#18[139] T155 --> {{2,si2,re3}-,sol5 si5 sol5 re5 si4 sol4}
gram#18[140] T156 --> {{2,mi3,sol3}-,{2,do5 sol4 mi5 do5} sol5}
gram#18[141] T157 --> {do3_ -,mi5 re5 mi5 sol5 do6 sol5}
gram#18[142] T158 --> {sol2_ -,si4{2,re5 si4 la4 sol4}}
gram#18[143] T159 --> {do3 re3 re2,mi5 sol5 re5 do5 si4 la4}
gram#18[144] T160 --> {{2,do3,mi3}{do3,mi3},do5 si4 do5 mi5 sol4 do5}
gram#18[145] T161 --> {do3 do3 do3,{fa#4,re5}{fa#4,re5}{fa#4,re5}}
gram#18[146] T162 --> {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5}
gram#18[147] T163 --> {{2,si2,re3}-,sol5 fa#5 sol5 re5 si4 sol4}
gram#18[148] T164 --> {{3,sol3 fa#3 sol3 re3 si2 sol3},re5 sol4_}
gram#18[149] T165 --> {si2_ -,re5 si4 sol4}
gram#18[150] T166 --> {{2,sol3,si3}-,{2,re5 si5 sol5 re5}si4}
gram#18[151] T167 --> {{2,do3,mi3}-,do5{1,do5 re5}mi5}
gram#18[152] T168 --> {{2,do3,mi3}{mi3,sol3},sol5{2,fa5 mi5 re5 do5}}
gram#18[153] T169 --> {do3 re3 re3,mi5 sol5 re5 sol5 la4 fa#5}
gram#18[154] T171 --> {{2,sol2,sol3}{si2,sol3},si4 do5 re5 mi5 fa5 re5}
gram#18[155] T173 --> {fa3_ sol3,{1,fa5 la5}la4{1,si4 re5}}
gram#18[156] T174 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol4 do5 mi5}
gram#18[157] T175 --> {sol3 sol2 -,{2,mi5 do5 si4 re5}sol5}
gram#18[158] T176 --> {{2,si2,re3}{si2,re3},la5 sol5 si5 sol5 re5 sol5}
COMMENT:
This is Mozart's musi­cal dice game…
[Source: B. Schott's Söhne, Mainz 39542]

Sound-object and pianoroll displays of a polymetric expression {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5} produced by T162 in "-gr.Mozart"
Sound-object and pianoroll dis­plays of a poly­met­ric expres­sion {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5} pro­duced by T162 in "-gr.Mozart"

Subgrammars #1 to #17 rewrite the work string — ini­tial­ly "S" — as strings of vari­ables "A1", "A2", "B1", "T96" etc. The num­bers of the "T-variables" are tak­en from tables in the game.

Subgrammar #18 rewrites each "T-variable" as a poly­met­ric expres­sion of ter­mi­nal sym­bols (sim­ple notes). For exam­ple, "la3" is equiv­a­lent to "A4" in English which is set to 440 Hz in "-se.Mozart". This instru­ment can be tuned.

The pic­tures show self-explanatory pianoroll and sound-object dis­plays of the poly­met­ric expres­sion pro­duced by "T162":

{{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5}

Octave numbering and diapason

When we cap­tured notes from a MIDI key­board to con­struct the rules for sub­gram­mar #18, we had the Bol Processor set up incor­rect­ly due to con­fu­sion over octave num­ber­ing in the English and French conventions.

In English, the "mid­dle C" on a piano key­board is called "C4" and its num­ber is 60. In French, the key with the same num­ber is called "do3". When we mis­tak­en­ly called it "do4", all the notes were writ­ten an octave higher…

After fix­ing the prob­lem on BP2, there were two ways to cor­rect the octave shift:

  • Set the "Middle C" num­ber to 48 
  • Keep the stan­dard "Middle C" = "C4" = 60 and trans­pose the whole piece down 12 semi­tones:
    S --> _transpose(-12) _vel(80) A B

We believe that the sec­ond solu­tion makes more sense because it is based on a uni­ver­sal stan­dard of key numbering.

Both solu­tions have the same cor­rec­tive effect on the Csound score: only note names will change, for exam­ple "mi5" is replaced with "mi4" but both octave point pitch-class nota­tions remain "9.04".

Settings on -gr.Mozart

On the Settings page the dia­pa­son (fre­quen­cy of "A4") is set to 440 Hz which is the most com­mon stan­dard for tun­ing instru­ments. If "A4" was num­bered 48 this fre­quen­cy should be low­ered to 220 Hz.

However, this dia­pa­son set­ting has no effect on the tonal­i­ty of pieces pro­duced by "-gr.Mozart" in MIDI for­mat. The real-time MIDI stream or MIDI file will be played by MIDI devices — such as the MIDIjs javascript play­er — using their own default set­ting of "A4".

In the Bol Processor BP2, the fre­quen­cy of "A4" also had no effect on the Csound out­put. In the orches­tra file "default.orc", the oscil­la­tor para­me­ter kpitch was derived from the octave point pitch-class para­me­ter p4 via the func­tion cpspch() also using the default 440 Hz dia­pa­son = cpspch(8.09) — see doc­u­men­ta­tion. This has been changed in BP3, using an updat­ed ver­sion of "default.orc". See Csound tun­ing in BP3 for more details.

References

Asselin, P.-Y. Musique et tem­péra­ment. Paris, 1985, repub­lished in 2000: Jobert. Soon avail­able in English.

3 Replies to “Mozart’s musical dice game”

  1. As an engi­neer rather than a musi­cian, I have long been inter­est­ed in the clever com­pro­mise of equal tem­pera­ment. Now that I am used to hear­ing equal-temperament key­boards, I find that your just-intonation exam­ple to sound dull by com­par­i­son, as the beats of equal tem­pera­ment are part of the char­ac­ter of the sound that I am used to hear­ing. I won­der whether the addi­tion­al beats intro­duced by tun­ing octaves slight­ly wide add to the char­ac­ter of music played on the piano.

    1. I ful­ly agree with this. The just-intonation mod­el is a the­o­ret­i­cal one with no real exis­tence on con­ven­tion­al key­board instru­ments. Much like the Pythagorean the­o­rem nev­er applies to tri­an­gles on the sur­face of the earth or in curved space… In terms of per­cep­tion, hear­ing just-intonation inter­vals pro­duced by sounds repro­duc­ing phys­i­cal instru­ments is anal­o­gous to look­ing at per­fect con­cen­tric cir­cles drawn over a web of per­fect squares: you need "adjust­ments" of these cir­cles for them to look "cor­rect"!
      Somehow, imper­fec­tion is more per­fect… In speech prosody, for instance, we observe that speak­ers are aim­ing at tonal tar­gets that they do not reach, although they could. If they reach tar­gets their speech sounds like ridicu­lous­ly singing…

    2. Another fac­tor is the "accu­mu­la­tion" of musi­cal expe­ri­ence. Supporters of just (or "pure") into­na­tion claim that we lost the abil­i­ty to appre­ci­ate its val­ue, so we should train back our ears to reach what they con­sid­er the high­est ren­der­ing of music — along with mys­ti­cal cono­ta­tions. This is also a belief of Indian musi­cians claim­ing to fol­low the grama-murcchana mod­el for the into­na­tion of raga (read Raga into­na­tion).

      Indeed, there is no oth­er way to sub­stan­ti­ate these claims than under­go­ing the train­ing process. It hap­pened to me, lis­ten­ing to Darius Milhaud's La Création du monde many times as I was tak­ing part in a chore­o­graph­ic ren­der­ing of this work. I did not like it in the begin­ning, think­ing it sound­ed like "bad jazz". After a few months it start­ed sound­ing bet­ter and bet­ter because I grad­u­al­ly lost my implic­it ref­er­ence to jazz. I could at last enjoy its poly­tonal­i­ty in the way Milhaud had per­ceived it, being exposed to mixed jazz per­for­mance sounds from the win­dow of his room in New Orleans — as his wife lat­er explained.

      I am tempt­ed to say that we can't enjoy musi­cal works played with the style and instru­ments avail­able at the time they were com­posed, because both have evolved over decades or cen­turies. Concerts of Chopin's music (by great per­form­ers) using instru­ments of his time sound hor­rif­ic to my ears!

Leave a Reply

Your email address will not be published. Required fields are marked *