I somehow got my children a synthesizer Yamaha PSR-550. The tool was not the first youth, but serviceable. The children showed enthusiasm and got accustomed with the synthesizer quickly: they sorted out with the controls, learned how to write banks, etc. The presence on the back of the synthesizer of the “MIDI IN” and “MIDI OUT” connectors did not give me any peace.
Formulation of the problem
In the last century, the easiest way to connect a computer and a MIDI synthesizer was to use the
game port . To match the interface signals (“current loop” in MIDI and TTL on the game port connector), a simple adapter was made, the scheme of which is given in the
Wikipedia article on MIDI :

Currently, game ports from sound and motherboards are gone as a class. Game port drivers for modern OS cannot be found.
')
The “physics” of the interface was, in principle, understood from the
Wikipedia article : data is exchanged using a start-stop protocol at a speed of 31,250 bits / s, sending 8 data bits each without parity with one stop bit. A logical flow of 5 mA corresponds to a logical zero in the signal circuits, and the absence of current in the circuit to a logical unit.
In principle, the game port can be replaced with a USB UART and connect the adapter described in the Wikipedia article to it.
The first problem with this solution is to make the OS determine the UART COM port as a MIDI port. Unexpectedly for me, a solution to the problem was found in the forums dedicated to Arduino. There I found a link to the free MIDI port emulator "on top" of the virtual COM port. For communication of the emulated port with a MIDI editor, the developer recommended using the virtual loop loopMIDI.
The second problem: make the UART work at a speed of 31,250 bps.
All this data was already enough to formulate a
technical proposal :
“To connect a computer with a synthesizer via MIDI interface, it is proposed to use USB UART together with an adapter for matching TTL signals with“ current loop 0… 5 mA ”signals, loopMIDI software, Hairless MIDI <-> Serial Bridge and UART drivers allowing it to work on speeds of 31250 bps. "Hardware
The choice of hardware solution was extremely simple - in the bins of the author of the article were found:
- USB UART based on CP2102;
- optocoupler AOT101A;
- microcircuit K1533LN2;
- a pair of SSH-5 connectors (other designations: ONTs-VG-4-5 / 16-V, DIN 41524);
- several meters of shielded acoustic cable SHGES.
As a result, the following adapter circuit was assembled on the trimming of a universal breadboard size 40x15:

The efficiency of the collected circuit was tested as follows:
- The adapter was connected to the MIDI synthesizer jacks.
- The synthesizer has local control disabled (MIDI Local = Off).
- After setting the jumper between the RX and TX signals of the adapter, the synthesizer began to respond to keystrokes.
I hope that the work of the scheme is clear without explanation. I note only that:
- elements of the K1533LN2 chip have an open collector type output that does not work without an external load;
- the capacitor C1 is connected as close as possible to the power pins DD1;
- the braid of the cable going to the “MIDI IN” connector of the synthesizer is connected only to the common wire of the adapter;
- the braid of the cable going to the “MIDI OUT” connector of the synthesizer is connected only to pin 2 of the connector.
Software
Then the following software was installed on the computer:
- VCP driver for CP2102 .
- A package of utilities for configuring the CP2102 .
- MIDI Port Emulator Hairless MIDI <-> Serial Bridge by Angus Gratton.
- Virtual MIDI cord loopMIDI by Tobias Erichsen.
- MIDI editor Anvil Studio.
Then in loopMIDI two cords were created - “Synthesizer” and “Keyboard”:

For connecting a MIDI editor with a MIDI IN synthesizer connector, the Synthesizer cord was connected between the Anvil Studio output and the MIDI port emulator input.
To connect a MIDI editor with a MIDI OUT synthesizer connector, a “Keyboard” cord was connected between the MIDI port emulator output and the Anvil Studio input.


The last and very important software configuration step was setting 31250 bit / s for CP2102 instead of 38400 bit / s:

After setting the speed, you must click the “Set Configuration” button. Then, in the Device Manager, and in the Hairless MIDI <-> Serial Bridge, in the settings for the UART CP2102 COM port communication speed settings, you need to select 38400.
Brief summary
As a result, Anvil Studio's MIDI editor received a communication channel with the Yamaha PSR-550 synthesizer. Children enthusiastically began to learn how to work with a MIDI editor. I regained my peace of mind.
PS How to set the speed of 31,250 bps instead of 38,400 bps for PL2303 was discussed
here .
PPS How to set the speed of 31250 bps instead of 38400 bps for CH341 I did not find anywhere.