35 lines
1.8 KiB
Markdown
35 lines
1.8 KiB
Markdown
# Interval Music Maker v1.4
|
|
#### Ellie Diode, May 2019
|
|
#### Public Domain
|
|
|
|
## Introduction
|
|
`interval.rs` is a terse, nonlinear, compiled language for composing music. Code is read from a `.ITV` plaintext source
|
|
file and converted to PCM audio data, which is emitted to stdout by the compiler. Interval is designed with
|
|
unconventional music in mind, particularly that involving polyrhythms and microtonal tunings. Notes are defined by
|
|
position in time, pitch, and ringing duration, and played using simple sine waves modulated by a Gaussian envelope
|
|
generator. Any number of notes can be played simultaneously, and note definitions can be supplied out of the order in
|
|
which they play.
|
|
|
|
|
|
|
|
### How to Compile
|
|
`interval.rs` is written in Rust version 1.31.1, and has no external crate dependencies.
|
|
With the Rust compiler installed under a Unix-like OS, you can compile this source file by running
|
|
`rustc -O interval.rs` to produce the `interval` binary executable.
|
|
|
|
### How to Use
|
|
`interval` can be run at the command line with the following syntax:
|
|
`./interval [input file] [output file]`
|
|
This will attempt to read Interval code from the input file, generate audio based on it, and emit the resulting data,
|
|
prefixed with a suitable RIFF header, into the output file (which will be in `.wav` format). The audio stream is signed
|
|
16-bit little endian samples, at a sample rate defined by a static variable in the source code (48 kHz by default).
|
|
|
|
### Example Usage
|
|
Under Linux with ALSA, you can compile and play a .ITV source file with a command like this:
|
|
`./interval test.itv`
|
|
This will write WAV data into `test.wav`, creating it if it does not exist and overwriting it if it does.
|
|
|
|
### Documentation
|
|
Please refer to the source code in `interval.rs` for documentation on `.ITV` file syntax.
|
|
|