Skip to content

Bash script for generating Musical Dice Games minuets (based on K. 516f, Mozart)

License

Notifications You must be signed in to change notification settings

justineuro/mdginabc2svg

Repository files navigation

mdginabc2svg.sh

mdginacb2svg.sh is a Bash script (see Wikipedia:Bash_(Unix_shell) for more info) that can be used for creating an XHTML file containing the score of a particular Musical Dice Game (MDG) minuet, generated based on the rules given in Musikalisches Würfelspiel, K.516f (Mozart, Wolfgang Amadeus). The generated XHTML file contains the musical score for an MDG written in ABC music notation and is rendered using Jeff Moine's abc2svg javascripts (v. 1.22.13; 2024-02-23); the javascripts in the samples folder were created from source). To view the generated musical score, open it in a javascript-enabled web browser; to listen to the corresponding music, simply click (or tap, for mobiles) on the image of the musical score inside the browser (click (tap) or reload the page to prematurely stop).

This directory includes:

  • mdginabc2svg.sh - a Bash script for generating the MDG minuets corresponding to any sequence of 16 tosses of a pair of dice
  • mdginac2svg-sm.sh - similar to mdginabc2svg.sh but smaller SVG images are created
  • mdginac2svg-tab2.sh - similar to mdginabc2svg.sh but coded with tabs of width 2 instead of 8 spaces
  • samples - also accessible at samples; a folder containing samples of generated MDG minuets as XHTML files and a sub-folder containing the needed javascripts for rendering the minuet written in ABC notation as SVG images
  • res - also accessible at res; a folder containing the measures of Musikalisches Würfelspiel, K.516f written in ABC notation and other related files

To use the Bash script, at the command line type:

/path/to/mdginabc2svg.sh n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n15 n16

where n1, n2, ..., n16 are any of the 11 possible outcomes of the toss of two ordinary six-sided dice, e.g., are 16 integers, not necessarily unique, chosen from the set {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}. For example, if the script is located in the present working directory and each outcome of the 16 dice tosses was a 3:

./mdginabc2svg.sh 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

The output will be the file K516f-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3.xhtml, containing the score of the MDG minuet corresponding to the 16 outcomes given at the command line (all tosses came up a 3), and will be created under the current working directory. Please see the samples folder in this directory for more sample XHTML files.

Acknowledgements

My sincerest gratitude to Jeff Moine for abcm2ps, abc2svg, and the accompanying useful javascripts, examples, templates, and pointers for the appropriate use of these resources. Guido Gonzato for the ABC Plus Project and the abcmidi resources available there, more especially for the ABC resource book Making Music with ABC 2. Special thanks also to the International Music Score Library Project (IMSLP) for making available the score for Musikalisches Würfelspiel, K.516f and to Chris Walshaw et al. for the ABC music notation. Ditto to Machtelt Garrels for the book Bash Guide for Beginners and Vivek Gite for the book Linux Script Shell Tutorial. Much thanks, too, to the Debian Project for the Debian 8 (Jessie) GNU/Linux OS, to Brian Fox for Bash, and GitHub for its generosity in providing space for this project.

License

Creative Commons License
mdginabc2svg by Justine Leon A. Uro is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/justineuro/mdginabc2svg.

Releases

No releases published

Packages

No packages published

Languages