You will need a piece of Bakelite perfboard that is 10 holes long by 10 holes wide. Use the white divider squares as a guide and mark your cut with a marker.
You'll need one 10 hole by 10 hole piece of perfboard for every MIDI friend. The piece will be slightly larger than the QT Py RP2040 to allow for enough room for the headers and TRS or DIN-5 jack.
Solder the socket headers to the QT Py RP2040 so that the sockets are on the USB side. You may want to use a QT Py board with plug headers as a soldering jig.
Cut two strips of plug headers that are seven pins long. Plug them into the QT Py RP2040's socket headers as a soldering jig.
Place the piece of perfboard with its solder pads facing up. Insert the plug headers into the perfboard so that their tips are visible, as shown in the picture.
Since the Bakelite perfboard only has solder pads on one side, you will need to solder the headers at an angle from the side. Solder the headers in place.