@mthines/reaper-mcp 0.75.0 → 0.75.1-beta.91.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: Vocal Alignment
3
+ id: vocal-alignment
4
+ description: Tighten doubles, harmonies and backing vocals to a lead by timing, and check the result without listening
5
+ ---
6
+
7
+ # Vocal Alignment
8
+
9
+ ## When to Use
10
+
11
+ - "Tighten the backing vocals to the lead"
12
+ - A double, harmony or call-and-response that drifts against the guide
13
+ - Any stretch or slow-down of a vocal where you need to know if it still sounds clean
14
+
15
+ The ear decides in the end. These steps find the problems the agent can measure and say which edits to hand to the user for listening.
16
+
17
+ ## Tools
18
+
19
+ - `align_audio_to_guide`: hits of a guide item and 1-8 doubles (read from their **source files**), paired in order within `maxShiftMs`, then one stretch marker per hit moves the double onto the guide. `dryRun` shows the move first, `strength` scales it, `protectConsonants` keeps high-band hits rigid. A guide that already has stretch markers is refused. It does not hear take FX: Melodyne and the like are take FX on the item, and the alignment ignores them.
20
+ - `verify_edit`: compares the result with the audio from before the edit (a kept copy on an unmuted reference track, or a bounce). Set `timeScale` to the playback rate when the timing changed (1.1 = the edit is 10% shorter) and `expect: "changed"` for a stretch.
21
+ - `measure_track_alignment`: delay and polarity between two tracks, with the play offset and phase to set.
22
+
23
+ ## Steps
24
+
25
+ 1. **Keep the originals.** Copy the guide and each double to new tracks (`T ref`, `T edit` are fine as temporary names, delete them when done) and edit the copies. Never touch the user's items or solo state. Tracks created without a master send are silent in playback but still render, so turn the master send on for tracks the user will audition.
26
+ 2. **Pick the guide.** The louder, tighter take. A quiet backing vocal against a loud lead is a good test: onsets are found per source file, so level does not matter.
27
+ 3. **Dry run.** `align_audio_to_guide` with `dryRun: true`: read the offset before and after (avg and max ms) per double. Start with `strength` around 0.8 and a `maxShiftMs` under the typical phrase gap; raise it only when hits are missed.
28
+ 4. **Apply** (same call without `dryRun`), then `verify_edit` against the kept copy with `timeScale: 1` for a pure alignment (stretch markers keep the length) and `expect: "changed"`. A clean result has no click and a small null residual only where the markers moved audio.
29
+ 5. **Listen** before accepting: play the aligned range with the guide. The tool checks for damage, not for taste.
30
+
31
+ ## Stretching a vocal: what the checks mean
32
+
33
+ Measured on a real lead and backings with REAPER's stretch (42 edits, two listening rounds):
34
+
35
+ - **Pitch-kept stretches** from 0.92x to 1.25x sound clean: pitch drift within a few cents, tone under 1.5 dB.
36
+ - **Below 0.9x** a pitch-kept slow-down gets audible stretch artifacts (0.80x clearly, 0.85x and 0.88x slightly, 0.90x clean). They pass pitch, tone and transients; `verify_edit` adds a **dropout** check there (deepest loudness dip under the original, warn from 12 dB). The line is provisional (one phrase), and the rate gate does most of the work: treat anything below 0.9x as "listen first", and use it as a dub rather than a lead.
37
+ - **A plain speed change** (preserve pitch cleared, so the pitch follows the speed) is reported as `info`, not a warning: pitch moves by `1200*log2(rate)` cents and the tone moves with it. Up to about 1.5 semitones was accepted by ear. A pitch move the speed does not explain still warns.
38
+ - A pitch shift with the timing unchanged (`timeScale` 1) gets no pitch check; shifting and stretching in one edit does.
39
+ - A pass is evidence, not proof. Ratings near the audible edge are noisy (the same audio was heard as artifacted once and clean twice).
40
+
41
+ ## REAPER gotchas for building test edits
42
+
43
+ - `playRate` does not change an item's length: set length = source length / rate.
44
+ - A copied item has preserve pitch on; run action 40796 (clear take preserve pitch) for a varispeed, 40795 sets it.
45
+ - Item pitch: actions 40204 / 40205 (one semitone up / down) act on the selected items.
46
+ - **Put each copy straight at its final position** (`copy_media_items` with `position`). Batch-moving items on one track re-sorts their indexes mid-edit and edits land on the wrong items.
@@ -3,12 +3,12 @@ name: editing
3
3
  description: >
4
4
  Edits a live REAPER session through the reaper MCP tools: MIDI parts (writing,
5
5
  rewriting, quantizing, importing), arrangement (split, move, copy, insert or
6
- remove time), timing and phase, crossfades and comping, voice recordings into
6
+ remove time), timing and phase, vocal alignment and stretch checks, crossfades and comping, voice recordings into
7
7
  arrangements, audio stem separation, and A/B-testing variations in fixed lanes.
8
8
  Changes notes and items, not levels or FX; use /mixer for those. Use when asked
9
9
  to edit, rewrite, tighten, comp, change the groove, compare parts, turn humming
10
10
  or beatboxing into music, or split a recording into stems. Triggers on "edit
11
- the drums", "change the chorus", "make a variation", "A/B these takes",
11
+ the drums", "align the backing vocals", "change the chorus", "make a variation", "A/B these takes",
12
12
  "comp this", "tighten the timing", "compose from this recording", "turn my
13
13
  humming into a song", "split stems", "/editing".
14
14
  argument-hint: '[what to edit, voice recording, stems, or versions to compare]'
@@ -261,6 +261,23 @@ Gotchas:
261
261
  arrangement, snapshots (`/mixer`) for faders, EQ and the master.
262
262
  - For a few-note tweak, edit in place; lanes are for whole alternatives.
263
263
 
264
+ ## Aligning and stretching vocals
265
+
266
+ Tightening doubles, harmonies or backing vocals to a lead, and judging a stretch,
267
+ use `knowledge/workflows/vocal-alignment.md`; load it first. In short:
268
+
269
+ 1. Edit **copies** on temporary tracks (the user's items and solo state stay
270
+ untouched) and delete them when the user is done.
271
+ 2. `align_audio_to_guide` with `dryRun` first, then apply; it reads the items'
272
+ source files, so take FX such as Melodyne are not heard.
273
+ 3. Check the result with `verify_edit` (`timeScale` = the playback rate,
274
+ `expect: "changed"` for a stretch), then **tell the user which edits to
275
+ listen to**. A plain speed change is reported as info (pitch follows speed);
276
+ a pitch-kept slow-down below 0.9x gets stretch artifacts that only the
277
+ dropout check and the user's ear catch. A pass is evidence, not a verdict.
278
+ 4. Put each copied item straight at its final position; batch-moving items on a
279
+ track re-sorts their indexes.
280
+
264
281
  ## Workflow
265
282
 
266
283
  1. **Understand** the edit and the song structure (`list_regions`, `list_markers`,
package/main.js CHANGED
@@ -5551,7 +5551,7 @@ function alignmentSummary(data) {
5551
5551
  ...data["warning"] ? { warn: 1 } : {}
5552
5552
  };
5553
5553
  }
5554
- var VERIFY_CHECKS = ["null", "discontinuity", "pitch", "tone", "transients"];
5554
+ var VERIFY_CHECKS = ["null", "discontinuity", "pitch", "tone", "transients", "dropout"];
5555
5555
  function verifyRow(key, c) {
5556
5556
  const verdict = typeof c["verdict"] === "string" ? c["verdict"] : "unknown";
5557
5557
  const f = (v, digits, unit) => num(v) === void 0 ? "" : `${num(v).toFixed(digits)}${unit}`;
@@ -5570,9 +5570,16 @@ function verifyRow(key, c) {
5570
5570
  return [key, verdict, f(c["score"], 1, "\xD7"), at === void 0 ? "" : `at ${at.toFixed(2)} s${num(c["channel"]) !== void 0 ? `, channel ${num(c["channel"]) + 1}` : ""}`];
5571
5571
  }
5572
5572
  case "pitch":
5573
- return [key, verdict, f(c["driftCents"], 0, " cents"), typeof c["reason"] === "string" ? c["reason"] : f(c["referenceHz"], 0, " Hz reference")];
5573
+ return [
5574
+ key,
5575
+ verdict,
5576
+ f(c["driftCents"], 0, " cents"),
5577
+ typeof c["reason"] === "string" ? c["reason"] : c["varispeed"] === true ? `plain speed change (expected ${f(c["expectedCents"], 0, " cents")})` : f(c["referenceHz"], 0, " Hz reference")
5578
+ ];
5574
5579
  case "tone":
5575
- return [key, verdict, f(c["distanceDb"], 2, " dB"), ""];
5580
+ return [key, verdict, f(c["distanceDb"], 2, " dB"), typeof c["reason"] === "string" ? c["reason"] : ""];
5581
+ case "dropout":
5582
+ return [key, verdict, f(c["deepestDipDb"], 1, " dB"), typeof c["reason"] === "string" ? c["reason"] : "deepest dip under the original"];
5576
5583
  default:
5577
5584
  return [key, verdict, f(c["fluxLogRatio"], 2, ""), typeof c["reason"] === "string" ? c["reason"] : ""];
5578
5585
  }
@@ -5935,7 +5942,7 @@ function registerOfflineTools(server) {
5935
5942
  );
5936
5943
  server.tool(
5937
5944
  "verify_edit",
5938
- `Check the result of an edit you just made, since you cannot hear it: compare the edited track with the audio from before the edit and get a verdict per check. Compensated null: the delay (ms, + = later), gain (dB) and polarity between the two are estimated and removed, and the residual left (dB below the reference) says whether anything else changed (noise, a splice, a different waveform, a swapped stereo channel; it is relative to referenceRmsDb, so with a quiet reference the rounding noise of a 16-bit bounce can set it). Discontinuity: the largest sample-to-sample jump on any channel against the reference's own, with where it happens and which channel (a click or hard splice). Use expect 'identical' (default) for edits that should leave the sound alone apart from level, delay and polarity (alignment, gain, split, crossfade): the residual is judged ok/warn/fail. Use "changed" for EQ, compression and the like: the residual is reported without a verdict. Set timeScale to the playback rate when the edit changed the timing (1.1 = the edit is 10% shorter): the waveform null is then skipped and the click check runs with three warn-only character checks against the reference warped through that rate: pitch drift in cents (skipped for unpitched material), tone (long-term spectrum distance in dB) and transients (smeared attacks). The reference is another track (e.g. a copy you kept) or an audio file of the same range from before the edit (a bounce), not an undo. Keep a reference track unmuted so it renders. The tone check misses a phase vocoder's smearing and the transient check is blind on drums. A passing result is evidence, not a replacement for listening. Requires the Python sidecar.`,
5945
+ `Check the result of an edit you just made, since you cannot hear it: compare the edited track with the audio from before the edit and get a verdict per check. Compensated null: the delay (ms, + = later), gain (dB) and polarity between the two are estimated and removed, and the residual left (dB below the reference) says whether anything else changed (noise, a splice, a different waveform, a swapped stereo channel; it is relative to referenceRmsDb, so with a quiet reference the rounding noise of a 16-bit bounce can set it). Discontinuity: the largest sample-to-sample jump on any channel against the reference's own, with where it happens and which channel (a click or hard splice). Use expect 'identical' (default) for edits that should leave the sound alone apart from level, delay and polarity (alignment, gain, split, crossfade): the residual is judged ok/warn/fail. Use "changed" for EQ, compression and the like: the residual is reported without a verdict. Set timeScale to the playback rate when the edit changed the timing (1.1 = the edit is 10% shorter): the waveform null is then skipped and the click check runs with three warn-only character checks against the reference warped through that rate: pitch drift in cents (skipped for unpitched material), tone (long-term spectrum distance in dB, line 1.5 dB, provisional) and transients (smeared attacks). When the pitch moved by what the speed change alone causes (a plain speed change, pitch follows speed), pitch and tone are reported as info, not warned; a pitch move the speed does not explain still warns. Slow-downs below 0.9 also get a dropout check (the deepest dip of the edited loudness under the original, warn from 12 dB, provisional): bigger slow-downs stretch audible artifacts into a vocal that the other checks do not hear, so listen to those either way. The reference is another track (e.g. a copy you kept) or an audio file of the same range from before the edit (a bounce), not an undo. Keep a reference track unmuted so it renders. The tone check misses a phase vocoder's smearing and the transient check is blind on drums. A passing result is evidence, not a replacement for listening. Requires the Python sidecar.`,
5939
5946
  {
5940
5947
  trackIndex: z28.coerce.number().int().min(0).describe("Zero-based index of the edited track"),
5941
5948
  referenceTrack: z28.coerce.number().int().min(0).optional().describe("Zero-based index of a track holding the audio from before the edit (give this or referencePath)"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mthines/reaper-mcp",
3
- "version": "0.75.0",
3
+ "version": "0.75.1-beta.91.1",
4
4
  "type": "module",
5
5
  "description": "MCP server for controlling REAPER DAW — real-time mixing, FX control, and frequency analysis for AI agents",
6
6
  "license": "MIT",
@@ -270,11 +270,35 @@ def test_a_stretch_that_keeps_the_pitch_passes_every_character_check():
270
270
  assert checks["transients"]["verdict"] == "ok"
271
271
 
272
272
 
273
- def test_varispeed_is_reported_as_pitch_drift_in_cents():
273
+ def test_a_plain_speed_change_is_reported_as_pitch_drift_in_cents_not_warned():
274
274
  reference = _voice(4)
275
275
  checks = _character(reference, _resampled(reference, 1.1), 1.1)
276
- assert checks["pitch"]["verdict"] == "warn"
276
+ assert checks["pitch"]["verdict"] == "info"
277
+ assert checks["pitch"]["varispeed"] is True
277
278
  assert checks["pitch"]["driftCents"] == pytest.approx(1200 * np.log2(1.1), abs=15)
279
+ assert checks["pitch"]["expectedCents"] == pytest.approx(1200 * np.log2(1.1), abs=0.2)
280
+
281
+
282
+ def test_a_slow_down_that_moves_the_pitch_is_also_a_plain_speed_change():
283
+ reference = _voice(4)
284
+ checks = _character(reference, _resampled(reference, 0.92), 0.92)
285
+ assert checks["pitch"]["verdict"] == "info"
286
+ assert checks["pitch"]["driftCents"] < -100
287
+
288
+
289
+ def test_a_pitch_error_the_speed_change_does_not_explain_still_warns_after_a_speed_change():
290
+ reference = _voice(4)
291
+ off = _resampled(_voice(4, pitch_scale=2 ** (1.0 / 12)), 1.1) # a semitone further up than the speed alone
292
+ checks = _character(reference, off, 1.1)
293
+ assert checks["pitch"]["verdict"] == "warn"
294
+ assert "varispeed" not in checks["pitch"]
295
+
296
+
297
+ def test_the_tone_shift_of_a_speed_change_is_reported_not_warned():
298
+ reference = _voice(4)
299
+ checks = _character(reference, _resampled(reference, 1.25), 1.25)
300
+ assert checks["tone"]["distanceDb"] >= verify.TONE_WARN_DB
301
+ assert checks["tone"]["verdict"] == "info"
278
302
 
279
303
 
280
304
  def test_a_half_semitone_error_is_found():
@@ -313,5 +337,44 @@ def test_character_checks_only_run_when_the_timing_changed(source):
313
337
 
314
338
  def test_a_character_warning_makes_the_verdict_a_warning_never_a_fail():
315
339
  reference = _voice(4)
316
- result = verify.verify_edit(reference, _resampled(reference, 1.1), SR, time_scale=1.1)
340
+ off = _resampled(_voice(4, pitch_scale=2 ** (1.0 / 12)), 1.1)
341
+ result = verify.verify_edit(reference, off, SR, time_scale=1.1)
317
342
  assert result["verdict"] == "warn"
343
+
344
+
345
+ def _slowed(rate):
346
+ return _voice(4, rate=rate)
347
+
348
+
349
+ def test_a_clean_big_slow_down_reports_a_shallow_dip_and_passes():
350
+ checks = _character(_voice(4), _slowed(0.8), 0.8)
351
+ assert checks["dropout"]["verdict"] == "ok"
352
+ assert checks["dropout"]["deepestDipDb"] < verify.DROPOUT_WARN_DB
353
+
354
+
355
+ def test_a_piece_of_a_slow_down_that_went_missing_is_found():
356
+ edited = _slowed(0.8).copy()
357
+ mid = len(edited) // 2
358
+ edited[mid:mid + int(0.08 * SR)] *= 0.02 # 80 ms gone while the original keeps sounding there
359
+ checks = _character(_voice(4), edited, 0.8)
360
+ assert checks["dropout"]["verdict"] == "warn"
361
+ assert checks["dropout"]["deepestDipDb"] >= verify.DROPOUT_WARN_DB
362
+
363
+
364
+ def test_mild_slow_downs_and_speed_ups_are_not_checked_for_dropouts():
365
+ assert "dropout" not in _character(_voice(4), _slowed(0.92), 0.92)
366
+ assert "dropout" not in _character(_voice(4), _voice(4, rate=1.1), 1.1)
367
+
368
+
369
+ def test_a_pitch_error_on_a_nearly_unchanged_speed_still_warns():
370
+ reference = _voice(4)
371
+ off = _resampled(_voice(4, pitch_scale=2 ** (0.25 / 12)), 1.02) # a quarter tone further than the speed alone
372
+ checks = _character(reference, off, 1.02)
373
+ assert checks["pitch"]["verdict"] == "warn"
374
+ assert "varispeed" not in checks["pitch"]
375
+
376
+
377
+ def test_a_pitch_kept_stretch_of_a_couple_of_percent_is_ok_not_a_speed_change():
378
+ checks = _character(_voice(4), _voice(4, rate=1.02), 1.02)
379
+ assert checks["pitch"]["verdict"] == "ok"
380
+ assert "varispeed" not in checks["pitch"]
package/sidecar/verify.py CHANGED
@@ -44,7 +44,13 @@ SILENCE = 1e-6
44
44
 
45
45
  # Character checks (only when the timing changed): warn lines from the issue 81 experiment
46
46
  PITCH_WARN_CENTS = 20.0
47
- TONE_WARN_DB = 0.7
47
+ TONE_WARN_DB = 1.5
48
+ # A drift this close to what the speed change alone predicts is a plain speed change (varispeed), reported, not warned
49
+ VARISPEED_TOLERANCE_CENTS = 35.0
50
+ # Slow-downs below this rate stretch audible artifacts into a vocal (listening test, issue 81 follow-up: 0.80, 0.85
51
+ # and 0.88 had them, 0.90 and up did not). The dropout check runs only there; the line is provisional (one phrase).
52
+ DROPOUT_MAX_RATE = 0.9
53
+ DROPOUT_WARN_DB = 12.0
48
54
  TRANSIENT_WARN_LOG = -0.25
49
55
  MIN_VOICED_FRAMES = 12
50
56
  MIN_VOICED_SHARE = 0.25
@@ -251,11 +257,15 @@ def pitch_drift(reference: np.ndarray, edited: np.ndarray, sample_rate: int, rat
251
257
  return {"verdict": "skipped", "reason": "too few voiced frames in both to compare"}
252
258
  cents = 1200.0 * np.log2(edit_f0[both] / ref_f0[index][both])
253
259
  drift = float(np.median(cents))
260
+ expected = 1200.0 * np.log2(rate) # what a plain speed change (pitch follows the speed) would do
261
+ # Only when the speed change alone would warn by more than the tolerance: nearer 1.0 the window reaches zero drift
262
+ varispeed = abs(expected) >= PITCH_WARN_CENTS + VARISPEED_TOLERANCE_CENTS and abs(drift - expected) <= VARISPEED_TOLERANCE_CENTS
254
263
  return {
255
- "verdict": "warn" if abs(drift) >= PITCH_WARN_CENTS else "ok",
264
+ "verdict": "info" if varispeed else "warn" if abs(drift) >= PITCH_WARN_CENTS else "ok",
256
265
  "driftCents": round(drift, 1),
257
266
  "referenceHz": round(centre, 1),
258
267
  "framesCompared": int(both.sum()),
268
+ **({"varispeed": True, "expectedCents": round(expected, 1)} if varispeed else {}),
259
269
  }
260
270
 
261
271
 
@@ -279,11 +289,19 @@ def _long_term_bands(x: np.ndarray, sample_rate: int) -> np.ndarray:
279
289
  return levels[frame_level > frame_level.max() - 40.0].mean(axis=0)
280
290
 
281
291
 
282
- def tone_difference(reference: np.ndarray, edited: np.ndarray, sample_rate: int) -> dict[str, Any]:
283
- """Rms dB difference of the long-term spectrum, overall gain removed."""
292
+ def tone_difference(reference: np.ndarray, edited: np.ndarray, sample_rate: int, varispeed: bool = False) -> dict[str, Any]:
293
+ """
294
+ Rms dB difference of the long-term spectrum, overall gain removed. After a plain speed change the whole
295
+ spectrum moves with the pitch by design, so a distance over the line is reported, not warned.
296
+ """
284
297
  delta = _long_term_bands(reference, sample_rate) - _long_term_bands(edited, sample_rate)
285
298
  distance = float(np.sqrt(np.mean((delta - delta.mean()) ** 2)))
286
- return {"verdict": "warn" if distance >= TONE_WARN_DB else "ok", "distanceDb": round(distance, 2)}
299
+ over = distance >= TONE_WARN_DB
300
+ return {
301
+ "verdict": ("info" if varispeed else "warn") if over else "ok",
302
+ "distanceDb": round(distance, 2),
303
+ **({"reason": "the spectrum moves with the pitch after a plain speed change"} if over and varispeed else {}),
304
+ }
287
305
 
288
306
 
289
307
  def _flux_peakiness(x: np.ndarray) -> float:
@@ -299,6 +317,39 @@ def transient_change(reference: np.ndarray, edited: np.ndarray) -> dict[str, Any
299
317
  return {"verdict": "warn" if ratio <= TRANSIENT_WARN_LOG else "ok", "fluxLogRatio": round(ratio, 3)}
300
318
 
301
319
 
320
+ def _envelope_db(x: np.ndarray, sample_rate: int, window: float = 0.03, hop: float = 0.01) -> np.ndarray:
321
+ w, h = int(window * sample_rate), int(hop * sample_rate)
322
+ frames = (len(x) - w) // h
323
+ return 10.0 * np.log10(np.array([np.mean(x[i * h:i * h + w] ** 2) for i in range(frames)]) + 1e-12)
324
+
325
+
326
+ def slowdown_dropout(reference: np.ndarray, edited: np.ndarray, sample_rate: int, rate: float) -> dict[str, Any]:
327
+ """
328
+ Where does the edit go quiet while the reference, warped through the speed change, does not? A big slow-down
329
+ can drop or smear a piece of the signal: the loudness (30 ms frames, level matched, small lag searched)
330
+ falls far below the reference at one spot. Reports the deepest dip in dB; only slow-downs below
331
+ DROPOUT_MAX_RATE are checked. Unvalidated beyond one vocal phrase, and a steep onset moved a few ms also dips.
332
+ """
333
+ hop = 0.01
334
+ ref_env, edit_env = _envelope_db(reference, sample_rate, hop=hop), _envelope_db(edited, sample_rate, hop=hop)
335
+ if len(ref_env) < 10 or len(edit_env) < 10:
336
+ return {"verdict": "skipped", "reason": "too short for a loudness comparison"}
337
+ best: tuple[float, np.ndarray] | None = None
338
+ for lag in np.arange(-0.03, 0.0301, hop):
339
+ positions = ((np.arange(len(edit_env)) * hop * rate + lag) / hop).clip(0, len(ref_env) - 1)
340
+ warped = np.interp(positions, np.arange(len(ref_env)), ref_env)
341
+ active = warped > warped.max() - 30.0
342
+ if active.sum() < 10:
343
+ return {"verdict": "skipped", "reason": "too quiet for a loudness comparison"}
344
+ diff = (edit_env - warped)[active]
345
+ diff = diff - np.median(diff)
346
+ score = float(np.sqrt(np.mean(diff ** 2)))
347
+ if best is None or score < best[0]:
348
+ best = (score, diff)
349
+ dip = float(-best[1].min())
350
+ return {"verdict": "warn" if dip >= DROPOUT_WARN_DB else "ok", "deepestDipDb": round(dip, 1)}
351
+
352
+
302
353
  def _click_verdict(edit_score: float | None, ref_score: float | None) -> str:
303
354
  if edit_score is None:
304
355
  return "unknown"
@@ -355,8 +406,10 @@ def verify_edit(reference: np.ndarray, edited: np.ndarray, sample_rate: int, *,
355
406
  checks["null"] = {"verdict": "skipped", "reason": "timing changed (timeScale != 1): a waveform null needs the same timing"}
356
407
  ref_mono, edit_mono = _mono(reference), _mono(edited)
357
408
  checks["pitch"] = pitch_drift(ref_mono, edit_mono, sample_rate, time_scale)
358
- checks["tone"] = tone_difference(ref_mono, edit_mono, sample_rate)
409
+ checks["tone"] = tone_difference(ref_mono, edit_mono, sample_rate, bool(checks["pitch"].get("varispeed")))
359
410
  checks["transients"] = transient_change(ref_mono, edit_mono)
411
+ if time_scale < DROPOUT_MAX_RATE:
412
+ checks["dropout"] = slowdown_dropout(ref_mono, edit_mono, sample_rate, time_scale)
360
413
  else:
361
414
  null = compensated_null(reference, edited, sample_rate, max_lag_ms)
362
415
  if "error" in null: