I don't know anything about MIDI,
Musical Instrument Digital Interface, basically it's serial communication at 31250 Baud rate.
MIDI is an asynchronous serial interface. The baud rate is 31.25 Kbaud (+/- 1%). There is 1 start bit, 8 data bits, and 1 stop bit (ie, 10 bits total), for a period of 320 microseconds per serial byte.
http://www.gweep.net/~prefect/eng/reference/protocol/midispec.html
I do think you can connect multiple devices to one Rx,Tx line, as long as you can have 1 master device, and all the rest are slave devices - meaning they are smart enough to transmit only when directly commanded to do so by the master.
nope, midi devices normally transmit data without being instructed from another device, e.g. when you're playing a midi piano keyboard, that's why I was thinking of using some kind of buffering. If I'm not mistaken the max485 chip has no buffering capability so I thought of using attiny2313.
I thought about UART to I2C conversion but the prob with I2C is that the master can only receive data from one slave device at one time, so again you'd need some kind buffering, and if you're e.g. playing a midi piano keyboard to one input of the midi merger and playing a sequencer to another input, you need this whole circuit/code to work fast. And afaik a slave device can not (over I2C bus) tell the master device to start listening to it.
Midi messages are 10bits long (except SysEx messages), so the Uno could toggle between the two midi inputs, as soon as it sees a Start Bit it would stop the toggle and continue to listen until the Stop Bit then if there is more data coming, it would continue to listen to the same input port, if there is no more data coming it would begin to toggle again, and so on....
Sys Ex would be dealt with a bit differently.
That's how I imagine the rough structure now.
Then, for hookup, you run Tx from the master to Rx on all the slaves, and you take the Tx pins from the slaves and wire-AND them together to feed to Rx on the master. Wire-ANDing should be doable either with diodes and a pullup-R, or else using 74LS or 74HC chips. It might work, :-).
Could not find a good explanation on the net about wire ANDing. If I understand correctly you mean to use AND gates for selecting which slave device the master Uno is listening to?