Skip to content

Move rekordbox's detail waveforms with the grid when converting a track - #15

Merged
claw1200 merged 2 commits into
mainfrom
library-convert-waveforms
Oct 27, 2026
Merged

claw1200 merged 2 commits into
mainfrom
library-convert-waveforms

Conversation

@claw1200

Copy link
Copy Markdown
Owner

Part 2 of the "convert audio on USB export" series. Depends on claw1200/es-rekordbox-sdk#2 (the submodule points at that branch; re-point after it merges).

When a track is converted to a format with a different encoder delay (e.g. WAV → MP3), the beat grid and cues already moved by the delay, but rekordbox's own detail waveforms (PWV3, PWV5, PWV7) did not, so they sat ~20 ms off the audio and grid. The app's high-quality waveform is drawn from decoded audio, which hid this.

  • convert.rs drops its private grid_patches and uses the SDK's rb_anlz::write::timeline_patches, which moves the grid (same rule as before) and the detail waveforms by whole columns (150/s).
  • Previews (PWAV, PWV2, PWV4, PWV6) are unchanged — the delay is far below one of their columns.

Tests: new ffmpeg integration test converts an analysed WAV to MP3 and checks the grid moved by the measured delay and the colour and 3-band detail waveforms gained the matching silent columns at the start (skipped when ffmpeg is absent).

Library conversion moved the beat grid and cues by the encoder delay but left
PWV3/PWV5/PWV7 where they were, so rekordbox's own waveforms sat a few ms off.
Use the SDK's timeline_patches, which moves both.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The conversion test does not verify silent prefixes or preservation of PWV7’s original data, allowing nonzero padding or padding at the wrong end to pass.

1 open issue
What changed in this PR

Aligns rekordbox’s detail waveforms with the beat grid when audio conversion changes encoder delay, using the SDK’s timeline patching support.

Changes:

  • Replaces local grid-only patching with SDK patches for the grid and detail waveforms.
  • Updates delay documentation to include detail waveforms.
  • Adds an ffmpeg-dependent WAV-to-MP3 integration test for grid movement and waveform alignment.
File Description
native/​crates/​es-engine/​tests/​convert.rs Adds conversion coverage for grid offsets and detail waveform shifts.
native/​crates/​es-engine/​src/​convert.rs Uses SDK timeline patches to shift detail waveforms alongside the grid.

Review effort: Balanced

Comment thread native/crates/es-engine/tests/convert.rs Outdated
Also moves the SDK to the timeline fix that empties a grid moved wholly
before the start and leaves a malformed extended grid alone.
@claw1200
claw1200 merged commit f528fed into main Oct 27, 2026
3 checks passed
@claw1200
claw1200 deleted the library-convert-waveforms branch October 27, 2026 21:31
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.

2 participants