Mozart’s Musikalisches Würfelspiel: Difference between revisions
Make it work in 2.25 |
Don't use q across different measures since it doesn't work after reordering |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
Mozart’s [https://en.wikipedia.org/wiki/Musikalisches_W%C3%BCrfelspiel Musikalisches Würfelspiel] (score [https://imslp.org/wiki/Musikalisches_W%C3%BCrfelspiel,_K.516f_(Mozart,_Wolfgang_Amadeus) available on IMSLP]) is a system to create a waltz by choosing each measure from a list of possibilities, with 759,499,667,166,482 possible waltzes in total. This is an implementation of the Würfelspiel using a bit of Scheme code to select the measures at random, producing a different waltz at each compilation. The code is an instructive example of creating music functions and manipulating music in Scheme. | |||
<lilypond version="2.24"> | <lilypond version="2.24"> | ||
| Line 248: | Line 248: | ||
| <e g>4 r8 | | <e g>4 r8 | ||
| <b d>4 r8 | | <b d>4 r8 | ||
| | | <b d>4 r8 | ||
| <c g'>4 <c e>8 | | <c g'>4 <c e>8 | ||
| <c e>16 g' q g q g | | <c e>16 g' q g q g | ||
| Line 259: | Line 259: | ||
| <g g'>4 g'8 | | <g g'>4 g'8 | ||
| <c, e>16 g' q g q g | | <c, e>16 g' q g q g | ||
| | | <c, e>16 g' q g q g | ||
| | | <c, e>16 g' q g q g | ||
| <c, e>4 r8 | | <c, e>4 r8 | ||
| <e g>4 r8 | | <e g>4 r8 | ||