forge
Explore
Log in

Don't you dare go Hollow

🐛 eq over MCP takes up to 20 bands, for spectral matching

Browse files at this commit

2ced44adc36b427ffd6a602bb6c10c634edfeee1Ahmet Kaan GümüşParent: bcb4dc5
crates/mcp/src/help.rsmodified+1 -1
@@ -650,7 +650,7 @@ const OP_TEXTS: &[(&str, &str)] = &[
650650 ),
651651 (
652652 "eq",
653- "eq {clip, bands:[{f, db, q?, kind?}], reset?} — the clip's equalizer, up to 10 bands. f 20-20000 Hz; \
653+ "eq {clip, bands:[{f, db, q?, kind?}], reset?} — the clip's equalizer, up to 20 bands. f 20-20000 Hz; \
654654 db -12 to +12; q 0.3-12 (default 0.707); kind: peak (default), low_shelf, high_shelf, low_cut \
655655 (high-pass: rumble, mic handling), high_cut (low-pass: hiss, air). bands replaces the whole \
656656 equalizer; reset:true takes it off.",
crates/mcp/src/tools/edit_fx.rsmodified+5 -5
@@ -1223,7 +1223,7 @@ fn fit(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {
12231223 Ok(done(format!("fit {raw} → {name}"), vec![(lane, start)]))
12241224 }
12251225
1226-/// `eq {clip, bands?: [{f, db, q?, kind?}], reset?}`. At most 10 bands; the GUI
1226+/// `eq {clip, bands?: [{f, db, q?, kind?}], reset?}`. At most 20 bands; the GUI
12271227 /// caps are f 20–20000 Hz, db ±12, q 0.3–12. `q` defaults to 0.707 and `kind`
12281228 /// to `peak`. `bands` replaces the clip's equalizer; `reset` takes it off.
12291229 fn eq(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {
@@ -1242,8 +1242,8 @@ fn eq(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {
12421242 let arr = list
12431243 .as_array()
12441244 .ok_or_else(|| format!("{who}: bands must be a list of {{f, db, q, kind}}, got {}", kind_of(list)))?;
1245- if arr.len() > 10 {
1246- return Err(format!("{who}: at most 10 bands, got {}", arr.len()));
1245+ if arr.len() > 20 {
1246+ return Err(format!("{who}: at most 20 bands, got {}", arr.len()));
12471247 }
12481248 let mut bands = Vec::with_capacity(arr.len());
12491249 for (i, b) in arr.iter().enumerate() {
@@ -3196,10 +3196,10 @@ mod tests {
31963196 assert_eq!(eq.bands.len(), 1);
31973197 assert!(close(eq.bands[0].gain_db, 3.0));
31983198 assert_eq!(eq.bands[0].kind, BandKind::Peak);
3199- let too_many: Vec<Value> = (0..11).map(|_| json!({"f": 100, "db": 0})).collect();
3199+ let too_many: Vec<Value> = (0..21).map(|_| json!({"f": 100, "db": 0})).collect();
32003200 assert!(run(&mut s, json!({"op": "eq", "clip": "A1#0", "bands": too_many}))
32013201 .unwrap_err()
3202- .contains("at most 10"));
3202+ .contains("at most 20"));
32033203 run(&mut s, json!({"op": "eq", "clip": "A1#0", "reset": true})).unwrap();
32043204 assert!(s.eq_of(Lane::new(LaneKind::Audio, 0), 0).is_none());
32053205 }