Feat: new harmony / melodic words and demo

This commit is contained in:
2026-02-23 02:25:32 +01:00
parent d9e6505e07
commit e7137cc7ed
9 changed files with 624 additions and 9 deletions

View File

@@ -108,6 +108,12 @@ pub(super) fn simple_op(name: &str) -> Option<Op> {
"mstop" => Op::MidiStop,
"mcont" => Op::MidiContinue,
"forget" => Op::Forget,
"key!" => Op::SetKey,
"tp" => Op::Transpose,
"inv" => Op::Invert,
"dinv" => Op::DownInvert,
"drop2" => Op::VoiceDrop2,
"drop3" => Op::VoiceDrop3,
"lfo" => Op::ModLfo(0),
"tlfo" => Op::ModLfo(1),
"wlfo" => Op::ModLfo(2),
@@ -227,6 +233,20 @@ pub(crate) fn compile_word(
_ => {}
}
if name == "triad" || name == "seventh" {
if let Some(Op::Degree(pattern)) = ops.last() {
let pattern = *pattern;
ops.pop();
ops.push(if name == "triad" {
Op::DiatonicTriad(pattern)
} else {
Op::DiatonicSeventh(pattern)
});
return true;
}
return false;
}
if let Some(pattern) = theory::lookup(name) {
ops.push(Op::Degree(pattern));
return true;