Sysex noob needs basic help

Hi there.
Just starting to look at sysex, I know it starts with f0, finishes with f7, there’s an identifying section for the gear and a variable often and that’s the sum total of my sysex knowledge. I’ve been looking at the output from a V synth xt and capturing it in the E1.
This is the file in question, I captured the controls 0-1 and 1-2 and these do exactly what I expected, altering the parameter. Looking at these I made the control called ‘doesn’t’ expecting it to give me the result 2-3 but it didn’t work as expected. So I captured the control 2-3 and on comparing 2-3 with ‘doesn’t’ they look like identical sysex strings. It’s COSM 1 filter cutoff if that makes any difference.

I expected to see a constant sysex string with a single variable that I could map to a knob but I see two values changing, the 13th hex appears to be the variable in question, mapping directly to the cutoff values but hex 14 is also changing but decreasing.

Any pointers would be great.

My knowledge goes a tiny bit further than yours :blush:
Check about checksums and nibbles, there might be other things about sysex, best to read up on it, especially wrt to the synth your using

So, I’ve been doing some research…

I’ve got the cutoff to go to 15 then it goes back to 0. It seems that the counting system is divided across two numbers (bytes?) in the sysex string, places 13 and 14, just before the checksum. Place 14 keeps rolling around from 0-15 in hex and every time it completes the cycle place 13 advances by 1. I have attached two files so you can see value 15 rolling over to value 16. My problem is that I don’t know how to do this in the E1 editor so if anyone can enlighten me, I’ll have an editor done for this synth in a month or so.

Thanks
value 16.syx (16 Bytes)
value 15.syx (16 Bytes)

Try this and see. Looking inside the web UI editor, it appears to do what you want.

sysex bytes

(it’s private, so you can copy it to your presets and edit as needed)

Martin gave you the step by step below. I think the Roland checksum option works. If not, the calculation is : sum the bytes, modulo the answer by 128, then subtract: 128 - modulo result = checksum

EDIT - the Roland option does not work. You will need to select “LUA variable” in the checksum area.

Here is an example of how to calculate it. I took your original sysex strings and made them arrays so
I could test it without having the E1 available. You can use any on-line LUA compiler to try it out. I happen to use this LUA compiler but there are others. I didn’t try to make it as compact as possible just so you can see the steps.

Martin or other people will be able to show how it is actually use this in the preset, but here is the math anyway:

val15 = {0xF0, 0x41, 0x10, 0x00, 0x53, 0x12, 0x10, 0x00, 0x50, 0x12, 0x08, 0x00, 0x00, 0x0F, 0x77, 0xF7}
val16 = {0xF0, 0x41, 0x10, 0x00, 0x53, 0x12, 0x10, 0x00, 0x50, 0x12, 0x08, 0x00, 0x01, 0x00, 0x05, 0xF7}

function chksum(sysex)
    
    local byteSum = 0
    
    for i=7,14 do
        byteSum = byteSum + sysex[i]
    end
    byteSum = byteSum % 128
    byteSum = 128 - byteSum
    return byteSum
end

print(string.format("15 check sum = %0x", chksum(val15)))
print(string.format("16 check sum = %0x", chksum(val16)))

Hi, what you are observing is splitting the parameter value in to two bytes in the SysEx message. These two bytes are often referred as nibbles. The lower nibble, the one that changes frequently, represents a fine adjustment of the cutoff value (least significant bits of the parameter value). In your case it is the place 14. The place 13 is represent the coarse nibble of the cutoff value (most significant bits of the parameter value).

What you need to do is to instruct E1 to split the cutoff value into the nibbles. I will use a shorter SysEx string to demonstrate how it can be done. Say you need to send the following SysEx message:

f0 10 20 30 value-to-be-nibbelized 40 f7

the value-to-be-nibbelized is actually represented by two bytes in the message, so it is:

f0 10 20 30 nibble-coarse nibble-fine 40 f7

the bytes f0 and f7 are the SysEx start and SysEx end bytes. Electra will insert these to the message automatically. You do not have to include that.

ok, let’s start:

  1. create a cutoff control and set message type to SysEx:

  1. click on Edit SysEx Data button in the sidebar with Control’s properties:

Use the form to enter the Constant bytes and the Parameter values as indicated below:

  1. Adjust the Parameter value entries to split the cutoff value into two nibbles:

Extracting the coarse nibble: Set the width and parameter position to mark the upper three bits of the parameter value. That is the part of the number that increases by one whenever the fine part rolls over. This instructs E1 to place this extracted data to given position in the SysEx message.

Extracting the fine nibble: Set the width and parameter position to mark the lower 4 bits of the parameter value. And again, E1 will place the extracted data to given position in the SysEx message.

This is outlines the main idea. Of couse, as SysEx strings are merely sequences of bytes (numbers), often expressed as hexadecimal notation, it is very handy to learn a bit about binary and hexadecimal number systems.

When you have the above steps completed, send the preset to the controller. When done, hit the Lua & Tools icon in the centre of the top menu:

In Lua & Tools pen the Midi Console tab and change the value of the control by turning the knob. You will see how the outgoing SysEx bytes are changing:

You mentioned that the last byte of your SysEx message must be a checksum. It also represents some challenge. We can take a look at that later, when you get your nibbles working :slight_smile:

The preset I used for the demo can be found here: SysEx nibbles. If you want to make edits, make a copy to your account.

3 Likes

Thanks Martin, I’m going to be busy it seems!

Cheers OGG. (it seems you’re on every forum I’m on, l always find your posts worth reading).

1 Like

What can I say? We have good taste in gear. :slight_smile:

thanks - I edited my post to show how to calculate the checksum for your data.

1 Like

Thanks for that, I’ll save that for later, sysex first then LUA I think. I did get it working without the LUA section once I checked out your original post.

Martin,

sometimes it also happens that also a CC or NRPN message is constructed out of multiple parameters (Moog does, it, Roland, Novation…). So we can’t send out the CC message direclty from the control. Instead we now create virtual parameters and add a same function to all those controls. In that function I read the various bits via parameterMap from the composing parameters , construct the CC-value and send it.

For SysEx message however, the solution for ‘value’ you show above is much easier to read and maintain., and it doesn’t require lua.

Isn’t it an idea to foresee a similar value solution for NRPN of CC messages ?