A functional music generator, that is, a program designed to generate real-time MIDI output through functions written by musicians or programmers. There is both a GUI and a command line version available.
The songs are written in Lua and each one consists of a single function f that takes a single argument t which is the number of milliseconds since the song started. The function f then returns three integers representing a MIDI message (i.e. a status byte and two data bytes). For example, a "song" that consists of random notes played at random times is as follows:
math.randomseed(os.time())
function f(t)
if (t % math.random(400, 1000)) == 0 then
return 144, math.random(45, 69), math.random(60, 120)
end
return 0, 0, 0
endFor some more interesting songs have a look at the .fmu files in the examples folder.
Both of these examples are using the CLI program and Reaktor 5 to turn the MIDI messages into music! The fugue by Bach (the first link) seems to work better. Perhaps this is due to the mathematical structure of a fugue but that is merely a guess.
- Markov chain generated music from Bach's "Toccata and Fugue in D minor"
- Markov chain generated music from Satie's "Gymnopédies" and "Trois Gnossiennes"
Many thanks to the developers of the following (awesome) libraries!
- No binaries have been uploaded so to use the program you will have to compile it yourself using CMake
- No testing of the program has taken place on Linux or Windows (only recent versions of OS X) so it is not know if it can compile and run properly on these systems.
- The program has not been updated for a while so it's still using older versions of the libraries listed above
The ƒMusic program and related files are released under the MIT license. The MIDI files used by the Markov Generator Song are, as far as I know, in the public domain, but I am happy to remove them if this proves not to be the case.