This unit is the approach to acquiring metadata on source material. For the exact analysis endpoint and its verified response shape, see media-analysis. For what you do with the result, see beats-and-bars.
The goal of this step is not “get the BPM”. It is: come away with a grid you can place segments on, and a set of names the user can compose with.
A single track-wide BPM number is a label. It is useful for setting a master tempo and for sanity checks, and it is nearly useless for placing anything precisely.
What actually matters:
Two tracks can report the same BPM and have completely different grids — different intro lengths, different pickups, a half-bar of silence before the first kick. The scalar cannot express any of that. The grid can.
So: read the grid, not just the number. Anywhere you are tempted to multiply a BPM to find out where something is, fetch the grid instead.
When judging whether an analysis found the actual pulse — or when asking a user to confirm it — the reliable indicators are the rhythmic elements, in order:
Melodic and harmonic content is a much weaker signal and should not be the basis for overriding a grid.
For four-on-the-floor techno — the primary target material — an estimate stands in exactly one of three relationships to the truth: it is right, it is double, or it is half.
That is the entire correction vocabulary. Check it explicitly:
Ratios such as 3:2 or 2:3 are not part of this vocabulary. They are musically strange for this material, and treating one as an acceptable explanation launders a broken result into a plausible-looking one.
The rule above is calibrated to machine-made four-on-the-floor. For material with a 3/8 feel, swing, or live playing, do not assume machine-made music:
This one causes silent, hard-to-diagnose drift.
Beat and downbeat positions are derived from one specific audio file. They are meaningless against:
Different intro length, different tempo read, everything shifts. The analysis is still internally consistent — it is just describing a different recording than the one you are about to render.
Any anchor must name which edit it belongs to. In practice: keep the analysis bound to
the library fileId it was produced from, and never reuse a grid, an offset, or a segment
boundary across two file IDs even when the track is “the same song”. If you re-upload,
re-analyze.
The user composes by naming parts of songs — “straw hat man”, “car chase”, “banging wall”, “outro” — not by naming timestamps. Those names are the composing vocabulary (see beats-and-bars).
So capturing them is part of metadata acquisition, not a side effect of it:
## Segments section (see
sources-workflow), so the names outlive the conversation and are
reusable across kompositions.A kilde whose segments are unnamed, or named only segment-1, has lost the thing that made
it worth analyzing.
GET /api/multimedia/{fileId}/analysis is documented and verified in
media-analysis — start there.
Beyond it, the public tools manifest at https://ai.makeshitapp.com/api/tools declares
three further operations that serve this approach directly:
| Operation | What the manifest declares it does |
|---|---|
GET /api/multimedia/{fileId}/beat-grid |
The dedicated canonical beat-grid contract: per-beat timestamps and downbeat/bar-start timestamps in absolute milliseconds, plus BPM, confidence, median beat interval, and first/last beat positions. Reports a status of not_analyzed, analyzed, or no_beat_grid. |
POST /api/multimedia/beat-segments |
Converts a beat-based segment layout into timeline positions. Takes beats_per_segment, segment_count, and file_ids; looks up the exact beat grid for each file; returns contiguous timeline start/end positions plus source offsets. start_beat skips an intro. arrangement is alternate (cycles between files) or sequential (exhausts each before the next). |
analyze_audio_source (via POST /api/execute-tool, body source_id) |
Audio analysis metadata for a kilde: BPM plus segments with labels and timing, using boundaries such as Intro, Verse, Drop, Breakdown, Outro. |
beat-segments is the mechanism that makes agent-side arithmetic unnecessary: you state
the layout in beats, it resolves against each file’s measured grid, and it returns the
millisecond positions. That is the division of labour this whole approach describes — you
speak beats, the server speaks milliseconds. Prefer it over computing positions yourself,
and note that it accepts multiple file_ids, so a layout spanning more than one song is a
first-class input rather than a workaround.
Status: declared, not verified. These three entries are read from the server’s own tools manifest. Their exact response shapes have not been confirmed against a live authenticated call from this client, and there is no
klicommand for any of them yet — they require a raw authenticated request. Verify the response before depending on field names, and treat any mismatch as a finding worth reporting rather than something to work around.
kli upload-analyze <path>) and capture the fileId.analyzedAt present and a finite bpm
(media-analysis).fileId the grid came from. It is only valid for that exact file.Only then start composing.