CRC Check for Sysex Messages

#1

Hi,

I’m trying to send SysEx messages to my Yamaha THR10 amplifier. I’ve got things partially working, but I’m trying to improve on it.

So far, I can send simple messages for individual parameter changes since they don’t utilize a checksum byte. I would however, like to be able to send block update messages to completely change the amplifier state with one message. This uses a much longer message with a checksum byte at the end. I used jazzundso’s code snippets in this post to figure out how to use the SM_ commands.

So, a couple of questions:

1.) What is the purpose of the “#” in the SysexMessage assignment statement? Is it a type identifier? Or a data formatting operator?

2.) My experiments indicate that SysexMessage doesn’t look like an extended array or string base type. SM_ChangeValue lets you change a value at an index within a SysexMessage. How does one retrieve values at specific indicies within a SysexMessage?

3.) I’ve looked through the language introduction pdf, and it mentions that all of the “usual” boolean operators are available, but doesn’t go into syntax for any of them. Since I am trying to execute a checksum algorithm (I think it might be SY77/SY99), I will need to be able to perform bitwise comparisons (at least XOR and AND, I believe) on byte summations. Does GPScript have the ability to do any of this?

4.) Am I making this too hard on myself? Is there functionality built into or planned for the SysexMessage and/or SysexManager types?

I know GPScript isn’t meant to be a fully featured language, but if it’s going to fully support SysEx, then I’m hoping there’s a way to make simple checksum algorithms work?

0 Likes

#2

The Sysex functionality is very simple (so far). We really just added the ability to send a constant sysex message to initialize some external device and simple support for real-time sysex messages

I’ll add an SM_GetValue so you can see the value at a particular index

0 Likes

#3

Sure. I get the concept: baby steps.

Thank you. The SM_GetValue will definitely help.

On another note, is there currently a way to assign hex literals to integers? I’m getting around it now by converting the hex values I want to store into decimal equivalents, but it would make my code a little easier to troubleshoot if I could compare variable contents on a direct hex-to-hex basis.

0 Likes

#4

Nevermind. Just saw the release post for 3.1.7. Thanks for adding the hex literals!

0 Likes