Feat: parameter duration scaling

This commit is contained in:
2026-01-27 12:17:23 +01:00
parent 324d1feda1
commit 5fa2c5b6b0
3 changed files with 149 additions and 27 deletions

View File

@@ -1222,6 +1222,54 @@ pub const WORDS: &[Word] = &[
example: "0.3 bpr",
compile: Param,
},
Word {
name: "llpf",
category: "Ladder Filter",
stack: "(f --)",
desc: "Set ladder lowpass frequency",
example: "2000 llpf",
compile: Param,
},
Word {
name: "llpq",
category: "Ladder Filter",
stack: "(f --)",
desc: "Set ladder lowpass resonance",
example: "0.5 llpq",
compile: Param,
},
Word {
name: "lhpf",
category: "Ladder Filter",
stack: "(f --)",
desc: "Set ladder highpass frequency",
example: "100 lhpf",
compile: Param,
},
Word {
name: "lhpq",
category: "Ladder Filter",
stack: "(f --)",
desc: "Set ladder highpass resonance",
example: "0.5 lhpq",
compile: Param,
},
Word {
name: "lbpf",
category: "Ladder Filter",
stack: "(f --)",
desc: "Set ladder bandpass frequency",
example: "1000 lbpf",
compile: Param,
},
Word {
name: "lbpq",
category: "Ladder Filter",
stack: "(f --)",
desc: "Set ladder bandpass resonance",
example: "0.5 lbpq",
compile: Param,
},
Word {
name: "ftype",
category: "Filter",
@@ -1902,11 +1950,28 @@ fn parse_interval(name: &str) -> Option<i64> {
Some(simple)
}
pub(super) fn compile_word(name: &str, span: Option<SourceSpan>, ops: &mut Vec<Op>, dict: &Dictionary) -> bool {
pub(super) fn compile_word(
name: &str,
span: Option<SourceSpan>,
ops: &mut Vec<Op>,
dict: &Dictionary,
) -> bool {
match name {
"linramp" => { ops.push(Op::PushFloat(1.0, span)); ops.push(Op::Ramp); return true; }
"expramp" => { ops.push(Op::PushFloat(3.0, span)); ops.push(Op::Ramp); return true; }
"logramp" => { ops.push(Op::PushFloat(0.3, span)); ops.push(Op::Ramp); return true; }
"linramp" => {
ops.push(Op::PushFloat(1.0, span));
ops.push(Op::Ramp);
return true;
}
"expramp" => {
ops.push(Op::PushFloat(3.0, span));
ops.push(Op::Ramp);
return true;
}
"logramp" => {
ops.push(Op::PushFloat(0.3, span));
ops.push(Op::Ramp);
return true;
}
_ => {}
}