CLI Reference¶
Generation Command¶
The main command is:
python3 code/main.py [options]
Core Options¶
--key: tonic note, for exampleCorEb--mode: scale mode such asmajororminor--tonic-octave: base octave used for pitch spelling--bars: number of bars to generate--form: one ofauto,sentence,period, orphrase--voice-profile: voice range preset such asmelodyortenor1--clef: one ofauto,treble,treble_8, orbass--harmony: explicit harmonic plan orauto--seed: random seed for reproducible generation
Rendering Options¶
--pdfrenders cropped PDF output--wavrenders WAV output through TiMidity++--with-variantsalso exports the transposed derivative examples
Examples¶
python3 code/main.py --pdf
python3 code/main.py --voice-profile tenor1 --tonic-octave 3 --pdf
python3 code/main.py --key Eb --bars 16 --allowed-durations 0.25,0.5,1.0,2.0 --pdf --wav
Render Mode¶
You can rerender existing LilyPond files without regenerating the melody:
python3 code/main.py render --seed 11 --pdf
python3 code/main.py render --seed 11 --pdf --wav
python3 code/main.py render code/output/11/custom_file.ly --pdf
Manual Harmony Format¶
Explicit harmonic plans can use one of three formats:
Compact beat format:
2I,2V,4I,2IV,2iv
Here the number is the duration in beats and the Roman numeral is the chord.
Alternating chord-and-dash format:
I -- V -- vi ----
Range format:
start-end:roman[:weight]
Example:
python3 code/main.py --harmony "2I,2V,4I,2IV,2iv"
If the explicit harmony is longer than the generated piece, it is truncated. If it is shorter, the remaining bars are filled automatically using the default tonal progression.