Feat: tri is now triangle (disambiguation)
This commit is contained in:
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- Renamed `tri` Forth word to `triangle`.
|
||||||
- Sequencer rewritten with prospective lookahead scheduling. Instead of sleeping until a substep, waking late, and detecting past events, the sequencer now pre-computes all events within a ~20ms forward window. Events arrive at doux with positive time deltas, scheduled before they need to fire. Sleep+spin-wait replaced by `recv_timeout(3ms)` on the command channel. Timing no longer depends on OS sleep precision.
|
- Sequencer rewritten with prospective lookahead scheduling. Instead of sleeping until a substep, waking late, and detecting past events, the sequencer now pre-computes all events within a ~20ms forward window. Events arrive at doux with positive time deltas, scheduled before they need to fire. Sleep+spin-wait replaced by `recv_timeout(3ms)` on the command channel. Timing no longer depends on OS sleep precision.
|
||||||
- `audio_sample_pos` updated at buffer start instead of end, so `engine_time` reflects current playback position.
|
- `audio_sample_pos` updated at buffer start instead of end, so `engine_time` reflects current playback position.
|
||||||
- Doux grace period increased from 1ms to 50ms as a safety net (events should never be late with lookahead).
|
- Doux grace period increased from 1ms to 50ms as a safety net (events should never be late with lookahead).
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ pub enum Op {
|
|||||||
Ad,
|
Ad,
|
||||||
Apply,
|
Apply,
|
||||||
Ramp,
|
Ramp,
|
||||||
Tri,
|
Triangle,
|
||||||
Range,
|
Range,
|
||||||
Perlin,
|
Perlin,
|
||||||
Chain,
|
Chain,
|
||||||
|
|||||||
@@ -852,7 +852,7 @@ impl Forth {
|
|||||||
let val = phase.powf(curve);
|
let val = phase.powf(curve);
|
||||||
stack.push(Value::Float(val, None));
|
stack.push(Value::Float(val, None));
|
||||||
}
|
}
|
||||||
Op::Tri => {
|
Op::Triangle => {
|
||||||
let freq = stack.pop().ok_or("stack underflow")?.as_float()?;
|
let freq = stack.pop().ok_or("stack underflow")?.as_float()?;
|
||||||
let phase = (freq * ctx.beat).fract();
|
let phase = (freq * ctx.beat).fract();
|
||||||
let phase = if phase < 0.0 { phase + 1.0 } else { phase };
|
let phase = if phase < 0.0 { phase + 1.0 } else { phase };
|
||||||
|
|||||||
@@ -1198,12 +1198,12 @@ pub const WORDS: &[Word] = &[
|
|||||||
varargs: false,
|
varargs: false,
|
||||||
},
|
},
|
||||||
Word {
|
Word {
|
||||||
name: "tri",
|
name: "triangle",
|
||||||
aliases: &[],
|
aliases: &[],
|
||||||
category: "LFO",
|
category: "LFO",
|
||||||
stack: "(freq -- val)",
|
stack: "(freq -- val)",
|
||||||
desc: "Triangle wave [0,1]: 0→1→0",
|
desc: "Triangle wave [0,1]: 0→1→0",
|
||||||
example: "0.5 tri",
|
example: "0.5 triangle",
|
||||||
compile: Simple,
|
compile: Simple,
|
||||||
varargs: false,
|
varargs: false,
|
||||||
},
|
},
|
||||||
@@ -2879,7 +2879,7 @@ pub(super) fn simple_op(name: &str) -> Option<Op> {
|
|||||||
"ad" => Op::Ad,
|
"ad" => Op::Ad,
|
||||||
"apply" => Op::Apply,
|
"apply" => Op::Apply,
|
||||||
"ramp" => Op::Ramp,
|
"ramp" => Op::Ramp,
|
||||||
"tri" => Op::Tri,
|
"triangle" => Op::Triangle,
|
||||||
"range" => Op::Range,
|
"range" => Op::Range,
|
||||||
"perlin" => Op::Perlin,
|
"perlin" => Op::Perlin,
|
||||||
"chain" => Op::Chain,
|
"chain" => Op::Chain,
|
||||||
|
|||||||
Reference in New Issue
Block a user