Feat: tri is now triangle (disambiguation)
This commit is contained in:
@@ -80,7 +80,7 @@ pub enum Op {
|
||||
Ad,
|
||||
Apply,
|
||||
Ramp,
|
||||
Tri,
|
||||
Triangle,
|
||||
Range,
|
||||
Perlin,
|
||||
Chain,
|
||||
|
||||
@@ -852,7 +852,7 @@ impl Forth {
|
||||
let val = phase.powf(curve);
|
||||
stack.push(Value::Float(val, None));
|
||||
}
|
||||
Op::Tri => {
|
||||
Op::Triangle => {
|
||||
let freq = stack.pop().ok_or("stack underflow")?.as_float()?;
|
||||
let phase = (freq * ctx.beat).fract();
|
||||
let phase = if phase < 0.0 { phase + 1.0 } else { phase };
|
||||
|
||||
@@ -1198,12 +1198,12 @@ pub const WORDS: &[Word] = &[
|
||||
varargs: false,
|
||||
},
|
||||
Word {
|
||||
name: "tri",
|
||||
name: "triangle",
|
||||
aliases: &[],
|
||||
category: "LFO",
|
||||
stack: "(freq -- val)",
|
||||
desc: "Triangle wave [0,1]: 0→1→0",
|
||||
example: "0.5 tri",
|
||||
example: "0.5 triangle",
|
||||
compile: Simple,
|
||||
varargs: false,
|
||||
},
|
||||
@@ -2879,7 +2879,7 @@ pub(super) fn simple_op(name: &str) -> Option<Op> {
|
||||
"ad" => Op::Ad,
|
||||
"apply" => Op::Apply,
|
||||
"ramp" => Op::Ramp,
|
||||
"tri" => Op::Tri,
|
||||
"triangle" => Op::Triangle,
|
||||
"range" => Op::Range,
|
||||
"perlin" => Op::Perlin,
|
||||
"chain" => Op::Chain,
|
||||
|
||||
Reference in New Issue
Block a user