RMusic, a random MIDI music generator

Introduction

RMusic is a small "tool" (read "toy") that reads an arbitrary source of data and generate MIDI notes from it. It is designed to be able to read any data source as it reads only a byte stream and not any structured data. Besides, the default data source is /dev/urandom (random source - on Linux system at least). The data source is read by chunks of 4 bytes: the first is the note itself, the second the duration, the third the velocity and the fourth the pan (unused at the time I write these lines). It is then possible to write a kind of partition even if it is not the original goal.

Options

RMusic command-line syntax is as the following:
rmusic [OPTIONS] [RANDOM_SOURCE]

where RANDOM_SOURCE is a file, and OPTIONS one or more of the following options:

-h
Prints the help and exits the program.
-V
Prints the version and exits the program.
-q
Makes the program quiet (the default on current builds).
-Q
Makes the program verbose.
-t <time>
Multiplier for notes durations, in order to wait <note duration>*<time> milliseconds.
-l <length>
Number of different durations, e.g. the maximum step between the shorter and longer note.
-o <offset>
Offset of the lower note.
-n <notes>
Number of different notes, e.g. the maximum step between the higher and lower notes.
-m <min>
Minimal velocity.
-v <velocities>
Number of different velocities, e.g. the maximum step between softest and hardest notes.
-c <channel>
MIDI output channel.

Building RMusic

Getting RMusic source code

Although you probably already have the sources if you read this, you can get them from here.

Dependencies

RMusic has a really few dependencies. What you need to built it is: It is recommended to have the following tools in order to use the build system shipped together with RMusic: On Linux systems, all these dependencies are generally easily installable via your distribution’s package manager (or so). On Debian systems (Debian, Ubuntu, …), the needed packages are:

Building

When you have all above dependencies satisfied, the only thing to do in order to compile RMusic is to run GNU Make from the RMusic’s directory:
$ make
This should produce a rmusic executable in the same folder. That’s all for the build itself, and RMusic is usable right now by running it:
$ ./rmusic

Installing

When RMusic is built, you may want to install it somewhere else, i.e. in a system-wide binary directory. The only thing to do is to copy the rmusic executable where you want to see it, but there’s a easy way to do so. The build system provides an install target that installs the executable where you want. By default, it is installed in the UNIX’s standard system-wide binary add-ons, /usr/local/bin. To make this target, simply call, with the appropriate right for the target destination:
# make install
You can change the base destination directory, e.g. if you want to install it in the UNIX’s standard binary tools path, /usr/bin, just make the above target but with specifying a custom value to the PREFIX variable:
# make install PREFIX=/usr

Uninstalling

Uninstalling RMusic is exactly the same as installing it, but it is done by making the uninstall target.

License

RMusic is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

RMusic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with RMusic. If not, see http://www.gnu.org/licenses/.