user31105: I noticed when I use sketches with MIDI (using RX/TX), before uploading I have to remove every time the RX wire ... is there an easy way to prevent this?
(I'm thinking about making a push button/toogle for this to prevent it, but maybe there is an easier way).
Update: I use an Arduino Uno

user6802: To allow the bootloader on the Arduino MCU to communicate with the USB chip, the TXD/RXD pins are connected:

These connections have 1 kΩ resistors so that the signals of the USB chip do not interfere with your own hardware too much. However, this means that your own hardware can easily override those signals.
In this case, your MIDI hardware actively drives the RXD line to a high level.
You is no way to work around this in software.
You could try to replace the optocoupler's pull-up resistor (270 Ω) with a 10 kΩ resistor, which would make the USB controller's signals ten times stronger than the MIDI ones, but this might make the signal edges too slow.
To reliably prevent conflicts, you have to add a disable function to the MIDI receiver, or power it down, or disconnect it.

31105: <p>I noticed when I use sketches with MIDI (using RX/TX), before uploading I have to remove every time the RX wire ... is there an easy way to prevent this?</p>

<p>(I'm thinking about making a push button/toogle for this to prevent it, but maybe there is an easier way).</p>

<p>Update: I use an Arduino Uno</p>
 6802: <p>To allow the bootloader on the Arduino MCU to communicate with the USB chip, the TXD/RXD pins are connected:</p>

<p><img src="https://i.stack.imgur.com/vaVbr.png" alt="Arduino bootloader serial connections"></p>

<p>These connections have 1 kΩ resistors so that the signals of the USB chip do not interfere with your own hardware too much. However, this means that your own hardware can easily override those signals.</p>

<p>In this case, your MIDI hardware actively drives the RXD line to a high level.</p>

<p>You is no way to work around this in software.
You could try to replace the optocoupler's pull-up resistor (270 Ω) with a 10 kΩ resistor, which would make the USB controller's signals ten times stronger than the MIDI ones, but this might make the signal edges too slow.
To reliably prevent conflicts, you have to add a disable function to the MIDI receiver, or power it down, or disconnect it.</p>
