new CLI design

This commit is contained in:
Breval Ferrari 2025-05-01 16:03:52 -04:00
parent d4c8b13376
commit 322422bf19
Signed by: breval
GPG key ID: A2EEBF62257FF960

39
doc/cli-design.txt Normal file
View file

@ -0,0 +1,39 @@
A flexible music programming language powered by math.
usage:
cmd [FILENAME | -c SHEET_MUSIC | --syntax | --examples | --example <n>] [-e EXPR] -n NOTE[,...] [-E [-f {"stdout" | FORMAT}]] [-v CHAR=VALUE]
arguments:
FILENAME file path to your .blp sheet music [default: read from stdin]
options:
playing music:
-c SHEET_MUSIC
sheet music to read instead of reading a file
-n NOTE[,...], --notes NOTE[,...]
available notes: a list of comma-separated alphabetical note names
-e EXPR, --expression EXPR
signal expression (instrument) to generate music samples (you can use the floating-point number t for the current time in seconds, n for the indice of the currently playing note in the list of available notes starting with 0 and N for the number of available notes) [default: sin(2*PI*n*(442+442*((n+1)/N))*t)]
exporting music:
-E, --export
export audio instead of playing it
-f, --format
audio format to use for exporting with -E
advanced sheet music tweaking:
-v VARIABLE=VALUE, --variable VARIABLE=VALUE
add a variable named VARIABLE (an single letter) for the sheet music and all expressions and set its initial value to VALUE (you can override n, t and T)
-m NAME:EXPANSION, --macro MACRO:EXPANSION
add a macro named NAME (single character, must not be alphanumeric) which expands to EXPANSION when called in the sheet music
-s NAME:VARIABLE=EXPR, --slope VARIABLE=EXPR
add a slope expression named NAME which replaces the value of VARIABLE with the result of EXPR each frame (EXPR can use all available variables and instrument variables plus the variables α for the initial value of VARIABLE, β for the final value and Δ for the total duration of the specific slope)
help:
--syntax
show a help message about expression and sheet music syntax
--examples
show a list of expression and sheet music examples
--example <n>
show the nth example from the list provided by --examples