Split MIDI devices

Hi everyone !

I currently have two midi devices set as follow in a widget script:

send("midi:device_1","/control", 1, 1)
send("midi:device_2","/control", 1, 1)

It's clear that device_1 and device_2 have their own individual MIDI input and output.

But now I'm wondering, would it be possible to keep the original input of device_1 but to have as its output the output of device_2 ?

And vice versa device_2 would use the input of device_1 while keeping its original output.

Hope that it makes sense ?

Swayrian

I think you can do the swap at server level, in the midi port config. And they are static values.
For setting ports dynamically, custom module is the answer. You can filter out sent MIDI data based on certain conditions and change the output port.

Thanks for your response @ClelsonLopes !

Could you please guide me on how to get started with this ?
I'm totally lost when it comes to custom module as I've never wrote one before and looking at the documentation is not entirely helpful.

Side question, what are the advantages of using a custom module ?
I noticed many users are using it for example to send MIDI messages (I presume) but isn't it enough to just use and address, preArgs and a target or simply using the script field of a widget ?

What sort of things would you be able to push further with a custom module ?
Is there also a difference in terms of performance when using a custom module ?

Swayrian