write programs that create music
Music Coder is (what I call) a music programming library. It generates music entirely through code in the chosen programming language (Ruby).
There are three main use cases for Music Coder:
- Producing music: Write scripts that mimic human creativity, and put some randomness in it, giving you a program that can generate aesthetically pleasing music that is completely unique in each file generated.
- Scientific exploration: Use the functions in Music Coder to concisely apply algorithms or math to the structure and properties of sound.
- Making samples: create samples or sections of music that are too complex to be done by hand in graphical audio programs such as Ableton.
as proof that you can do these things with Music Coder!
- Compile code into audio files.
- Control layers of sequences of sounds that morph from one type of waveform to another at a programable rate for each attribute of the waveform in your program.
- Trigger when layers of sound sequences play with Distributors.
- Trigger layers of Distributors with other Distributors to compose music fractally.
- Use helpfull functions to create sounds in a musical scale, create chords, or create chords in a scale.
- Create files of unlimited size (with procedures in place to cap the RAM usage).
- Use helpfull random functions to randomly generate things like a sound, a bar, a track, or a full length DJ mix!
- Save all created music objects to a state file you can reload later.
- Use regular Ruby syntax, only requiring that you load in Music Coder at the top of the file.
- Open Source.
- Ruby Gem.
- Well Documented.
- Could be deployed as a web app so people can use it online.
The below episodes show off Music Coder, and help you learn Music Coder.
You can read example code and listen to their output online. Or, after installing, create an '.rb' file containing code from an episode. Then run
ruby file.rb to compute the generate the output audio file.
Start at episode 1 (the bottom). In early episodes, new methods in the code are linked to its documentation.