message

e/midi/message

Creates a MIDI message
message
@/message
Creates a MIDI message
TYPEbyte
The type of the message
CHbyte
The MIDI channel. Value goes from 1 to 16.
D1byte
The first data byte. Value goes from 0 to 127.
D2byte
The second data byte. Value goes from 0 to 127. If the message is only 2 bytes long, this one is unused.
message
TYPE
CH
D1
D2
MSG
MSG@/message
To use the node in your project you should have the e/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 {
    meta {
        struct Type {
            uint8_t type = 0;
            uint8_t channel = 0;
            uint8_t data1 = 0;
            uint8_t data2 = 0;
        };
    }

    void evaluate(Context ctx) {
        auto msgType = getValue<input_TYPE>(ctx);
        auto channel = getValue<input_CH>(ctx);
        auto data1 = getValue<input_D1>(ctx);
        auto data2 = getValue<input_D2>(ctx);

        Type msg = {};

        msg.type = msgType;
        msg.channel = channel;
        msg.data1 = data1;
        msg.data2 = data2;

        emitValue<output_MSG>(ctx, msg);
    }
}