Polyphonic ReharmonizerCheckpoint 4 of 6real recordings

reharm, the chord-swap tool

The first piece you can use on a real track. Give it a loop and the progression you want. It hears the chords that are there, works out the smallest set of note moves, and writes a new WAV in the same format, ready to drop into a session.

reharm loop.wav --bpm 84 --to "Bb Fm Gm Dm"
heard     Bb  F  Gm  Dm
becomes   Bb  Fm  Gm  Dm
  move    A4 → Ab4  2.94–5.20s
  move    A3 → Ab3  3.59–5.04s
  move    A3 → Ab3  5.03–5.34s
wrote     loop - Bb Fm Gm Dm - 84bpm.wav
time      detect 129 ms · analysis 10 ms · render 47 ms · total 620 ms
What I need from you
  1. Are these edits you'd keep? Each example below is exactly what the command wrote. Switch between Original and Output while it plays.
  2. Try it on one of your own loops (setup below). What breaks first: the chords it hears, the notes it chooses to move, or how the result sounds?

Timing (the 200 ms goal)

ExampleDetect (once per file)Analysis (once)Re-render per edit

Detection and analysis run once when a file is dropped. Only the re-render runs on each chord click in the app, and it stays well under 200 ms, even for a stereo 11-second loop (about 90 ms).

Try it on your own loop

cd ~/Developer/reharmonizer
scripts/fetch-models.sh                         # basic-pitch model, 230 KB
cargo build --release -p reharm
target/release/reharm my-loop.wav --plan --bpm 90                # what it hears
target/release/reharm my-loop.wav --bpm 90 --to "Am F C G"       # do it
target/release/reharm my-loop.wav --bpm 90 --to "- - - E"        # change one bar, keep the rest
target/release/reharm my-loop.wav --to "canon://eyJr…"           # a progression shared from canon

Next: checkpoint 5

The one-screen app: drop a loop, see its chord blocks, click a chord to swap it, hear the result immediately, and drag the WAV out into Ableton, Logic or FL Studio.