I’m a complete newbie to sysex, but I’m trying to figure out how to get some code formatted. I have a PBC 6/x as my main pedalboard controller, and a Strymon Timeline mounted underneath the board. To help me keep track of things, when the PBC sends the Timeline a MIDI PC change, I want to simultaneously send my new MC6 Pro (arrived last night) a sysex message that will change the Bank Name (Or maybe preset long name? Whichever will show up on the center text box on one of the screens.) to the name of the current Timeline preset.
For the most part I’ve been able to make sense of everything, as the manual is pretty clear. The issue is the checksum - I don’t understand half the terminology thrown out, and I haven’t been able to find clear explanations elsewhere, as everything seems to expect me to have a solid grasp of programming (which I don’t have). If someone could walk me through one of these, I’d be incredibly grateful.
For the purpose of this, here is a string of sysex code I’ve come up with that should result in the MC6 Pro displaying "WASH 1 " as the bank name:
(Note: I’m aware I will probably need to increase the number of spaces in the name. I saw a thread here that mentioned that Morningstar controllers need to see something entered for every single character in a name, but I haven’t had the chance to do a “get current bank name” command to figure out what that number of characters is.
Yeah, I saw that while I was doing my research. The Fractal wiki was helpful in understanding the concept as a whole, but as it says, every manufacturer handles checksum differently. I need to know how Morningstar specifically handles it, since it is the target of the message, and it’s documentation isn’t clear to a sysex newbie like myself.
Sorry, my initial post wasn’t clear. I’ve been referencing that page from the beginning, but as someone with zero previous experience with sysex, and little experience with coding in general, it just doesn’t make sense. What does it mean to XOR a value with the next? What is the n referenced in “n-2”? How do I “AND the value with 0x7F”? And what is the C++ code supposed to be telling me?
a XOR b = 1 if and only if exactly one of a or b is 1 (for 1 bit)
For a byte, you just xor the bits and construct the result bytes
You just xor all the bytes together, up to the second to the last, then AND it with 0x7F
AND is another bitwise operator, it is 1 only if both inputs are 1
0x7F is a hex number, equivalent to 127. That last AND basically clears the high order (8th) bit in the byte.
for each successive byte of the message you’d calculate “new checksum = checksum xor next byte”
the “for” loop in the documentation shows you how to do that in c
the “cSum ^= *(ptr +i)” line is what does the xor calculation
the loop ends at “len -2” because you’re not going to include the F7 at the end or the checksum in the calculation
The MC6 Pro is looking for 32 “text” characters in that sysex string, which would start with your “W”. That should be 0x57 by the way, not 0x87. Same with the rest of your letters. Pad the extra characters with spaces, which are 0x20.
In general when you’re writing out sysex messages like that you should show all your bytes in hex. All of the Morningstar bytes in your string above are in hexadecimal. In the programming world it’s common practice to indicate hexadecimal digits using “0x” in front of them. Without the 0x people would assume they’re in conventional base 10. Except in cases where it is assumed that everything is in hex unless noted otherwise. Midi sysex generally falls in that category where you should assume everything is hex unless states otherwise.
In the case of your string above, the “F0” and “F7” bookends are pretty clear indicators the whole thing should be in hex. The ascii values you showed are in decimal, not hex.
This is a very cumbersome calculation to do manually, by the way. I think I understand what you’re trying to do, but going through that checksum process manually for every different message you want to display is going to be a very cumbersome process. I’d suggest finding some way to do it with a program. Python might be the most accessible, but it’s a trivial exercise in just about any programming language.
Thank you, this is very helpful, though I think I’m going to go a different route for now. My general preset layout never changes, so I can just make each bank represent one Timeline preset. Not as elegant, and I’ll probably circle back around to this method later, but for now it gets the job done.
Is doing the Checksum always required? For example, I would like to use Lemur to send sysex to MC6 Pro to update the preset name. I feel like I understand how it needs to be done except the checksum aspect.