I'm building a MIDI device and I'd like to make a solution to use the Arduino Nano's serial port for programming AND send/recieve MIDI messages (but not in the same time). I've ran out of free pins, so software serial can't work, and I don't want to use a switch for this purpose, but I thought it could be possible to build a logical gate for the stuff. Do you think it's resoluble? Which gate do I need, OR or NOR? Any experiences with this idea?