Multiple Triggerable Sound Layers?

Hi! Im kinda new in here but I would love if someone has a hint or believe this can be attainable.

I'm thinking on make the music variable according to my group party (each character is defined by an instrument, and that instrument will plays in the background only if he is in the party)

so imagine I have a song with a melody, rythm and harmony, and if the character plays the drums and he is the only member of your crew, you only gonna listen the rythmic part, if a guitarrist joins your crew, a guitar will be add to every single theme in the whole game.

My first idea after i realized that make multiple triggerable sound layers without MIDI Support is beying my knowledge in programing, was to create an audio file for every variable in the game, since I want to use a large amount of characters and considering every single combination would take a LOT of audio to load in the game, and it would create an insane overload of files for each single song.

So, do you guys think that is there a chance to load (idk) 5 layers of the same song, each one plays only one instrument and can be switched on and off depending on whos in your party?

The BEST example I can bring happens in Super Mario World, everytime you get Yoshi, the music in the background adds the drums section.

In fact that seems pretty easy to do with only 2 layers like in SMW, since it doenst have more variables.

Best reggards!
up! (Sorry for that)
I found this old thread, seems like it might be helpful~
🙏
I found this old thread, seems like it might be helpful~
🙏

I tried that solution you shared (Thanks!!) a couple weeks ago, finally i droped the idea because it demanded audio files too heavy and since i've heard about MV having troubles when audio files weight too much, alsoo my idea was too ambicious (basicaly create multiple ost variations according on whos in your party) for my coding knowledge.

Maybe i'll retry after learning some js☺️

Original thread: https://forums.rpgmakerweb.com/threads/multiple-triggerable-sound-layers.116340/