MIDI USB-to-RS232 bridge

PaulS

Well-known member
A Roland SC-88VL sound module has, besides MIDI inputs & outputs, also an RS232 interface that accepts MIDI data.
In order to send MIDI data from a DAW to my SC-88VL over USB using this RS232 interface, I hooked up a Teensy LC, configured it as USB MIDI device, connected a MAX3232 line driver to the TX1 pin, and connected the RS232 output of the MAX3232 [TXD only] with a DB9-to-miniDIN 8-pin cable to the SC-88VL.

IMG_20260828_210235.jpg


Using the code below I was able to get MIDI data from the DAW over USB and bridge it to the RS232 interface:
C++:
#include <MIDI.h>

void setup() {
  Serial.begin(115200);  // USB
  Serial1.begin(38400);  // hardware serial 1
}

void loop() {
  while (usbMIDI.read()) {
    uint8_t msgtype = usbMIDI.getType();
    uint8_t channel = usbMIDI.getChannel();
    uint8_t data1 = usbMIDI.getData1();
    uint8_t data2 = usbMIDI.getData2();

    Serial1.write(msgtype | channel - 1);
    Serial1.flush();
    Serial1.write(data1);
    Serial1.flush();
    Serial1.write(data2);
    Serial1.flush();
}

This works fine and the SC-88VL produces sounds as expected. Not sure though whether MIDI System messages will be OK?

The question I have is: is it possible to forward the raw MIDI packet data from USB directly to Serial1? So without interpreting the contents of the packet? Just forward an incoming byte from USB transparently to Serial1.

Thanks,
Paul
 
Back
Top