Skip to main content
Glama

compare_spectrum

Compare reference and candidate audio on a shared beat grid to reveal missing or excess level per band or semitone over time, separating timbre gaps from level moves.

Instructions

Compare reference and candidate on one beat grid, by band or semitone, over time.

Each file is placed through its own tempo map, so the difference shows what is
missing (positive dB) or too much (negative dB) at each beat and frequency.
Each section (a bar by default, or given beats or seconds) is first matched on
K-weighted loudness where both files sound, so sound and level come apart: per
section, sound_difference_db is the timbre gap at equal loudness and
level_difference_db the fader or automation move; true peak is reported only.
Also: regions ranked by area, attack positions and widths, and an offset estimate
that reveals plugin latency Live does not report. Track Delay is not in the
Object Model, so a needed correction is a request to the user.
Poll get_audio_job; read regions, sections and attacks with get_audio_report.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reference_path": "<reference_path>",
      "reference_anchors": "<reference_anchors>",
      "output_dir": "<output_dir>",
      "from_beat": "<from_beat>",
      "to_beat": "<to_beat>"
    },
    "name": "compare_spectrum"
  }
}

Input Schema

NameRequiredDescriptionDefault
low_hzNoLowest band centre.
confirmNoTrue carries the removal out. False changes nothing and returns a report of what the call would remove, which is how to look before committing to it.
high_hzNoHighest band centre.
to_beatYesExclusive last song quarter beat.
low_noteNoLowest semitone row.
sectionsNoExplicit sections (a note, a phrase, a time window) instead.
from_beatYesFirst song quarter beat.
high_noteNoHighest semitone row.
window_msNoAnalysis window; default 85 ms for bands, 170 ms for semitones.
output_dirYesParent directory for a unique audio run.
resolutionNo1/12-octave bands, or semitone rows that name notes.bands
max_regionsNoRegions kept.
write_imageNoAlso draw the three panels; needs the plot extra.
threshold_dbNoSmallest difference that forms a region.
beats_per_barNoQuarter beats per bar, for bar labels only.
section_beatsNoEven section length in beats; default one bar.
candidate_pathNoCandidate file when no capture job is given.
capture_job_idNoSucceeded capture_audio job; its host beats become the anchors.
reference_pathYesLocal mono/stereo audio file path (WAV/FLAC).
steps_per_beatNoGrid steps per beat.
chain_offset_msNoMeasured capture-chain lag; positive means candidate audio is late.
candidate_anchorsNoCandidate tempo map, required with candidate_path.
reference_anchorsYesReference tempo map: file seconds against song quarter beats.
extra_reference_pathsNoFurther reference stems added to reference_path sample by sample, to compare a group with the sum of the stems it rebuilds rather than one of them.
apply_estimated_offsetNoAlso shift by the offset estimated from high-band attacks.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Far beyond the annotations, it explains that each file goes through its own tempo map, that sections are first matched on K-weighted loudness so timbre and level separate into sound_difference_db and level_difference_db, that true peak is reported only, and that the offset estimate exposes plugin latency Live does not report. It also states the external constraint that Track Delay is not in the Object Model, so a correction must be requested from the user — exactly the kind of limitation an agent cannot infer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first line, then mechanics, then workflow. The density is justified by a 25-parameter analysis tool, and each sentence carries distinct information — sign convention, loudness normalization, offset discovery, polling — with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex async analysis tool with an output schema, the description covers inputs semantics, output interpretation, and the polling path, so almost nothing an agent needs is missing. It stops short of describing the artifacts written into output_dir (audio run, image panels) and expected runtime, which matters for a job that must be polled.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds interpretation the schema does not: it explains why sections are loudness-matched before differencing, what the estimated offset is for, and what extra_reference_paths accomplishes when comparing a group against the sum of its stems. It does not describe the band/note range interplay (low_hz/low_note limits) beyond what the schema already carries.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a specific verb (compare), two named resources (reference and candidate), and the exact axis of comparison (one beat grid, by band or semitone, over time). 'band or semitone' plus the resolution enum makes it distinguishable from a plain time-domain compare_audio without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives real operational context: run through get_audio_job, then read regions, sections and attacks with get_audio_report, and it explains what the sign of the dB difference means. It never states when to prefer this over compare_audio or analyze_audio, so there is no exclusion guidance, but the workflow is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.