Parsing Raw Sysex into format for sendSysex function.

I don't know enough about Sysex for this to be a generic thing, but I wrote some code to parse raw Sysex used for manipulating Meris Pedals into a format for the sendSysex function for the Output class.

This was kind of a blocker for me in terms of using the sendSysex functionality, but after doing a bit of research, the code should work for all of the Meris Factory Presets for all of the pedals.

I will probably have an inverse function to take the binary data and store it as Sysex, but I think I can probably derive this from the state of the application as opposed to the midimessage from the device itself.

It would be nice to have the functionality of sending raw Sysex out of the box, but I understand if it's out of scope for this project. Would be happy to make a small utility library if this is helpful for other people.

Comments

  • Thanks for sharing!

    This got me thinking... Maybe I need to find a way to let developers contribute modules that would facilitate encoding and decoding of device-specific sysex messages. There is no way I can write code for all existing devices but by allowing others to plugin their device-specific code, we could collectively build a library supporting an ever-growing number of devices. I would just need to provide a framework and instructions on how to it. I think this could work...

    By the way, you should be able to send "raw" sysex data with the send() method. If it does not work for you, please let me know so we can fix it.

    Cheers!

  • I think if we go the module route, a module should, at a minimum, decode and validate Sysex commands.

    Requiring encoding might be difficult.

    I have a data sheet from another developer on how to break down the MIDI message response from the Meris pedals, but for other pedals and devices, this would be something manufacturer's would need to provide in order for developers to make such parsers.

    Also, I could be wrong, but I think the documentation for the send() method probably needs to be updated if it supports Sysex; however, when I tried it out (I used a raw String), I got the following error:

    `Uncaught TypeError: Data bytes must be integers`

    Let me know if I'm doing something wrong, I passed in 128 and the Sysex command as a string for the arguments.

  • I think if we go the module route, a module should, at a minimum, decode and validate Sysex commands.

    This seems reasonable. We could also just leave it in the hands of the developers to decide how far they want to go...

    I have a data sheet from another developer on how to break down the MIDI message response from the Meris pedals, but for other pedals and devices, this would be something manufacturer's would need to provide in order for developers to make such parsers.

    Most manufacturers already provide information about their sysex implementation. Sometimes, you need to do a bit of digging but it usually exists.

    Let me know if I'm doing something wrong, I passed in 128 and the Sysex command as a string for the arguments.

    The send() method accepts an integer as the first parameter and an optional array of integers as the second parameter. If you pass it a string, it will complain. What I could do is add support for Uint8Array (for the second parameter).

    However, I am not sure why you would want to pass a string as the second parameter.

  • The Output.send() method in version 3.0.0-alpha.7 now fully supports Uint8Array. If you want to send raw sysex messages, you can simply use the Output.send() method.

  • Sweet, thanks! I'm planning on making a validator for the Meris Sysex messages within the next month or so, can scrape together a module for their pedals like we discussed.

Sign In or Register to comment.