preenfm Forum

PreenFM => preenfm2 and preenfm3 => Topic started by: Toltekradiation on June 06, 2023, 07:39:43 PM

Title: Mixer select from midi
Post by: Toltekradiation on June 06, 2023, 07:39:43 PM
Hello Xavier,

lately I tried to recall Mixer files from midi,
but found it a bit tricky to do, because of the CC#0 & #32 to set before sending program change.

In my opinion, it would be much easier to use midi bank 127, and program change.
I don't think midi bank 127 is likely to be frequently reach anyway !

for now, I'm a bit lost in the code, i guess it should be done in MidiDecoder.cpp but i have a hard time figuring things out :P

i would be grateful for some help here ;D
Title: Re: Mixer select from midi
Post by: lokki on June 06, 2023, 08:02:09 PM
i did some similar work on preenfm2, but i have no access to those files anymore. in my opinion (if you tackle this) it makes much more sense to implement this as an option in the settings. it is very likely that a user will set this once for his setup... so an option to choose what Program Changes should do on the preenfm3, either load a different sound on that channel, or load a whole mix. i think there is a global midi channel on preenfm3 as well? it was another thing i added on preenfm2. so maybe program changes on global midi channel could load a new mixer file?
Title: Re: Mixer select from midi
Post by: lokki on June 06, 2023, 08:04:11 PM
and yes i believe i added it to the MidiDecoder.cpp on preenfm2

Title: Re: Mixer select from midi
Post by: Toltekradiation on June 06, 2023, 08:11:45 PM
Thanks for that, using global midi make sense indeed !
Title: Re: Mixer select from midi
Post by: Xavier on June 06, 2023, 09:10:02 PM
I'm not sure what you're trying to do.
Just to get rid of the CC#0 ?

You can try to modify this part
https://github.com/Ixox/preenfm3/blob/master/firmware/Src/midi/MidiDecoder.cpp#L336

Code: [Select]
            newAction.action.param1 = bankNumber[timbres[0]];
            newAction.action.param2 = bankNumberLSB[timbres[0]];

Idea (not tried):

Code: [Select]
            if (newModeEnabled && bankNumber[timbres[0]] == 0 && bankNumberLSB[timbres[0]] == 127) {
                // Load mixer
                newAction.action.param1 = 1;
                // Load mixer from first bank only
                newAction.action.param2 = 0;               
            } else {
                newAction.action.param1 = bankNumber[timbres[0]];
                newAction.action.param2 = bankNumberLSB[timbres[0]];
            }

As written in code comment, that will only load mixxer preset from Mixer bank 1.
But you can also decide that bankNumber >= 64 is mixer and adapt the code.
Title: Re: Mixer select from midi
Post by: Toltekradiation on June 06, 2023, 09:52:11 PM
ah ok, thank you, it is very helpful.
I do it to make the mixer loading a little bit simpler, i scratched my head yesterday trying to load one, and i did not understood how it works at first.
As it's not the first time i face this, i thought it would be good to simplify it.

But now i have the need for a special track on my sequencer to handle this,
maybe i will stick to discrete program change, as it's so much easier.

sorry to bother, thanks for your help !
Title: Re: Mixer select from midi
Post by: Lcerutti on June 28, 2023, 02:12:42 AM
“Recall Mixer files from midi”  :o this could be really fun and useful. Neat idea.
Title: Re: Mixer select from midi
Post by: Xavier on July 07, 2023, 07:45:05 AM
You can
“Recall Mixer files from midi”  :o this could be really fun and useful. Neat idea.

You can already do that.
Toltekradiation try to find an easier method.

Today to select a mixer from midi :
Send CC#0  = 1
Send CC#32 = the mixer file number [0-127]
Then program change will load a mixer from the bank you selected with CC#32.

To go back to preset selection :
Send CC#0  = 0
Send CC#32 = the preset file number [0-127]
Then program change will load the preset from the bank you selected with CC#32.