No release in over 3 years
Low commit activity in last 3 years
Inevitable Cacophony processes the musical form descriptions generated by Dwarf Fortress. It can parse a form to Ruby data structures, and in turn use that data to generate (simple) MIDI or WAV audio in that style.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 0.12.2
= 3.8.0

Runtime

~> 2.0.5
~> 1.0.1
 Project Readme

Inevitable Cacophony

Build Status Maintainability

An attempt to automatically generate music in Dwarf Fortress' generated musical styles.

Usage

Installation:

gem install inevitable_cacophony

Then run Inevitable Cacophony through the executable (there isn't a stable Ruby API yet). To play a specific rhythm (in the notation Dwarf Fortress uses):

inevitable_cacophony --beat -e '| ! x X x |' > rhythm.wav

You can also play polyrhythms where each component rhythm is simply | x x ... x |. (More complex rhythms are possible but you'll need to write out a full musical form to describe them.)

inevitable_cacophony --beat --polyrhythm 7:11 > polyrhythm.wav

To generate a tune from a given form description (support is pretty limited so far):

inevitable_cacophony < form_description.txt > form.wav

At this stage you will need to type out the game's form description by hand to use as input.

See inevitable_cacophony --help for other options and features.

Output Format

Inevitable Cacophony generates output as uncompressed WAV on standard output. You could save this as a file (as shown), or pipe into a tool such as aplay to hear it immediately.

MIDI (-m option) and Scala tuning files (-M) are of course not generated as WAV.

Dev Setup

To work on Inevitable Cacophony you will need some Ruby development tools installed, starting with the Ruby language itself. Normally you'd install Ruby using a version manager, such as RVM. (I believe that only works on Unix systems; I'm not sure what you'd do on Windows, sorry.)

Once you have RVM installed, running rvm use will read the .ruby_version file, and enable the correct Ruby in your shell (or tell you how to install it, if needed).

You will then need to install the Ruby gems Cacophony depends on, which is done through Bundler. Once you have Bundler installed, running bundle install will install all the necessary dependencies.

If everything's worked, you should be able to run the tests, with:

bundle exec rspec

and run Inevitable Cacophony with:

bundle exec inevitable_cacophony [args]

Acknowledgements and References

Everything in Inevitable Cacophony is motivated by the impressively thorough musical-form generation of Tarn and Zach Adams' Dwarf Fortress.

More personally, I'm indebted to Laurence Walker (Ohokwy) and Toby Walker (Wonkyth) for letting me pick their brains on music theory.

I've also consulted various pages on music theory and file formats, including but not limited to: