Skip to content

Conversation

@blackhold
Copy link
Contributor

Description

Allow convert tracks to STEMS using axeldelafosse/stemgen + install stemgen on debian

Changes

  • Asks to user to install stemgen if true, install the dependencies
  • Add the option to convert track to stems. Right click on a track > Analize > Convert to stems
  • Opens a window to manage conversions (need fix/help, I'm not able to close it)
  • Adds a button to open stems conversions window below stems hamburger menu (I'm not able to make it appear)

Need help

  • Allow close stems conversions manager window
  • Get the history of conversions working
  • Detect when a conversion has finished and reload the library (whole? or only for this track?)
  • Get the button of stems conversions manager window, working

This is my first c++ contribution, I'm not used to work with this language, on collaborating with this PR, I'm trying to learn this programming language. Apologies in advance for any damage I might be causing with this piece of code. Also, my apologies for getting a little confused with the PRs on GitHub.

Thanks @daschuer for encouraging me to participate and to learn.

Related Issues

Related #15307

@github-actions github-actions bot added ui build developer experience Issues, bugs and PRs related to the development process, development environment & developer docs labels Jan 19, 2026
@blackhold blackhold changed the title Allow convert tracks to STEMS using axeldelafosse/stemgen + install stemgen on debian #15880 Allow convert tracks to STEMS using axeldelafosse/stemgen + install stemgen on debian #15307 Jan 19, 2026
@blackhold blackhold changed the title Allow convert tracks to STEMS using axeldelafosse/stemgen + install stemgen on debian #15307 Allow convert tracks to STEMS using axeldelafosse/stemgen + install stemgen on debian Jan 19, 2026
Tracks: avoid re-sorting table when purging/hiding tracks
Interface preferences: use main window screen to detect if skin fits
@Eve00000
Copy link
Contributor

Thank you for this PR,

As a first-time contributor we need you to sign the Mixxx Contributor Agreement and comment here when you have done so. It gives us permission to distribute your contribution under the GPL v2 or later license and the Apple Mac App Store. It is also helpful for us to have contact information for contributors in case we may need it in the future.

@Eve00000
Copy link
Contributor

A few general comments/questions before diving into the code.

  • Have you considered giving the user the option to choose between generating lossy and lossless stems?
  • Above all, the DJ doesn't want to interrupt the "music playing" part of Mixxx by running other threads (on potentially less powerful machines). When combined with, for example, rubberband stretching (which requires a lot of processing power) or when using DVS with very low latency, the stem conversion can cause problems/itches in the music playing. Have you considered calculating "available CPU/memory"? Warning the DJ to only continue if they're preparing at home or on a very powerful PC?
  • Have you considered checking disk space and warning the user about the required space?
  • Mixxx is used on various types of machines with all operating systems, why are you focusing only on Debian?

@daschuer
Copy link
Member

Thank you. This looks nice. I am happy you enjoy the work with us even if you it some pit falls.

You should really use git branches to not loose some valuable work one day.
In this case do:

git checkout -b stemgen
git push --set-upstream origin stemgen

Than create a new PR from the branch and copy over your comments

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

Thank you :-)

setMinimumWidth(600);
setMinimumHeight(400);

// Fer la finestra modeless (no bloquejant)
Copy link
Member

Choose a reason for hiding this comment

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

We use English comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one escaped me. This night I'll fix and create my own branch.

}

void DlgStemConversion::createUI() {
QVBoxLayout* pMainLayout = new QVBoxLayout(this);
Copy link
Member

Choose a reason for hiding this comment

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

Because this pointer is managed by the QT object tree and no delte is required we hide the new like this with our own Mixxx solution:

Suggested change
QVBoxLayout* pMainLayout = new QVBoxLayout(this);
parented_ptr<QVBoxLayout> pMainLayout = make_parented<QVBoxLayout>(this);

You can apply this pattern to the other new calls as well.

@blackhold
Copy link
Contributor Author

blackhold commented Jan 19, 2026

A few general comments/questions before diving into the code.

  • Have you considered giving the user the option to choose between generating lossy and lossless stems?

Yep, what initial I was planning is when you click to convert to stems, it appears a dialogbox to choose all of this. Also stemgen only allows wav, flac and don't remember what more, for example mp3 don't allows to convert.

  • Above all, the DJ doesn't want to interrupt the "music playing" part of Mixxx by running other threads (on potentially less powerful machines). When combined with, for example, rubberband stretching (which requires a lot of processing power) or when using DVS with very low latency, the stem conversion can cause problems/itches in the music playing. Have you considered calculating "available CPU/memory"? Warning the DJ to only continue if they're preparing at home or on a very powerful PC?

ok! nice! interesting contribution. Maybe the recommendation is not to convert tracks to stems when DJing.

  • Have you considered checking disk space and warning the user about the required space?

ok! I'll try to implement.

  • Mixxx is used on various types of machines with all operating systems, why are you focusing only on Debian?

I'm using debian, now I don't have other operating systems prepared to development, maybe I can prepare a virtualized windows, but take in mind that is my first time with c++, please give me some time to clarify 😅.

@daschuer
Copy link
Member

I think we need to consider the deployment a bit.

I can imagine to deploy with the stem menu option but without stemgen itself.
When selecting the menu icon install instructions may pop up, or executed right away after confirming.
After that Mixxx can look for the install installation and exectute the stemgen process like you do now.
This will be a bit of OS dependent code.

The other option would be to deploy the tool within Mixxx. I have no experience how Python programs are normally deployed to a user that have no clue about pip and fiends.

Last year we had a GSoc project porting a stem generator to CPP for fast execution
https://github.com/mixxxdj/demucs
Maybe @dhunstack can be a brief update about the status and how it relates to this PR

@blackhold
Copy link
Contributor Author

Before knowing the existence of axeldelafosse/stemgen I tried to create a script that converts the audios to STEMS but was not working properly. The idea is to parse the track (with right format and extension) to htdemucs and then when you have the audios divided, you have to create a m4a with ffmpeg file that in metadata it has a kind of json. I can try to adapt the code in the same way. Now "the problem" is to install axeldelafosse/stemgen that is python, then the "problem" will be demucs. I have to search and see which is the best solution. Maybe I could find a project in c++ that has demucs implemented.

Also in demucs we shall be aware about using CPU or GPU, always GPU support will be faster. Also we shall to see the Mx Apple CPUs that have NPU.

I like it, I can see that this will take more work than I expected :)

@daschuer
Copy link
Member

It is a good idea to go in small steps. Using stemgen here is a good approach to have a quick usable result.
The intergation challenges are similar.
So I would stick with it for now. Once it is working so you can one by one improve it.

My post was more a cell for opinions on this of the others. @ronso0 is our GUI expert @acolombier and @JoergAtGithub where mentor in @dhunstack project.
So they are probably better qualified to outline a good way forward.

@blackhold
Copy link
Contributor Author

Later I'll create a new branch related to stems.

About GUI, I was thinking that the wheel-type volume control might be a bit difficult to operate with the computer mouse and maybe it would be more interesting to use a sidebar or horizontal bar. What is the idea of ​​integrating stems with mixing consoles? Because the one I have doesn't have a place to manage stems. It's already difficult for me to control the intensity of the effects.

Copy link
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

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

Thank you for looking into this!

This actually clash with a very early proposal I was planning to start working on, which was allowing to define "Scripts" that could be summoned on tracks, including a lightweight API to interact with the Mixxx database (e.g after running a stem separation, duplicating cues for the newly created track and auto hide the stereo track...), similar to Gimp or Blender.

A few early comments on this initial efforts with direct integration to axeldelafosse's stemgen.

  1. Last time I checked, this project suffers from a few issues regarding transparency and license infringement, bundling some executable directly into the repo and shipping them into non compliant licenses. I think there is a serious risk for Mixxx integrating with it directly and potentially repercussion, as well as reputational damage, or at least ethical questions.
  2. This project is using the Facebook's initial research project and thus comes with pytorch and cuda, which total for over 6 GB of dependencies.

As Daniel mentioned, @dhunstack had worked on making the research project into a productionised ONNX model. I appreciate that integrating ONNX into Mixxx is still to be done and having an intermediary solution may not be a bad shout, but I would advocate to still push in the right direction and use a tool that can support Mixxx's ONNX model

Copy link
Member

@JoergAtGithub JoergAtGithub left a comment

Choose a reason for hiding this comment

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

I have to second @acolombier, using axeldelafosse/stemgen contradicts the work we've done over the last ~9 months. Mixxx is a cross-platform application and supporting only NVIDIA hardware acceleration does not fit, despite that axeldelafosse/stemgen implies the installation of a Python runtime and other dependencies.
The way to go is to add onnxruntime as a dependency and use the ONNX Demucs model from mixxxdj/demucs for stem separation.
But the GUI part implemented in this PR might be useful once all the parts are in place.

Bumps [azure/trusted-signing-action](https://github.com/azure/trusted-signing-action) from 0.5.10 to 1.0.0.
- [Release notes](https://github.com/azure/trusted-signing-action/releases)
- [Commits](https://github.com/azure/trusted-signing-action/compare/v0.5.10...v1.0.0)

---
updated-dependencies:
- dependency-name: azure/trusted-signing-action
  dependency-version: 1.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@blackhold
Copy link
Contributor Author

blackhold commented Jan 19, 2026

OK @acolombier and @JoergAtGithub. It wasn't my intention to interrupt anyone's work; I hadn't seen this other repository, and it's infinitely more complete than anything I could have created.

I propose reverting any commits I may have made to my implementations (except for the one fixing the Debian dependencies, which is where it all started and what motivated me to continue contributing).

I've created a branch at https://github.com/blackhold/mixxx/tree/stemgen, I will try to continue implement stemgen looking how axeldelafosse/stemgen do creates the stem files, but using mixxxdj/demucs project (does it is working well?).

As I told, I'm starting to use C++. Yesterday, with what I did, I started to understand a little more about how a program in this programming language is structured, although I still feel quite lost.

@JoergAtGithub
Copy link
Member

JoergAtGithub commented Jan 19, 2026

Don't get us wrong, the GUI part of this PR is something we need and very welcome! Only using axeldelafosse/stemgen as backend is the part that does not fit.
As you are working on Debian dependencies, maybe you would like to help us to make onnxruntime available as dependency for Mixxx?

@JoergAtGithub
Copy link
Member

We've an Epic issue that describes the steps of implementing stem seperation in Mixxx: #15495

@blackhold
Copy link
Contributor Author

blackhold commented Jan 20, 2026

@JoergAtGithub ok! I will try then to implement the GUI stuff, next is try to make appear the damn button!!! create a window to choose the conversion options and the window to see previously converted tracks. With the implementation of axeldelafosse/stemgen I almost understood how to interact with other applications.

Yep! all related to deployment of applications in Debian, I'm hard on it. Also to deploy python applications.

I will replace axeldelafosse/stemgen with https://github.com/mixxxdj/demucs

…ns/2.5/azure/trusted-signing-action-1.0.0

Bump azure/trusted-signing-action from 0.5.10 to 1.0.0
@blackhold
Copy link
Contributor Author

Hi! Right now working on it! I don't know if I have time to end it now, but at the moment:

  1. updated debian_buildenv.sh to use htdemucs and deleted stemgen
  2. window to choose quality (planning to see htdemucs options for more options)
  3. the next window goes to history of conversions and state of current conversion (with status)
  4. fighting to make button appear

One question, if I want to upload my branch commits what I have to do?

  1. In github blackhold/mixxx sync branches?
  2. In my local computer git, place to 2.6 and pull changes?
  3. In my local computer git, merge stemgen branch to 2.6?
  4. In github blackhold/mixxx make PR from blackhold/mixxx/2.6 to mixxxdj/mixxx/2.6?

How to link to this PR? or I have to create a new one?

Many thanks!

@blackhold
Copy link
Contributor Author

blackhold commented Jan 22, 2026

Got it!

It is using htdemucs (installed via pip) and compiled MP4Box (gpac) 2.4 (last stable). I tried to use mutagen, pymp4, direct edit metadata, but I was not able. This is the only solution I found. I don't know this solution is ok for you.

ba319f1

I have to continue working in some other things, the button to be able to open conversions window (or/and maybe put in the menu), also I'm thinking if its possible to edit colors (or if it is recommended) from each track (direct in steams area or/and in metadata window adding a new tab), also offer more options to htdemucs (allow user to use gpu or cpu, etc. I have to dive a little bit with htdemucs options) and finally to control resources (cpu, hard disk usage, ram).

At the moment I used htdemucs over cpu, I know how to install CUDA and test htdemucs in a machine with an NVIDIA P100 with 6Gb of GPU, but I don't have graphical environtment in this other machine. Is for AI models testing.

Here you have some snapshots with the process/progress. Remember that the place is right click on a track > analize > convert to stems.

imatge imatge imatge imatge

Good night! I go to sleep 🙈

UPDATE: I think that the way I'm using MP4Box I can implement in c++ I was using python 'cause I started working with python libraries.

@daschuer
Copy link
Member

Great progress, thank you.
You need to make a feature branch for each change.
Small self contained changes are key, to get it merged.
In this case you need to open a new PR from such a feature branch.
Some more details here:
#15826 (comment)

It would be nice to finish your other Debian environment PR first. This is suitable to become familiar with git.
Make sure to do a backup copy of these changes first to Not Put them on a risk.

#15826
Has some open comments not included in:
#15875

@blackhold
Copy link
Contributor Author

Moved to a separate branch as suggested by @daschuer.

New PR: #15891

See the new PR for the latest updates.

@blackhold blackhold closed this Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build developer experience Issues, bugs and PRs related to the development process, development environment & developer docs library packaging preferences ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants