broken changes

This commit is contained in:
Mark Gregory
2026-11-05 16:54:59 +00:00
parent 13a6a9e1c8
commit 80a895febb
7 changed files with 379 additions and 43 deletions
+27
View File
@@ -0,0 +1,27 @@
# DJ Studio feature stages
This is a staged expansion of KJMix Pro using djay Pro as a workflow reference. It does not claim complete compatibility with djay’s proprietary engines or controller processors.
## Stage 1 — DJ queue and Automix
Implemented: independent saved queue, library/playlist enqueue, duplicate entries, reorder/remove/shuffle, paused preloading, timed crossfade or cut, optional incoming BPM match, Mix Now, manual takeover, missing-file handling and no autoplay after relaunch. Tests exercise real playback and crossfader transitions.
Current fixes also include active-loop resizing during playback, controller shutdown reset, automatic MIDI detection, XML profiles, two persistent workspaces and multichannel Internal/External audio routing. See [workstation notes](DJ_WORKSTATION.md) for functionality and verification limits.
## Stage 2 — Effects and sampler
Planned: per-deck audio effects with real signal routing, dry/wet and parameter controls; sample-bank import, trigger/stop/volume; controller bindings and meaningful LED feedback. No placeholder switches should imply audio processing exists.
## Stage 3 — Recording and expanded decks
Planned: mix recording, file management and reliable start/stop finalization; four-deck playback, mixer and routing; expanded cue/loop storage and library metadata.
## Later stages
- Analysis: musical key, editable beat/downbeat grids, per-track saved cues/loops and improved BPM reliability.
- Mixing: configurable transition points, repeat/shuffle policies, gain analysis, limiter and improved preview tracking.
- Hardware: broader conditional/modifier mapping support, device-specific processors, controller feedback and testing on additional interfaces.
- Input/video: microphone/booth routing, recording input and video workflows after the underlying audio routes are verified.
- Service-dependent features: streaming integrations require their supported SDKs and service access; stems/Neural Mix, DVS and proprietary hardware functionality require separate implementation and verification.
The next stages remain planned work. Stage 1 automates timed transitions; it does not reproduce AI phrase selection or djay’s proprietary feature set.
+20 -21
View File
@@ -9,7 +9,7 @@ The main window has two tabs: **Karaoke** and **DJ Studio**. Both workspaces sta
- Cyan identifies A; amber identifies B. Each platter’s angle follows actual source playback time, including tempo changes, pauses and seeks. Drag around a platter to jog two source seconds per revolution. This is seek-based jogging, not vinyl scratching.
- Waveforms come from decoded audio and reuse existing waveform caches. Click/drag to seek. A white position line and green loop region show current state.
- High/mid/low EQ and the bipolar filter are beside each platter. Gain and level knobs have been removed from the on-screen decks. Drag a knob vertically; double-click to reset. Knobs expose adjustable accessibility actions and current values. EQ uses the existing three-band filters; filter is low-pass left, bypass centre, high-pass right.
- Play/pause, stop-to-start, set/return cue and four set/jump hot cues are per deck. Right-click a hot cue to clear it. Use the cue-time editor to set an exact cue in seconds or capture the current playhead without moving playback. Manual IN/OUT loops do not need BPM. Beat loops require an estimated, entered or tapped BPM; choose 1–32 beats. Loop toggles off on a second press and continues correctly at the end of a track.
- Play/pause, stop-to-start, set/return cue and four set/jump hot cues are per deck. Right-click a hot cue to clear it. Use the cue-time editor to set an exact cue in seconds or capture the current playhead without moving playback. Manual IN/OUT loops do not need BPM. Beat loops require an estimated, entered or tapped BPM; choose 1–32 beats. Loop toggles off on a second press and continues correctly at the end of a track. Changing the loop size resizes an active loop immediately, preserving its start and continuing playback; the end is clamped to track duration.
- Loading estimates BPM conservatively from up to the first 90 seconds of audio, searching 70–180 BPM; silence and steady tones remain unknown. Estimates show BPM~ and can be replaced by entering source BPM (40–240) or tapping at least three beats. Either Sync button links both decks to deck A’s effective BPM and both buttons show active. Press either again to unlink and restore both original tempos. Sync follows changes to A’s tempo; it does not align beat phase or detect a beat grid. Use the jog/nudge buttons to align beats. Tempo adjustment preserves pitch, using AVAudioUnitTimePitch.
- The crossfader and DJ output headroom affect only DJ playback. Equal-power and linear crossfader curves are selectable. The karaoke master and saved singer preferences are independent. The wing meters show individual deck peaks, not a summed master meter. There is no master limiter; use gain/levels appropriately.
- Karaoke and DJ music can play simultaneously. The existing background-to-singer interlock is preserved, but it does not automatically duck the new DJ decks.
@@ -18,6 +18,14 @@ The main window has two tabs: **Karaoke** and **DJ Studio**. Both workspaces sta
The DJ browser supports title/artist/album search and paginates in groups of 50. DJ playlists are stored independently from karaoke. Create, rename or delete them from the folder menu; right-click a song to add it to a playlist, remove it, or move it earlier/later. Karaoke library drag references are rejected by the DJ decks; import the source music using the DJ importer. DRM subscription streaming is not added.
## DJ queue and Automix — first feature stage
The DJ queue is independent of karaoke and DJ playlists. Add a song with its + button, use Add to DJ Queue in its context menu, add the current filtered library/playlist with the queue button, or drag from the DJ library into the queue. Duplicate songs are allowed. Reorder with the arrow buttons, remove entries, shuffle or clear. Queue order, fade duration and BPM-match preference save in `DJ/DJQueue.json`; relaunch never starts playback automatically.
Start Automix uses an already playing deck, or loads the first queued song into A. It preloads the next song paused on the silent deck, regardless of the load-autoplay preference. Near the current track’s end, it starts the next deck and moves the real crossfader over the selected 0–30 seconds. Zero seconds is a cut; short tracks shorten the fade. Mix Now begins the transition immediately. BPM matching optionally adjusts the incoming tempo when both BPM values are available and the ratio fits the selected tempo range. This is timed crossfading, not djay’s AI phrase selection or beat-phase alignment; see [djay’s Automix workflow](https://help.algoriddim.com/user-manual/djay-pro-mac/mixing-basics/using-automix) for the reference feature set.
Automix requires Internal mixer mode and starts only when at most one deck is playing. It waits for active loops, skips missing/unreadable queue entries, stops at the end of the final track, and yields to manual loading, transport, tempo/jog or crossfader control. Stop Automix relinquishes automatic control while playback remains available to the operator. Both DJ decks are used by automation; karaoke remains independent.
## Audio routing
DJ Settings → Devices lists CoreAudio outputs including the Mac’s speakers and the controller’s internal sound card, with automatic device-list refresh on connection changes. Choose a stereo channel pair next to each device, then Apply; Revert restores the applied configuration. Routing persists in `DJ/DJAudioRouting.json`.
@@ -40,33 +48,24 @@ Automatic detection is enabled by default. It matches exact endpoint names and a
The generic adapter handles standard note/CC and 14-bit pitch-bend bindings for available two-deck transport, cue/hot cues 1–4, loops, EQ/filter/gain, channel volume, crossfader, master/cue level, load and browse actions. It respects inversion, signed/offset relative encoders and soft takeover for supported absolute controls. Common play/cue/sync/headphone/loop/hot-cue LED outputs support explicit addresses, min/max values and inversion. Conflicting, conditional, modifier, HID or unsupported assignments are disabled and reported. djay custom processors, arbitrary predicates, displays, four-deck operation, proprietary scripts and rotary acceleration curves are not reproduced.
**Mixtrack Go** uses a dedicated native adapter when its supplied XML profile is selected or detected. This enables its 14-bit split-CC tempo, relative jog, channel faders, filter/low switch, browsing/loading, transport/shared Sync, headphone controls, hot-cue/loop pad modes and corresponding LED feedback. Apply Mixtrack Go Preset remains available as a direct alternative. Initialization sends identity and controller-state requests and refreshes LEDs after two seconds, because the startup demo can clear early LED state. Deck B pad mode uses XML address 95/00. Supported transport, mode, load, shifted transport and pad LEDs are driven from app state.
**Mixtrack Go** uses a dedicated native adapter when its supplied XML profile is selected or detected. This enables its 14-bit split-CC tempo, relative jog, channel faders, filter/low switch, browsing/loading, transport/shared Sync, headphone controls, hot-cue/loop pad modes and corresponding LED feedback. Apply Mixtrack Go Preset remains available as a direct alternative. Initialization sends identity and controller-state requests and refreshes LEDs after two seconds, because the startup demo can clear early LED state. Deck B pad mode uses XML address 95/00. Supported transport, mode, load, shifted transport and pad LEDs are driven from app state. App shutdown cancels initialization, clears the LEDs and pad-mode state, and ignores later feedback; selecting a saved direct preset repeats its startup handshake on reconnect.
**Limitations:** stems, sampler, FX modes, touch scratching, HID, motor feedback and controller certification are not implemented. Unsupported pad modes report the limitation. Tests exercised actual CoreMIDI output to a receiving virtual destination, including delayed LED refresh. The attached Numark MIDI endpoints and audio device were discovered, and its channel maps were checked; physical knob/button behaviour, visible LED appearance, Bluetooth delivery and audible socket isolation still need hands-on verification.
## Verification — 5 November 2026
- Debug build compiled for arm64 and x86_64 without distribution signing; the macOS XCTest suite passed **137 tests with zero failures** on Apple silicon. Intel runtime playback was not exercised.
- Tests cover actual looping playback including end-of-file, editable cues, linked Sync and tempo restoration, audio-derived BPM, Finder replacement confirmation, JPG artwork, real knob double-click resets, native fader orientation/actions, preset addresses, 14-bit tempo, pad modes, MIDI releases/persistence and virtual CoreMIDI input delivery.
- Existing karaoke, recursive CDG/audio import, independent DJ library/playlists, rotation, background handoff, media-copy repair and audio processing checks passed.
- Native console and settings captures use actual NSHostingView windows. Virtual CoreMIDI output and attached-interface channel maps were tested; physical button/LED appearance and audible output isolation remain to be verified. Loops/jogs use seek scheduling rather than sample-accurate scratching.
## Import repair and settings modal
Media imports now stream audio/CDG content into a private staging file, verify its SHA-256, and atomically rename it into place. Source permissions, ACLs and protected security-scope metadata are not copied. Failed or cancelled transfers remove staging files and never publish a partial destination. Existing empty destinations are not accepted as completed imports; retrying repairs them. Empty playback files show a reimport instruction instead of the raw AVAudioFile error.
The three zero-byte files observed in the local DJ media directory were repaired from checksum-matched originals. Their sources and library records were preserved; macOS afinfo successfully recognised all three repaired MP3s. The interrupted, unregistered item will be registered when its folder is imported again.
Studio settings open as a dedicated modal from the toolbar, sidebar or Command-comma. Song Settings also opens as a titled modal with a Done action. The deprecated AVAsset metadata read in FileTagWriter now uses asynchronous loading.
Verification includes partial-copy repair, source permission preservation, failed-verification/cancellation cleanup and readable empty-audio errors.
## Continuous console and separate preferences
The deck area is now one continuous console following the supplied reference: track headers and overview waveforms above; mirrored tempo/platter/EQ/filter wings; stacked, source-timed eight-second scrolling waveforms in the centre; and a shared bottom transport strip with a centred rectangular-cap crossfader. Native vertical tempo faders have visible scale marks, keyboard/accessibility support and a tested control-to-binding action. Play, Cue, loop size, headphones and hot cues remain available. No on-screen gain or channel-level knobs are shown. Track headers show embedded artwork or a nearby JPG/JPEG/PNG, prioritising a matching track name or cover/folder/front/artwork image. Platters have a clear rotating radial marker. Musical key analysis is not implemented.
Settings now use an icon-category toolbar with separate Karaoke and DJ selectors. DJ Settings opens directly in DJ scope; Audio Routing and MIDI open the corresponding DJ categories. Karaoke device routing applies only to the singer deck. DJ General, Sound, Library, Appearance and Advanced preferences are persisted independently in DJ/DJSettings.json. Working options include paused/automatic load, active-deck protection, reset EQ/filter on load, ±8/16/50% tempo range and inversion, equal-power/linear crossfade curves, output headroom, waveform colours/window/grid, rotating marker, inactive-deck dimming, library font/row height and optional hot-cue autoplay. MIDI learning is cancelled when leaving its settings category. Singer Web is available only in Karaoke settings, with its existing server controls preserved.
No nonfunctional switches were added for DVS, booth/microphone routing, Neural Mix, automix, recording, Spotify or cloud sync. Sync uses estimated or entered/tapped BPM for tempo matching; both overview and scrolling waveforms show BPM-relative beat guides, with stronger marks every four beats. Guides begin at source time zero and are not analysed downbeats. Active loops are highlighted green with IN/OUT boundary lines in both views.
Waveform beat guides use BPM and source time zero, with stronger marks every four beats; they are not analysed downbeats. Active loops have green regions and IN/OUT boundary markers. DVS, Neural Mix, booth/microphone input, recording, Spotify and cloud sync are not implemented.
Validation: full suite **137 tests, zero failures**, including preference persistence, load protection, EQ reset, cue autoplay, tempo mapping and native fader orientation/actions. Native console and settings captures were visually inspected. Temporary builds, logs and repair tools were moved outside Developer to /private/tmp.
## Import integrity
Media imports stream into a staging file, verify SHA-256, and atomically rename the result. Source permissions, ACLs and protected security-scope metadata are not copied. Failed or cancelled transfers remove staging files. Empty existing destinations are repaired on retry, and empty playback files show a reimport instruction. Original media and library records are preserved.
## Verification — 5 November 2026
The full macOS suite covers karaoke, recursive CDG/audio import, independent DJ imports/playlists, rotation, background handoff, media repair, real audio loops, live loop resizing, linked Sync, cue editing, waveform/BPM guides, Finder override, artwork, real knob double-clicks, native faders, XML profiles, automatic controller detection/reconnection, actual CoreMIDI output and delayed LED initialization/shutdown. Native workspace tab switching preserves simultaneous playback. Automix tests exercise timed transitions, both playing decks during a fade, manual takeover, loop waiting, unavailable files and queue persistence without launch autoplay.
Attached-interface checks verify available output devices and AUHAL stereo channel maps when the hardware is connected; that check skips when the interface is unavailable. Physical button response, visible LEDs and audible socket isolation still require hands-on verification. Builds compile for arm64 and x86_64; tests execute on Apple silicon. Temporary builds, logs, captures and scripts are under `/private/tmp/kjmix-xml-mappings`.