Crates.io | rudiments |
lib.rs | rudiments |
version | 0.1.1 |
source | src |
created_at | 2020-09-12 10:56:46.485664 |
updated_at | 2021-11-09 12:26:20.633609 |
description | A step-sequencing drum machine |
homepage | https://github.com/jonasrmichel/rudiments |
repository | https://github.com/jonasrmichel/rudiments |
max_upload_size | |
id | 287700 |
size | 1,008,092 |
rudiments is a step-sequencing drum machine that plays rhythm patterns using audio samples.
Playback and audio file decoding are handled by rodio.
rudiments 0.1.1
A step-sequencing drum machine
USAGE:
rudiments [FLAGS] [OPTIONS] --pattern <FILE> --instrumentation <FILE> --samples <DIRECTORY>
FLAGS:
-h, --help Prints help information
-r, --repeat Repeat the pattern until stopped
-V, --version Prints version information
OPTIONS:
-i, --instrumentation <FILE> Path to instrumentation file
-p, --pattern <FILE> Path to pattern file
-s, --samples <DIRECTORY> Search path for sample files
-t, --tempo <NUMBER> Playback tempo [default: 120]
rudiments loads a pattern file and binds the pattern's tracks to audio files in a samples directory per an instrumentation file.
--pattern
)Each line of a pattern file represents a track. There is no limit to the number
of tracks in a pattern. A track contains an instrument name, a 16-step sequence,
and an optional amplitude. The instrument name is an identifier and can only
appear once per pattern. Each sequence represents a single measure in 4/4 time
divided into 16th note steps (x
for play and -
for silent).
A track may optionally include an amplitude in the range of [0,1] inclusive.
By default, a track plays at full volume.
This is an example of a pattern file's contents for a standard 8th note groove with the hi-hat track played at half volume.
hi-hat |x-x-|x-x-|x-x-|x-x-| 0.5
snare |----|x---|----|x---|
kick |x---|----|x---|----|
--instrumentation
)An instrumentation file binds the instruments from a pattern file to audio sample files. Each line of an instrumentation file contains an instrument name and an audio file name. Each instrument may only appear once, but a single audio file may be bound to multiple instruments.
This is an example of an instrumentation file's contents that binds five instruments to four audio sample files.
Note that
tom.wav
is used for bothtom-1
andtom-2
.
hi-hat hh.wav
tom-1 tom.wav
tom-2 tom.wav
snare snare.wav
kick kick.wav
--samples
)rudiments will look in the samples directory for the audio files listed in the instrumentation file.
--tempo
)This adjusts the playback tempo (aka beats per minute). The default playback tempo is 120.
rudiments can be installed with cargo
.
$ cargo install rudiments
Missing a fun or useful feature? Feel free to submit feature requests and PRs!
The assets
directory contains several example patterns as well as
audio samples from the LinnDrum drum
machine.
$ rudiments \
--pattern ./assets/patterns/standard \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum \
--repeat
$ rudiments \
--pattern ./assets/patterns/burning-up \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum \
--tempo 140 \
--repeat
$ rudiments \
--pattern ./assets/patterns/thriller \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum \
--tempo 118 \
--repeat
$ rudiments \
--pattern ./assets/patterns/get-a-little \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum \
--repeat
$ rudiments \
--pattern ./assets/patterns/i-wanna-dance-with-somebody \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum \
--tempo 118 \
--repeat
$ rudiments \
--pattern ./assets/patterns/tom-sawyer \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum \
--tempo 180
$ rudiments \
--pattern ./assets/patterns/never-gonna-give-you-up \
--instrumentation ./assets/instrumentations/linndrum \
--samples ./assets/samples/linndrum