I dont think I understand what you mean, but, if I do, then you could look into using spleeter. It separates musical stems.
https://news.ycombinator.com/item?id=21431071
https://github.com/deezer/spleeter/wiki/2.-Getting-started#u...
https://news.ycombinator.com/item?id=21431071
https://github.com/deezer/spleeter/wiki/2.-Getting-started#u...
This model assumes the timbre is independent of the tone, but I can see now that this assumption is quite wrong and something more complicated (like this ML modeling) would be needed.
This might help you?
So not only is timbre not independent of frequency, summing multiple notes is also non-linear. The "beating" this causes is most obvious on the second chord to play. This beating is not consistent as the notes change, it's based on the difference in frequencies between the two notes being played.