music — Music and sound effects from a score — openbash
A track written the way musicians write: chord symbols or numerals, drum grids, ABC melodies and a song form, rendered to WAV or MP3 on a drum, bass, pad, guitar and effects kit.
music
music is a command on the openbash shell, reachable over HTTP, SSH and MCP with one key. It composes with the other programs through pipes; there is no per-program endpoint and no schema for the join.
music render /tmp/night.txt /tmp/night.wav --publish rendered 20 bars at 112 bpm, 13 tracks: 42.857 s to /tmp/night.wav (12054 KB) url: https://…/audio/…-night.wav?…
help
music: music and sound effects from a score.
USAGE
music render SCORE.txt OUT.wav|OUT.mp3 [--publish]
music compile SCORE.txt
music sequence REQUEST.json OUT.wav|OUT.mp3 [--publish]
music kit
render compiles the score and writes the audio: .wav (48 kHz, 24-bit) or
.mp3 (320 kbps), mastered to the `master` loudness. --publish also
files it in the account's store and prints `url: …`, which is how
it leaves the session; the URL is presigned and expires in 7 days.
compile prints the renderer request the score becomes (every note placed),
to check a score or to extend it by hand.
sequence sends a renderer request as JSON: `{"commands": [...]}` with the
commands pattern, voice, piece, csound, glicol, audio, ambience,
silence, gain, fade, mix and master, played in order onto one
timeline.
kit every instrument, preset and parameter, as JSON.
The same score again is read back, not rendered again.
A SCORE
One statement per line. A `#` word starts a comment.
title Night drive
tempo 112 # 40 to 240 bpm; a bar is 4 beats of 4 16ths
key D minor # for numerals (i, VI, bVII …); also `key F#m`
swing 0.1 # optional, 0 to 0.5
room 0.8 # reverb size 0..1 (and a tone in Hz after it)
form intro 2, groove 8, break 2, drop 8 # sections and their bars
chords Dm | Bb | F | C # one bar each, looping through every section
chords break Gm | A7 # a section's own progression
kick x...x...x...x... in groove drop
clap ....x.......x... in groove drop
clap snare ....x.......x... in groove drop gain -8
hat ..x...x...x...x. in groove drop gain -4
hat shaker x.o.x.o.x.o.x.oo in drop gain -10 pan 0.3
bass root 8ths in groove drop gain 3
pad block in intro break drop gain -8
pad stab block ...x......x..... in groove gain -12
pluck arp up 16ths in drop gain -8 set brightness=0.85
guitar muted riff 16ths in groove drop gain -4 pan -0.35 set width=0.6
guitar lead abc L:1/8 K:Dm A4 GF E2 | D6 z2 | F4 A2 c2 | A8 in drop
crash impact at groove drop
riser into drop 2
ambience ocean in intro,groove gain -8 set xfade=3 fadein=2 fadeout=4
fade 0 3 # seconds of fade in, fade out
master -14 # loudness in LUFS (-14 streaming, -16 speech beds)
Without `form`, `bars N` sets the length (4 if neither is given).
CHORDS
Symbols: C Cm Cdim Caug Csus2 Csus4 C5 C6 Cm6 C7 Cmaj7 Cm7 CmMaj7 Cm7b5
Cdim7 C7sus4 C9 Cmaj9 Cm9 Cadd9 C6/9 C11 Cm11 C13 C7b9 C7#9, with # or b
on the root and a slash bass (F/A). Numerals follow the `key`'s own scale:
in D minor, i iv v VI III VII are Dm Gm Am Bb F C; b and # move them (bVII),
and 7 9 6 maj7 ° ø + sus2 sus4 go after (V7, iiø). `|` separates bars; two
chords in one bar share it (| Dm C |); `%` repeats the bar before; N.C. is
silence. Each section starts its progression from the top.
TRACKS
INSTRUMENT [PRESET] PART [OPTIONS]
Instruments: kick clap hat crash riser (drums and effects, no pitch) and
bass pad pluck guitar (pitched). Presets: kick punch|boom, clap snare|tight,
hat open|shaker, bass sub|reese, pad stab|dark, pluck bell, guitar lead|muted|clean,
crash impact, riser down. `music kit` lists every parameter `set` changes.
PARTS
x...x... a grid, one character per 16th, looping from each section's
start: X accent, x hit, o ghost, . rest (| is ignored). On a
pitched instrument it plays the chord's root (or `pitch D2`).
root RATE the chord's root (its slash bass if it has one), repeated
riff RATE root, fifth and octave picking (default 16ths)
block [GRID] the chord held for as long as it lasts, or hit on GRID
arp [up|down|updown] RATE the chord's notes one at a time
abc TUNE a melody in ABC notation: L: unit (default 1/8), K: key;
C is middle C, c the octave up, C, and c' further; ^ sharp,
_ flat, = natural (to the bar's end); A2 A/2 A3/2 lengths;
z rest; [DFA] chord; A-A tie; A>B A<B; (3ABC triplet;
|: … :| repeat. It loops through each section it plays in.
notes N:LEN … pitches and lengths in 16ths: D4:4 F4:2 r:2 D4+F4+A4:8
at SECTIONS one hit at the start of each (crash impact at drop)
into SECTION [BARS] one note over the BARS bars before it (risers)
over SECTIONS one note over the whole section (a held pad, a downlifter)
RATE is whole, half, 4ths, 8ths, 16ths, 32nds, 8t or 16t (triplets).
OPTIONS, after the part
in SECTIONS where it plays (default everywhere)
gain DB level, 0 is the kit's balance
pan P -1 left .. 1 right
oct N the register: chords sit around octave N (pad 4, pluck 5,
guitar 4, bass 2), roots near E of it; for abc and notes it
moves the melody N octaves
vel V 0..1, scales every note
len STEPS a fixed note length in 16ths
pitch NOTE the note a grid or a one-shot plays
set NAME=V … instrument parameters, as `music kit` names them
AMBIENCE
ambience NAME [OPTIONS]
A stock recording under the music: ocean, sea_hull, wind, market, night,
creak, gulls (`music kit` lists them with what each sounds like). It has no
part; it plays through every section it is `in` (default the whole song),
looped with crossfades, and starts again after a section it skips. It takes
in, gain, pan, and set with xfade (seconds of crossfade between loops,
default 2), fadein and fadeout (seconds at each run's start and end).
A score of ambience alone is that sound for the song's length.
form intro 2, sail 8, port 4
ambience sea_hull in intro,sail gain -10 set xfade=3 fadein=2 fadeout=3
ambience creak in sail gain -16 pan 0.4
ambience market in port gain -12 set fadein=1.5 fadeout=4
THE SOUND
A tuned 808-style kick pumps the bass and pads (sidechain), one shared room
reverb, a supersaw pad, a filtered saw bass, and an electric guitar (plucked
string, bends and vibrato on `lead`, amp drive and cabinet). Drums and effects
are synthesized, so any tempo and key work; only the ambience is recorded.
COSTS
Free.