Need a bit of help with MIDI forwarding


#1

hello community,

i'm making an object to do MIDI routing via class compliant USB MIDI interface (Miditech Midiface 8x8).

so far it's based on Technobear's MIDI Thru object and routes MIDI from any of 9 available physical MIDI In ports to any of 9 physical MIDI Out ports (Axo MIDI ports included, so 9, not 8). this was not difficult to do, and it works as expected.

now i want to add more functionality for routing messages from certain MIDI In ports.
i want it to route incoming MIDI messages to different MIDI Out ports depending of MIDI channel of incoming messages — for example, if incoming message has MIDI channel 1, it's routed to MIDI Out 1, but if it has MIDI Channel 4, it's routed to MIDI Out 4.

there are many examples of MIDI Out objects in the library that send messages to certain port and channel, so this part of job is more or less clear.

what is not clear is the receiving part.
could anyone point me to the examples of objects that listen to certain MIDI channel? or maybe someone has an example of MIDI script doing this kind of job?

disclaimer: i will borrow your code unless it's under some resrictive license :crazy_face:

thanks in advance.

P.S. why i need this and care about this — because in 2019, physical MIDI ports still work at 31250 baud rate. so the less messages in every single port — the better.


#2

disregard.

seems like i was too sleepy last evening, but now i inspected some midi/in objects deeper and figured out how to do what i want.

so, the patch will forward messages from MIDI controllers (plugged in certain ports) to different MIDI Out ports depending of message MIDI channel.

if someone's interested, i'll share the resulting patch with embedded custom object(s) when it's ready.


#3

Was going to post some midi thru objects I'd made that do this kind of thing (I'm using the midiface 4x4) 'if a message comes on this port with this channel send to this port on another channel' type stuff.

Glad you got it worked out!


#4

so, please post, i'm curious now.
maybe yours are coded more elegant than mine, because my coding skills are … meh :smiley_cat:


#5

I guess you figured out.. what I do is a subpatch with midi selector (or pre-assigned midi channel) and then use it internally or like in this case that I go from channel 6 of my sequencer to channel 1 of my synth.


#6

That's what I used to do, but I think it uses more sram than a simple thru object...

I'll try and post mine over the weekend


#7

found a topic with another example of what i want … and probably Patching is not right category for my topic


#8

Here's a midi thru object that lets you choose incoming/outgoing channel/device, and let's you limit the note range and toggle on/off notes, ccs or clock

thru options.axo (5.3 KB)


#9

thanks a lot!
looking inside your object, i see how i can improve my code — that's what i wanted.