Skip to main content

Implementation of musical dice games from the 18th century.

Project description

This package features an implementation of various musical dice games by Mozart, Kirnberger and Stadler. These dice games are also known as “Musikalisches Würfelspiel” (German for “musical dice game”).

The earliest printed edition of a dice game is Johann Philipp Kirnberger’s “Der allezeit fertige Menuetten- und Polonaisencomponist” (The ever-ready minuet and polonaise composer”), published in 1757. Afterwards, many composers, such as, for example, C.P.E. Bach, Hayden, and Mozart, published these so called “Musikalische Würfelspiele” (musical dice games) all over Europe. The music style varies roughly between Gregorian chants up to and including the salon pieces of the Romantic period. See [Reuter2013] for more details.

To play a dice game, one would need:

  • two dice

  • a tables sheet with the measure indices

  • a measures sheet with all the numbered bars

  • music paper to write down your composition

The measures and tables where composed by the composer of the dice game and were organized such, that random compilations made a musical composition. To play the game, you would have to throw the dice, and then look up the measure corresponding to your dice throw and your bar index in the dice table. Having found the right bar number, you then select that bar from the measures sheet provided.

This software package automizes the production of these musical pieces. All pieces (tables sheets and measures) have been inserted into this software package and suitable software has been created to allow production of the musical pieces.

For a use case of this library, and more information on these dice games, please visit http://opus-infinity.org, a website by the same author.

For complete functionality, this package requires the following packages to be installed on the user’s system:

  • lilypond, to convert the compositions into midi and pdf files

  • fluidsynth or timidity, for converting midi to wav

  • ffmpeg, to convert wav to other audio formats

  • imagemagick, to prepare the image outputs of the compositions

Python API

The major component of this library is the class “DiceGame”. All dicegames implement this class and its funcions. For use cases, please see the demo’s in the scripts folder.

Technical details

All musical dice games are stored internally using Lilypond bars. When composed into a musical piece, these bars are combined to form a complete piece. The external package Lilypond is then called to convert the composition into a midi file and a pdf file. Next, fluidsynth, or timidity is used to convert the midi to wav, either using a default soundfont, or a user provided soundfont. Afterwards, the composition pdf can be transformed to png for display in, for example, a browser.

[Reuter2013]

Reuter, Christoph. (2013), Der Würfel als Autor, Würfelmusik und Zufallstexte des 17. bis 19. Jahrhunderts. In: Herbert Bannert, Elisabeth Klecker (Hgg.), Autorschaft, Konzeptionen, Transformationen, Diskussionen. Wien, Praesens Verlag. p. 195-222.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

musical_games-0.8.0.tar.gz (83.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

musical_games-0.8.0-py3-none-any.whl (92.1 kB view details)

Uploaded Python 3

File details

Details for the file musical_games-0.8.0.tar.gz.

File metadata

  • Download URL: musical_games-0.8.0.tar.gz
  • Upload date:
  • Size: 83.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for musical_games-0.8.0.tar.gz
Algorithm Hash digest
SHA256 cebf07861fa06bcc40ea018852b31bdc5ffe2555e28d4334ec1a99773ca02920
MD5 f6a8a86e42f9d83f8d2ee6c40494174e
BLAKE2b-256 754810d79a6a1a2c1e2fa5521867591a98d36d7ffd029d0b043f7d0354ead317

See more details on using hashes here.

File details

Details for the file musical_games-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: musical_games-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 92.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for musical_games-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d59af87611dd9188975c03fbda154f72901a802e52f172ed1a9cfb548c730b9
MD5 6764f6c4c9f86d52cabc62c4f1428035
BLAKE2b-256 7a8ee39cb15be41f5113c4341da6f5cb93bba0eeedc43be92db2e8f6e52a2a81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page