Feat: introduce follow up actions
Some checks failed
Deploy Website / deploy (push) Failing after 4m49s

This commit is contained in:
2026-02-22 03:59:09 +01:00
parent 003ee0518e
commit 8ba98e8f3b
25 changed files with 203 additions and 307 deletions

View File

@@ -94,7 +94,6 @@ pub enum Op {
Triangle,
Range,
Perlin,
Chain,
Loop,
Degree(&'static [i64]),
Oct,

View File

@@ -59,7 +59,6 @@ pub struct StepContext<'a> {
pub nudge_secs: f64,
pub cc_access: Option<&'a dyn CcAccess>,
pub speed_key: &'a str,
pub chain_key: &'a str,
pub mouse_x: f64,
pub mouse_y: f64,
pub mouse_down: f64,

View File

@@ -992,26 +992,6 @@ impl Forth {
.insert(ctx.speed_key.to_string(), Value::Float(clamped, None));
}
Op::Chain => {
let pattern = pop_int(stack)? - 1;
let bank = pop_int(stack)? - 1;
if bank < 0 || pattern < 0 {
return Err("chain: bank and pattern must be >= 1".into());
}
if bank as usize == ctx.bank && pattern as usize == ctx.pattern {
// chaining to self is a no-op
} else {
use std::fmt::Write;
let mut val = String::with_capacity(8);
let _ = write!(&mut val, "{bank}:{pattern}");
var_writes_cell
.borrow_mut()
.as_mut()
.expect("var_writes taken")
.insert(ctx.chain_key.to_string(), Value::Str(Arc::from(val), None));
}
}
Op::Loop => {
let beats = pop_float(stack)?;
if ctx.tempo == 0.0 || ctx.speed == 0.0 {

View File

@@ -89,7 +89,6 @@ pub(super) fn simple_op(name: &str) -> Option<Op> {
"triangle" => Op::Triangle,
"range" => Op::Range,
"perlin" => Op::Perlin,
"chain" => Op::Chain,
"loop" => Op::Loop,
"oct" => Op::Oct,
"clear" => Op::ClearCmd,

View File

@@ -254,16 +254,6 @@ pub(super) const WORDS: &[Word] = &[
compile: Simple,
varargs: false,
},
Word {
name: "chain",
aliases: &[],
category: "Time",
stack: "(bank pattern --)",
desc: "Chain to bank/pattern (1-indexed) when current pattern ends",
example: "1 4 chain",
compile: Simple,
varargs: false,
},
Word {
name: "at",
aliases: &[],