How to SEND or RECEIVE System Exclusive Messages?

I need help learning how to SEND or RECEIVE MIDI System Exclusive Messages.

Example: I need to SEND the following

"F0 7D 25 09 F7" to a MIDI Device

The device should answer with it's own SysEx message:

"F0 7D 25 09 43 50 34 38 F7"

HELP ?!?!?!?

Comments

  • Did you check the documentation ? Details on how to send are right here: https://webmidijs.org/docs/v2.5.2/classes/Output.html#method_sendSysex

  • Hi Jean-Phillipe,

    Thank you for the help..

    I did not find that document, so I am grateful for your assistance..

    Mike


  • [time=undefined] DOMHighResTimeStamp | String optional

    This value can be one of two things. If the value is a string starting with the + sign and followed by a number, the request will be delayed by the specified number (in milliseconds).

    This option can add a delay in milliseconds?

    That delay is not between bytes of the SysEx message?

  • That delay is not between bytes of the SysEx message?

    The delay is the time to wait before sending the whole message. It is NOT a throttling delay between bytes of the message.

  • Regarding the manufacturer ID, how do I send to a MIDI device when I don't know the manufacturer ID at the time the user connects?

    Is there a way to READ the manufacturer ID, or send to a MIDI device anyway?

  • how do I send to a MIDI device when I don't know the manufacturer ID at the time the user connects?

    You will have to ask the user. MIDI 1.0 does not offer a mechanism to query for the manufacturer (as far as I know). This is possible with MIDI 2.0 which is not yet available in the browser.

    Is there a way to READ the manufacturer ID, or send to a MIDI device anyway?

    Universal system exclusive messages are commands sent to all MIDI devices and supported by most manufacturers. In this case you would use a manufacturer id of 0x7E for realtime messages and 0x7F for non-realtime. Note that the universally-supported sysex commands are much-more limited than manufacturer-specific commands.

    Hope this helps!

  • Thank you very much for your help..

    Here s a link to our current "beta test" version of our device programmer.

    We have most of it working now, however, we are having trouble with sending and receiving system exclusive messages. I provided an example in a previous message for a typical command-response.

    We send "F0 7D 25 09 F7" to a MIDI Device

    The device should answer with it's own SysEx message:

    "F0 7D 25 09 43 50 34 38 F7"

    QUESTION: Would this be considered a "realtime" message, we also want to send larger system exclusive messages less than (512 bytes)

    Currently, we cannot receive system exclusive messages, so that is why we are looking to use your "WebMidiJS".

  • So, to  send "F0 7D 25 09 F7" to our MIDI Device:

    WebMidi.outputs[0].sendSysex(0x7e, [0x7d, 0x25, 0x09]);


    To receive the SysEx message (Answer) from the Midi Product?

    WebMidi.enable(function(err) {
    
                           if (err) {
                             console.log("WebMidi could not be enabled.");
                           }
    
                           var input = WebMidi.inputs[0];
    
                           input.addListener("sysex", "all", function (e) {
                             console.log(e);
                           });
    
                        }, true);
    


  • How to read the event payload?

    var midi_output = WebMidi.getOutputByName("ControlPad 48 MMode");

    console.log(midi_output);

    WebMidi.outputs[midi_output].sendSysex(0x7e, [0x7d, 0x25, 0x09]);

    Event Payload:

    • event Objecttarget Input
    • The Input that triggered the event.
    • data Uint8Array
    • The raw MIDI message as an array of 8 bit values.
    • timestamp Number
    • The time when the event occurred (in milliseconds)
    • type String
    • The type of event that occurred.


  • edited February 24

    So, to send "F0 7D 25 09 F7" to our MIDI Device:

    WebMidi.outputs[0].sendSysex(0x7e, [0x7d, 0x25, 0x09]);

    It really depends what you want to do. The code above sends a universal non-realtime message. In this case, the actual bytes sent out by WebMidi.js are:

    F0 7E 7D 25 09 F7
    

    I do not have enough information to know if this is what you want to achieve but I'm pretty sure it is not. `7D` is the "cancel" message. This message does not accept additional parameters so `25` and `09` are effectively dropped.

    Where did you get "F0 7D 25 09 F7" from? The 7D means it is not a universal sysex message. This, in turn, means you need to specify a proper manufacturer ID.

  • edited February 24

    To receive the SysEx message (Answer) from the Midi Product?

    Your code to listen for inbound sysex messages is correct. The e.data property will contain the actual inbound message. It's up to you to parse it.

  • Thank you Jean-Phillipe,


    Our application uses MIDI as a way to program our products.

    We have a Web-Based APP that allows users to create their own custom keyboard macros, then

    they will run a "Download" utility and switch their product into a MIDI device mode where it will connect

    and download their custom macro tables. Once programmed, they will switch their product back into a USB

    keyboard mode to operate.


    So, we don't have any use for normal MIDI messages like playing notes etc. We are only using MIDI because

    browsers easily allow us to connect to our devices and send program data to them.


    Our firmware programmer created the System Exclusive message format, so maybe that is why we might be having

    problems. The SysEx message "F0 7D 25 09 F7"  was literally invented by our firmware programmer as a device command

    to ask the MIDI device to identify itself, specifically, it ask the MIDI device to output its Model Number, or product number.

    We also have SysEx commands to get the firmware version, etc..


    QUESTION: Given what I just told you, are we going about this wrong in your mind?

    We need to be able to QUERY the MIDI devices for product specific information, and we need to be able to SEND or DOWNLOAD

    to the MIDI device custom tables which are no larger than 512 bytes total. That is how much FLASH memory is available inside

    the MIDI device.

  • edited February 25

    As you can see in the official list of MIDI manufacturer IDs, 7D has been "reserved for other uses". So, theoretically, you are not supposed to use it. The proper way is to get your own ID and use it in your products. If you did get your own id, you could even use standardized ways to retrieve device information such as the "Identity Request" and "Identity Reply" mechanism.

    If you do not want to get your own ID, you could still use 7D but if somebody at midi.org decides to put it to use, you will have a conflict. That's relatively unlikely but who knows...

Sign In or Register to comment.