An Arduino Mega has 4 Serial devices in hardware.
A cheap way to add extra USARTs is to add extra Atmega 328s connected to the "master" Arduino by SPI....R
A one-to-one can be done. A one-to-many can be done. A many-to-many can't be done reliably without uarts.But why the use of the uart? What you want to build is basically a router. And that can simply be done with multiplexers. I have no experience with MIDI (so not sure about electrical requirements) but you can look at e.g. the 74HC4067.Each 4067 has 16 inputs; one of them can be routed to the output. Use two or more (each individual input going each an input on each 4067) and you can expand the number of outputs. With ease you can go to 16x16.You can use port expanders or shift registers to control which input has to go to which output.You will have the same problem as with a real patch panel; that is, if you patch (switch) while a command is being send, it will result in data corruption.Note:you might need additional electronics to meet the specification
I think I would need to involve "bit banging" (emulating serial connections by programming digital inputs).
As indicated, you would have the same problem with a physical patch panel. If that is a concern, the solution will not work.
That won't be any better than SoftwareSerial and that is pretty crap. A 16 MHz MCU is not fast enough.You need multiple UARTs - hence my suggestion. You could write a standard program for each "slave" Atmega328 so that it receives and buffers the incoming data and passes it to the master whenever requested. Likewise for sending stuff on behalf of the master....R
I found this as a possible faster Arduino:
As of March 2015, the LeafLabs Maple line and the libmaple library are end-of-life and no longer supported by LeafLabs.
Quote from that websiteThere are Arduino products with high-end MCUs but I still think you will need multiple hardware UARTsYou have not mentioned at all how much data will need to be manipulated - how many bytes per second when they are all working, and what sort of manipulations will need to be done.Perhaps you really need the power of a high-end PC?By the way I know nothing about midi or music - except to listen to....R