Add Audio Stems panel with alt-audio-tracks integration and HTDemucs persistence#6255
Add Audio Stems panel with alt-audio-tracks integration and HTDemucs persistence#6255o0charlie0o wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an Audio Stems UI panel to the sequencer that mirrors SequenceFile::alt_tracks, including per-stem mini-waveforms, solo switching, import/rename/recolor/reorder, and a stem-based transient/onset → timing track workflow using aubio; also adds persistence helpers for HTDemucs-generated stems.
Changes:
- Introduces
StemsPanel,StemWaveform, andStemOnsetDialogUI components and wires them into the main sequencer layout + View menu toggle. - Extends alternate-audio-track support with
SequenceFile::MoveAltTrackand stem panel synchronization on load/close. - Vendors a minimal aubio source subset and adds a
WavWriterutility for writing cached stem WAVs.
Reviewed changes
Copilot reviewed 68 out of 68 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| xLights/xLights.cbp | Adds aubio include path + new stems/onset/wav-writer sources to Code::Blocks project. |
| xLights/Xlights.vcxproj | Adds new stems/onset/wav-writer + aubio C sources to the Windows build. |
| xLights/Xlights.vcxproj.filters | Adds VS filters and assigns new sources (including aubio) to filter groups. |
| src-ui-wx/xLightsMain.h | Declares new View-menu handler/IDs for the stems panel toggle. |
| src-ui-wx/xLightsMain.cpp | Adds “Audio Stems” checkable menu item + wiring and updates play-marker propagation. |
| src-ui-wx/wxsmith/xLightsframe.wxs | Adds wxSmith menu item definition + handler for “Audio Stems”. |
| src-ui-wx/sequencer/tabSequencer.cpp | Initializes stems panel timeline wiring and refreshes stems from alt-tracks on sequence load; updates play loop marker updates; implements toggle handler. |
| src-ui-wx/sequencer/Waveform.h | Exposes SetActiveAudioTrack publicly for solo switching; adds deferred-init state fields. |
| src-ui-wx/sequencer/MainSequencer.h | Adds StemsPanel member + accessor; stores main sizer pointer. |
| src-ui-wx/sequencer/MainSequencer.cpp | Integrates stems panel into sequencer layout and propagates timeline zoom/scroll changes to stems. |
| src-ui-wx/sequencer/RowHeading.cpp | Propagates row-heading width changes to stems header width. |
| src-ui-wx/import_export/SeqFileUtilities.cpp | Clears stems UI rows on sequence close to avoid stale rows across sequences. |
| src-ui-wx/sequencer/StemsPanel.h | Declares stems panel API (rows, import, solo, reorder, persistence hooks, scrolling/visibility). |
| src-ui-wx/sequencer/StemsPanel.cpp | Implements stems panel UI, alt-track synchronization, solo switching, drag-reorder, import, and context actions. |
| src-ui-wx/sequencer/StemWaveform.h | Declares per-stem waveform renderer with onset marker overlay support. |
| src-ui-wx/sequencer/StemWaveform.cpp | Implements per-stem waveform rendering, interaction, and preview marker drawing. |
| src-ui-wx/StemOnsetDialog.h | Declares onset/transient detection dialog + parameter UI and detection pipeline. |
| src-ui-wx/StemOnsetDialog.cpp | Implements aubio-backed onset detection + live marker preview + timing-track creation flow. |
| src-core/utils/WavWriter.h | Declares float-stereo WAV writer used for persistent stem caching. |
| src-core/utils/WavWriter.cpp | Implements WAV writing for cached stem output. |
| src-core/render/SequenceFile.h | Adds MoveAltTrack declaration to support reordering. |
| src-core/render/SequenceFile.cpp | Implements MoveAltTrack and updates ValueCurve alt-audio mapping after reorder. |
| dependencies/aubio/src/config.h | Adds aubio build configuration header used by vendored aubio sources. |
| dependencies/aubio/src/aubio_priv.h | Adds aubio private header (adapted to always include local config). |
| dependencies/aubio/src/aubio.h | Adds aubio umbrella header (not currently included by xLights code). |
| dependencies/aubio/src/types.h | Adds aubio core typedefs. |
| dependencies/aubio/src/fvec.h | Adds aubio real-vector API header. |
| dependencies/aubio/src/fvec.c | Adds aubio real-vector implementation. |
| dependencies/aubio/src/cvec.h | Adds aubio complex-vector API header. |
| dependencies/aubio/src/cvec.c | Adds aubio complex-vector implementation. |
| dependencies/aubio/src/lvec.h | Adds aubio double-precision vector API header. |
| dependencies/aubio/src/lvec.c | Adds aubio double-precision vector implementation. |
| dependencies/aubio/src/fmat.h | Adds aubio matrix API header. |
| dependencies/aubio/src/fmat.c | Adds aubio matrix implementation. |
| dependencies/aubio/src/musicutils.h | Adds aubio music utility API header. |
| dependencies/aubio/src/musicutils.c | Adds aubio music utility implementation. |
| dependencies/aubio/src/vecutils.h | Adds aubio vector utility API header. |
| dependencies/aubio/src/vecutils.c | Adds aubio vector utility implementation. |
| dependencies/aubio/src/mathutils.h | Adds aubio math utility API header. |
| dependencies/aubio/src/mathutils.c | Adds aubio math utility implementation. |
| dependencies/aubio/src/onset/peakpicker.h | Adds aubio peak picker API. |
| dependencies/aubio/src/onset/peakpicker.c | Adds aubio peak picker implementation. |
| dependencies/aubio/src/onset/onset.h | Adds aubio onset detection API. |
| dependencies/aubio/src/onset/onset.c | Adds aubio onset detection implementation. |
| dependencies/aubio/src/spectral/awhitening.h | Adds aubio spectral whitening API. |
| dependencies/aubio/src/spectral/awhitening.c | Adds aubio spectral whitening implementation. |
| dependencies/aubio/src/spectral/fft.h | Adds aubio FFT API header. |
| dependencies/aubio/src/spectral/fft.c | Adds aubio FFT implementation (compiled via project files). |
| dependencies/aubio/src/spectral/ooura_fft8g.c | Adds aubio Ooura FFT backend (compiled via project files). |
| dependencies/aubio/src/spectral/phasevoc.h | Adds aubio phase vocoder API header. |
| dependencies/aubio/src/spectral/phasevoc.c | Adds aubio phase vocoder implementation. |
| dependencies/aubio/src/spectral/specdesc.h | Adds aubio spectral descriptor API header. |
| dependencies/aubio/src/spectral/specdesc.c | Adds aubio spectral descriptor implementation (compiled via project files). |
| dependencies/aubio/src/spectral/statistics.c | Adds aubio spectral statistics implementation. |
| dependencies/aubio/src/temporal/filter.h | Adds aubio IIR filter API header. |
| dependencies/aubio/src/temporal/filter.c | Adds aubio IIR filter implementation. |
| dependencies/aubio/src/temporal/biquad.h | Adds aubio biquad API header. |
| dependencies/aubio/src/temporal/biquad.c | Adds aubio biquad implementation. |
| dependencies/aubio/src/utils/log.h | Adds aubio logging API header. |
| dependencies/aubio/src/utils/log.c | Adds aubio logging implementation. |
| dependencies/aubio/src/utils/hist.h | Adds aubio histogram API header. |
| dependencies/aubio/src/utils/hist.c | Adds aubio histogram implementation. |
| dependencies/aubio/src/utils/scale.h | Adds aubio scaling API header. |
| dependencies/aubio/src/utils/scale.c | Adds aubio scaling implementation. |
| README.txt | Adds release note entry describing the Audio Stems panel feature set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d990371 to
ccb684d
Compare
ccb684d to
fe616b3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 68 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fe616b3 to
d13affc
Compare
d13affc to
81f9ad8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 68 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b43491c to
ad3163b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 68 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ad3163b to
677a1a9
Compare
677a1a9 to
79486ae
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 68 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…persistence
Adds a collapsible stems panel below the main waveform with per-stem
mini-waveforms that mirror SequenceFile::alt_tracks 1:1. The panel works
with stems from two sources:
- Imported stems: any audio files prepared outside xLights (e.g. from
a DAW, an online stem splitter, or hand-rendered tracks). Pulled in
via the panel's Import action or the Sequence Settings alt-tracks tab.
- AI-generated stems: produced in-app by HTDemucs via the right-click
waveform "Stem — Drums/Bass/Vocals/Other" submenu. The result is
written to <showdir>/audio-stems/<sequence-name>/ and registered as
alt tracks, so re-running on the same sequence is an instant cache
hit instead of another inference pass.
Each row supports rename, recolor, drag-reorder, and a DAW-style "S"
(solo) button that switches main playback to that stem at the current
play position. Right-click on a row offers "Create Timing Track from
Transients..." which generates a timing track from stem onsets via
aubio's spectral-flux peak picker.
Stems imported via the panel and alt tracks added through Sequence
Settings stay in sync — both show in the panel and are visible to VU
Meter and Value Curve bindings.
79486ae to
48f7fd6
Compare
Summary
Adds a collapsible Audio Stems panel below the main waveform with per-stem mini-waveforms, a DAW-style S (solo) button per row, drag-reorder/rename/recolor, and a Create Timing Track from Transients... action backed by aubio's spectral-flux peak picker.
The panel is a 1:1 view over
SequenceFile::alt_tracks— so it works alongside the existing alt-audio-tracks feature, not as a replacement. Stems added through the Sequence Settings → Alt Audio Tracks tab show up in this panel automatically, and stems imported through the panel become alt tracks visible to VU Meter / Value Curve bindings just like ones added the existing way.The panel works with stems from two sources:
<showdir>/audio-stems/<sequence-name>/and registered as alt tracks, so re-running on the same sequence is an instant cache hit instead of another inference pass.The transient-detection dialog renders transient markers directly on the stem's waveform, so as you adjust threshold / silence / minimum-interval the marker positions update live and you can see what each setting change is doing. xLights already has a similar "Audio Onsets" path for the main waveform; this implementation is more parameterized and gives the visual marker feedback while you're tuning. Both are kept — the new flow is offered specifically from the per-stem context.
A demo video showing the full flow (panel toggle, import, S-solo, transient detection with live markers, save/reopen) is below.
Companion submodule PR
The aubio sources need to be added to the macOS Xcode project. That's in xLightsSequencer/xLights-macOS#8. Please merge that one first so the gitlink in this PR lands on a published
maincommit.Tested on
Xlights.vcxproj,Xlights.vcxproj.filters,xLights.cbp) have been updated with the new sources and aubio's include path, but those builds have not been exercised on this branch — happy to iterate if anything's missing there.Happy to discuss anything in this PR — implementation choices, scope, naming, alternatives, etc.
Test plan
Demo Video
Stems.mp4