Skip to content

Add a cue survey of how a playlist's cues meet the grid and phrases - #49

Merged
claw1200 merged 25 commits into
mainfrom
smart-cue
Nov 29, 2026
Merged

claw1200 merged 25 commits into
mainfrom
smart-cue

Conversation

@claw1200

Copy link
Copy Markdown
Owner

A dev example that reads a snapshot of the installed library and reports
cue alignment to beats, bars and the 4-32 bar grid, which rekordbox
phrase starts carry a cue, and the gaps between cues. Optionally dumps
the grids, phrases and cues as JSON for evaluating cue placement.

Bumps es-rekordbox-sdk for the PSSI reader, rustfmt and lint fixes.

Co-Authored-By: Claude Opus 5.5 [email protected]

claw1200 and others added 25 commits November 28, 2026 14:35
A dev example that reads a snapshot of the installed library and reports
cue alignment to beats, bars and the 4-32 bar grid, which rekordbox
phrase starts carry a cue, and the gaps between cues. Optionally dumps
the grids, phrases and cues as JSON for evaluating cue placement.

Bumps es-rekordbox-sdk for the PSSI reader, rustfmt and lint fixes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rustfmt.toml matches the app's 120-column Prettier width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop the allow for chunks_exact_to_as_chunks, a lint current clippy
does not know, and check es-usb's schema error without unwrap_err.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
structure::segment splits the beat grid into sections with checkerboard
novelty over bar profiles (timbre, harmony, rhythm, loudness), starting
sections only on the 4-bar grid phase that carries the most novelty, and
names them intro, build, drop, breakdown or outro from their loudness
and place. BarFeatures are measured once so tunings can be compared.

The structure_eval example scores section starts against a DJ's cues
from a cue_survey dump. On 425 tracks the tuned defaults put 71% of cues
on a section start (F1 0.61), against 0.47 for every 16 bars and 0.57
for rekordbox's own phrase changes; held-out playlists score 0.56-0.62.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Track analysis now finds the sections too, and the engine writes them
into the .EXT as a PSSI tag in rekordbox's high mood (intro, up, chorus,
down, outro) when they fit the grid the track ends up with and the track
has no phrases, or overwrite is asked for, or the grid is rewritten.
Sections found on a grid the engine discards are never written.

analyseTrack can be handed the grid a track keeps, which finds the
sections on it instead of detecting a new grid. A "Detect phrases"
analysis setting, on by default, turns this off.

Bumps es-rekordbox-sdk for the PSSI writer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Track detail now carries the phrases in the analysis file, ours or
rekordbox's. With "Show phrases" on in developer options, both deck
modes draw them as a coloured strip along the top of the overview.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With "Show phrases" on, the detail waveform tints each phrase's stretch,
marks where it starts, and labels it in the band above the waveform.
The overview and detail views share one phrase colour lookup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sections were snapped to one 4-bar lattice per track, counted from the
grid's downbeats, so an intro a bar short, a sweep before it, or a wrong
downbeat moved every later phrase by the same gap. Now:

- Novelty is measured at every beat, comparing whole bars counted back
  and on from it, so it stays as sharp as bar profiles without leaning
  on the downbeat.
- Starts are chosen together by dynamic programming, each section's
  length counted from the start before it: 8, 16 and 32 bars are free,
  4, 12, 24, 48 and 64 cost a little, and odd lengths more. Past an odd
  section the rest follow on from it.
- A detected grid's downbeat is rechecked against which beat of the bar
  the phrase changes fall on, and moved when another beat carries three
  times as many. Kept grids are never renumbered.
- A section leading into a drop is a build. rekordbox calls 90% of them
  UP; requiring an audible rise named most of them breakdowns.

On grids our analysis detects, cues just missed by a section start drop
from 15.4% to 9.0% at the same F1 (0.56), and downbeats agree with
rekordbox's on 89.5% of tracks, up from 86.9%.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The last section was always named the outro. With longer sections the
last drop often runs to the end, so it became the outro and every
section after the first drop was named an outro with it. Now only the
opening section is framed as the intro; the last section is an outro by
the same rule as any other, coming after the last drop.

Beats whose kind agrees with rekordbox's go from 63.7% to 67.4%, and
beats rekordbox calls a drop that we called an outro from 3,042 to 285.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cue_style learns rules tied to sections ("every drop", "16 bars before
the first drop", "every section, then every 32 bars") by greedily adding
the rule that most raises the F1 of its cues against the DJ's, among
rules that find cues on at least 10% of the tracks. Memory cues learn a
set of rules; hot cues learn one single-cue rule per pad by the same
search. Placing skips cues within a bar of one already placed.

The cue_style_eval example cross-validates a style over a cue_survey
dump. Learnt styles match or beat a cue on every section start (Uk 0.601
vs 0.590, DnB 0.555 vs 0.537) and pick up genre habits, such as cueing
DnB sections again every 32 bars. The survey reading and scoring the
two examples share now live in examples/survey.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Cue Palette in the sidebar holds the tracks to learn from: add tracks
from their menu, a playlist's or folder's tracks from its menu, or drag
them on. "Auto cue" on tracks, selections and playlists learns a memory
or hot cue style from the DJ's own cues on the palette, places cues on
each track's own grid by its sections, and writes them marked "Auto
cue". Tracks that already have the DJ's own cues of that sort are left
alone, and a later run replaces only the automatic ones. "What it
learns…" on the palette lists the learnt rules in words.

- es-analyse: CueStyle learns and places either sort and round-trips
  through JSON; sections_on and nearest_beat are shared.
- es-node: learnCueStyle and placeCues, and cue.placeAuto through the
  engine to rb-library's replace_auto_cues.
- main: an AutoCue queue reporting progress on autoCue:progress, shown
  in the status bar with a stop button and summed up when it finishes.

Bumps es-rekordbox-sdk for replace_auto_cues.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With "Show and edit phrases" on, the edit deck gains a PHRASE tab beside
CUES and GRID. Its toolbar works at the playhead: set the phrase's kind
(INTRO, UP, CHORUS, DOWN, OUTRO), split a phrase on the nearest beat,
join it onto the one before, nudge its start by a beat or a bar, fill
the track in from our analysis, undo and redo. Saving writes the phrases
into the track's .EXT as rekordbox's own PSSI, backed up first.

- es-engine: set_phrases, and track.setPhrases on the service.
- main: analysis:sections finds our sections on a track's own grid
  without writing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The phrase_score example reads the "phrase examples" playlist and, track
by track, compares the phrases set on it with the sections we find on
its own grid. It reports boundary F1 exact and within a bar, how many of
the hand-set starts we find (split into the first phrase, kind changes
and same-kind splits), our near-miss offsets in beats, per-beat label
agreement with a confusion matrix, scores by genre, and every track
worst first, marking those whose phrases rekordbox wrote.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The algorithm is meant to work whatever the genre, so scores are only
read overall and per track.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scored against the hand-set phrases in "phrase examples", exact start F1
rises from 0.697 to 0.851 on the tuning tracks and from 0.747 to 0.860 on
the held-out quarter. phrase_score now holds out a quarter of the tracks,
reports label errors with build and breakdown as one group, prints one
track's phrases beside ours, and searches tunings. PHRASE_TUNING.md
records the approach and each step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the hand-set phrases, every label group's error on the tuning tracks
is now under 15% (intro 13.5%, build/breakdown 13.5%, drop 11.7%, outro
11.3%), from 26/28/4/39%. Drops need more energy and can't be drums alone,
which keeps loud DJ intros and outros out of them; the intro runs 16 bars,
or up to 32 while its energy holds. phrase_score gains --on-your-starts to
score labelling apart from placing starts, and its search weighs label
errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rule can now count only the phrases that start a run of their kind, so
"the second drop" skips the second half of a drop phrased in two, and
"every section" cues wherever the kind changes. Over the memory cue
limit, the cues of the most precise rules are kept rather than the
earliest. Against the DJ's own memory cues, F1 rises from 0.628 to 0.700
(UK), 0.577 to 0.682 (DnB) and 0.654 to 0.693 (speed garage).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Clear cues" offers memory cues, hot cues or both, asks before deleting,
and refreshes the waveforms, cue counts and any deck holding the tracks.
The cue menu entries move to cueMenu.ts, and decks gain refreshTrack for
the three places that reload a track's detail after an outside change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… auto cue

A grid nudged after cueing left cues a few ms off their beats, and the
learner dropped any more than 15 ms away: 6 of 8 cues on one palette
track. Cues now count on the nearest beat within a quarter of a beat.

cue_score scores auto cue against the DJ's own memory cues on the app's
cue palette, in-sample and cross-validated. The examples share their
library reading in examples/library.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Updated CueStyleDialog to clarify memory cue placement rules.
- Modified cueStyle.ts to introduce SectionStart and improve cue likelihood calculations.
- Added tests for new SectionStart descriptions and their behavior.
- Enhanced cue_score.rs to report learned styles and improve memory cue placement logic.
- Updated cue_style_eval.rs to streamline memory cue learning and reporting.
- Improved phrase_score.rs to incorporate novelty in section naming.
- Refined structure.rs to include change metrics for sections and adjust section naming logic.
- Added CUE_TUNING.md to document cue tuning methodology and benchmarks.
…nd enhance nativeBuild function for version tracking
@claw1200
claw1200 merged commit 169a1c5 into main Nov 29, 2026
4 checks passed
@claw1200
claw1200 deleted the smart-cue branch November 29, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant