From 2ced44adc36b427ffd6a602bb6c10c634edfeee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 10 Nov 2026 05:34:34 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20eq=20over=20MCP=20takes=20up=20t?= =?UTF-8?q?o=2020=20bands,=20for=20spectral=20matching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/mcp/src/help.rs | 2 +- crates/mcp/src/tools/edit_fx.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/mcp/src/help.rs b/crates/mcp/src/help.rs index 9c1579a..71cd9f1 100644 --- a/crates/mcp/src/help.rs +++ b/crates/mcp/src/help.rs @@ -650,7 +650,7 @@ const OP_TEXTS: &[(&str, &str)] = &[ ), ( "eq", - "eq {clip, bands:[{f, db, q?, kind?}], reset?} — the clip's equalizer, up to 10 bands. f 20-20000 Hz; \ + "eq {clip, bands:[{f, db, q?, kind?}], reset?} — the clip's equalizer, up to 20 bands. f 20-20000 Hz; \ db -12 to +12; q 0.3-12 (default 0.707); kind: peak (default), low_shelf, high_shelf, low_cut \ (high-pass: rumble, mic handling), high_cut (low-pass: hiss, air). bands replaces the whole \ equalizer; reset:true takes it off.", diff --git a/crates/mcp/src/tools/edit_fx.rs b/crates/mcp/src/tools/edit_fx.rs index 8c608f9..b0f6eff 100644 --- a/crates/mcp/src/tools/edit_fx.rs +++ b/crates/mcp/src/tools/edit_fx.rs @@ -1223,7 +1223,7 @@ fn fit(s: &mut PlaybackSession, op: &Value) -> Result { Ok(done(format!("fit {raw} → {name}"), vec![(lane, start)])) } -/// `eq {clip, bands?: [{f, db, q?, kind?}], reset?}`. At most 10 bands; the GUI +/// `eq {clip, bands?: [{f, db, q?, kind?}], reset?}`. At most 20 bands; the GUI /// caps are f 20–20000 Hz, db ±12, q 0.3–12. `q` defaults to 0.707 and `kind` /// to `peak`. `bands` replaces the clip's equalizer; `reset` takes it off. fn eq(s: &mut PlaybackSession, op: &Value) -> Result { @@ -1242,8 +1242,8 @@ fn eq(s: &mut PlaybackSession, op: &Value) -> Result { let arr = list .as_array() .ok_or_else(|| format!("{who}: bands must be a list of {{f, db, q, kind}}, got {}", kind_of(list)))?; - if arr.len() > 10 { - return Err(format!("{who}: at most 10 bands, got {}", arr.len())); + if arr.len() > 20 { + return Err(format!("{who}: at most 20 bands, got {}", arr.len())); } let mut bands = Vec::with_capacity(arr.len()); for (i, b) in arr.iter().enumerate() { @@ -3196,10 +3196,10 @@ mod tests { assert_eq!(eq.bands.len(), 1); assert!(close(eq.bands[0].gain_db, 3.0)); assert_eq!(eq.bands[0].kind, BandKind::Peak); - let too_many: Vec = (0..11).map(|_| json!({"f": 100, "db": 0})).collect(); + let too_many: Vec = (0..21).map(|_| json!({"f": 100, "db": 0})).collect(); assert!(run(&mut s, json!({"op": "eq", "clip": "A1#0", "bands": too_many})) .unwrap_err() - .contains("at most 10")); + .contains("at most 20")); run(&mut s, json!({"op": "eq", "clip": "A1#0", "reset": true})).unwrap(); assert!(s.eq_of(Lane::new(LaneKind::Audio, 0), 0).is_none()); }