Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

melody

Image

Terminal melody maker. Written in Rust.

Rust License Platform Stay Amazing

Compose a single piano line on a piano-roll, then export a clean WAV to use as the basis for a fuller track (DAW, sampler, AI music tool, whatever you like). Play freely, record what you play (quantized to a grid, against a metronome), then tweak each note's pitch, length and strength. Built on crust. Part of the Fe₂O₃ Rust terminal suite.

No audio crate: notes are synthesised to PCM and streamed to a system player (aplay, play/sox, or paplay), so the sound device only wakes when something actually plays. WAV is written by hand.

Build

cargo build --release

Sound needs one of aplay (alsa-utils), play (sox) or paplay on the PATH. WAV export works without any of them.

Three modes

  • EDIT (the piano-roll): move, lengthen, shorten, restrengthen or delete each note.
  • PLAY (Tab): jam freely on the keyboard piano; nothing is captured.
  • REC (r): play along to the metronome; keystrokes are captured and quantized to the grid. A one-bar count-in plays first when the metronome is on. Esc/Enter stops and drops you back in EDIT to tweak the take.

Keys

Edit

Key Action
h j k l / arrows move cursor (time / pitch)
Enter add a note at the cursor (or audition the note under it)
H / L move selected note earlier / later
K / J move selected note up / down a semitone
+ / - lengthen / shorten selected note (down to one tick)
19 note strength, soft→loud (also sets its colour)
x / Del delete selected note
Space play / stop the melody (a playhead follows along)
r record · Tab jam · m metronome on/off
g cycle grid (1/4, 1/8, 1/16)
, / . tempo −/+ 5 BPM
w / o save / open a .mel file
e export WAV
? keybinding help · n new · q quit

Play / Record (the keyboard piano)

Key Note
z s x d c v g b h n j m , C C# D D# E F F# G G# A A# B C
[ / ] octave down / up

Each note's colour shows its strength (cool = soft, hot = loud). While the melody plays, a cyan playhead marks the current position and the view scrolls to follow it; press any key to stop.

Headless render

melody --render song.mel song.wav

File format (.mel)

Plain text, one directive per line:

melody 1
bpm 120
sig 4 4
tpb 4
step 2
note 60 0 2 0.80    # pitch(MIDI) start(ticks) length(ticks) strength(0..1)

License

Unlicense (public domain).

About

Terminal melody maker: play, record and edit a piano line, export WAV as a song starting point. Built on crust, part of the Fe2O3 suite.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages