send(usb-midi)

e/usb-midi/send(usb-midi)

No description
send(usb-midi)
@/send(usb-midi)
MIDI@/usb-midi
MSGe/midi/message
SENDpulse
send(usb-midi)
MIDI
MSG
SEND
DONE
DONEpulse
To use the node in your project you should have the e/usb-midi library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        if (!isInputDirty<input_SEND>(ctx)) return;

        auto MIDI = getValue<input_MIDI>(ctx);
        auto msg = getValue<input_MSG>(ctx);

        uint8_t data[4];
        data[0] = msg.type >> 4;
        data[1] = msg.type | msg.channel;
        data[2] = msg.data1;
        data[3] = msg.data2;

        MIDI->write(data, 4);
        MIDI->flush();

        emitValue<output_DONE>(ctx, 1);
    }
}