Hi,
Midi has 'channels' built in to the protocol so a midi keyboard sending on channel two will be ignored by a device that listens on channel one.
Default settings on midi devices are generally 'omni' so, by default, everything should work with everything.
If you have two hardware midi instruments, instead of patching the midi cable in and out as required, you can set your instruments to listen on channels 1,2,3 (etc..however many you have).
Then, to choose what hardware instrument you're going to be playing, you tell your midi controller to send on channel 1/2/3 etc.
The cable setup is
keyboard midi output to first instrument midi input
first instrument midi thru to second instrument input
second instrument thru to third instrument input
'thru' is like a splitter for midi, I guess - It sends on a copy of whatever is received at the input.
Now, that's theory. Whether your specific midi devices all support this is another question.
The other half of that is the analog audio return journey.
You could either make sure that every hardware midi device is returning its audio output to an available audio input on the mixer/interface,
or you could set up and audio patchbay that lets you quickly switch which device is returning.
Again, I'm making general statements rather than checking your specific gear specs. Sorry....got a few things going on!