@mthines/reaper-mcp 0.75.0-beta.89.2 → 0.75.0-beta.89.3
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.
- package/README.md +37 -37
- package/bridge-ui/mcp_bridge.html +11 -11
- package/main.js +8 -3
- package/package.json +1 -1
- package/sidecar/tests/test_verify.py +14 -0
- package/sidecar/verify.py +2 -1
package/main.js
CHANGED
|
@@ -5563,9 +5563,14 @@ function verifyRow(key, c) {
|
|
|
5563
5563
|
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}` : ""}`];
|
|
5564
5564
|
}
|
|
5565
5565
|
case "pitch":
|
|
5566
|
-
return [
|
|
5566
|
+
return [
|
|
5567
|
+
key,
|
|
5568
|
+
verdict,
|
|
5569
|
+
f(c["driftCents"], 0, " cents"),
|
|
5570
|
+
typeof c["reason"] === "string" ? c["reason"] : c["varispeed"] === true ? `plain speed change (expected ${f(c["expectedCents"], 0, " cents")})` : f(c["referenceHz"], 0, " Hz reference")
|
|
5571
|
+
];
|
|
5567
5572
|
case "tone":
|
|
5568
|
-
return [key, verdict, f(c["distanceDb"], 2, " dB"), ""];
|
|
5573
|
+
return [key, verdict, f(c["distanceDb"], 2, " dB"), typeof c["reason"] === "string" ? c["reason"] : ""];
|
|
5569
5574
|
case "dropout":
|
|
5570
5575
|
return [key, verdict, f(c["deepestDipDb"], 1, " dB"), typeof c["reason"] === "string" ? c["reason"] : "deepest dip under the original"];
|
|
5571
5576
|
default:
|
|
@@ -5930,7 +5935,7 @@ function registerOfflineTools(server) {
|
|
|
5930
5935
|
);
|
|
5931
5936
|
server.tool(
|
|
5932
5937
|
"verify_edit",
|
|
5933
|
-
`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.
|
|
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, 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.`,
|
|
5934
5939
|
{
|
|
5935
5940
|
trackIndex: z28.coerce.number().int().min(0).describe("Zero-based index of the edited track"),
|
|
5936
5941
|
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
|
@@ -364,3 +364,17 @@ def test_a_piece_of_a_slow_down_that_went_missing_is_found():
|
|
|
364
364
|
def test_mild_slow_downs_and_speed_ups_are_not_checked_for_dropouts():
|
|
365
365
|
assert "dropout" not in _character(_voice(4), _slowed(0.92), 0.92)
|
|
366
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
|
@@ -258,7 +258,8 @@ def pitch_drift(reference: np.ndarray, edited: np.ndarray, sample_rate: int, rat
|
|
|
258
258
|
cents = 1200.0 * np.log2(edit_f0[both] / ref_f0[index][both])
|
|
259
259
|
drift = float(np.median(cents))
|
|
260
260
|
expected = 1200.0 * np.log2(rate) # what a plain speed change (pitch follows the speed) would do
|
|
261
|
-
|
|
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
|
|
262
263
|
return {
|
|
263
264
|
"verdict": "info" if varispeed else "warn" if abs(drift) >= PITCH_WARN_CENTS else "ok",
|
|
264
265
|
"driftCents": round(drift, 1),
|