v0.64.0: DJ mode round two — vocals models, Prepare for DJ, deck volumes, ½×/2×, scrubbing, air horn

- Preferences › DJ: vocals model (Best / Balanced / Fast) and gentle CPU
  use (a quarter of the cores, lowest priority — measured only ~20%
  slower). Splits are cached per model; a deck uses the best one.
- Prepare for DJ on a playlist or songs: BPM and vocals ahead of time.
- Each deck: a volume fader on the outer edge, labelled beside Tempo; a
  ½×/1×/2× switch for half/double-time counting.
- Drag a waveform to scrub (backwards too).
- Crossfader: a handle twice as tall, a middle line, a snap to centre;
  narrower. "calculated, saved" is gone from the BPM line.
- Keep pitch shows a checkmark. An air horn to hold.
- The visualizer draws the mix; the sidebar art hides in DJ mode.
- The Library button has the transport buttons' 8 px corners.
This commit is contained in:
2026-10-17 03:13:59 -07:00
parent 8298450814
commit 6d6a0c2385
16 changed files with 1029 additions and 97 deletions
+14
View File
@@ -137,6 +137,20 @@ def sync_ratio(own_bpm: float, target_bpm: float) -> float:
return min((ratio, ratio * 2, ratio / 2), key=lambda r: abs(np.log2(r)))
def sync_speed(own_beat_bpm: float, target_beat_bpm: float,
plausible: tuple[float, float] = (0.75, 1.34)) -> float:
"""The speed that plays ``own`` at ``target``, both as the decks count
their beats (the ½×/1×/2× switch already applied). Taken straight when
it's a plausible change of speed; a ratio further out than that means
the two are counted an octave apart, so the nearest octave wins."""
if not own_beat_bpm or not target_beat_bpm:
return 1.0
ratio = target_beat_bpm / own_beat_bpm
if plausible[0] <= ratio <= plausible[1]:
return ratio
return sync_ratio(own_beat_bpm, target_beat_bpm)
def beat_phase(position_s: float, offset_s: float, bpm: float) -> float:
"""Where in its beat a song is, 0..1."""
if not bpm: