Home › Forums › General › Programming › Axe-FX II sysex checksums
- This topic has 14 replies, 2 voices, and was last updated 7 years, 2 months ago by sumitagarwal.
-
AuthorPosts
-
February 12, 2017 at 9:39 pm #71313
Hi guys, I am trying to program a panel to control the Axe-FX II and I’m having trouble with the checksum byte.
The documentation for the Axe-FX II checksum is here: https://wiki.fractalaudio.com/axefx2/index.php?title=MIDI_SysEx#MIDI_SysEx:_calculating_the_SysEx_checksum
I don’t know how to represent that type of checksum in Ctrlr.
The sample command I’m using is this one:
F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 4D F7 (this turns off the Bright switch on Amp block 1)In that sample, you can see the checksum byte is 4D.
I have tried both Roland and Waldorf checksum types, and it looks to me that I should be counting 14 bytes, but neither checksum type gives me a result of 4D.
Here is the formula I’m trying to use:
F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 t14 F7February 12, 2017 at 11:38 pm #71314Weird sysex implementation.
I just messed with the example provided on the docs, and this is not a Roland or Waldorf checksum. It uses XOR operations (don’t know what they are and how they work). But with a XOR calculator online, I get to the expected result:
F0 00 01 74 03 0F F7
You need to do 0xF0 ^ 0x00 ^ 0x01 ^ 0x74 ^ 0x03 ^ 0x0F = 0x89
I get to this result by:
F0 ^ 00 = F0
F0 ^ 01 = F1
F1 ^ 74 = 85
85 ^ 03 = 86
86 ^ 0F = 89Now you remove the leftmost bit of the result and add 7f, so the end message is F0 00 01 74 03 0F 09 F7, a byte longer.
The doc example doesn’t have checksum, it is added later. Does your example command have checksum (4D) or do you have to calculate from the sysex string and add it later?
Doing the above operations with your formula, I get as result:
F0 ^ 00 ^ 01 ^ 74 ^ 06 ^ 02 ^ 6A ^ 00 ^ 27 ^ 00 ^ 00 ^ 00 ^ 00 ^ 01 = CD
(removing leftmost bit C would give 0D as checksum) not taken into account byte 4D,F0 ^ 00 ^ 01 ^ 74 ^ 06 ^ 02 ^ 6A ^ 00 ^ 27 ^ 00 ^ 00 ^ 00 ^ 00 ^ 01 ^ 4D = 80
(removing leftmost bit 8 would give 00 as checksum) taken into account byte 4D.So you could try both formulas (little hope they work):
F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 0D F7
F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 4D 00 F7February 12, 2017 at 11:44 pm #71317Thanks dasfaker! I’ll try your formulas but yes doesn’t seem like it will match.
In the example I provided with the 4D checksum, I had grabbed that example command by monitoring the output of the Axe Edit desktop application, which I believe calculates the checksum for each command and appends it before sending.
February 12, 2017 at 11:49 pm #71318Then something is wrong with my calculations, as I get 0D instead of 4D. Could you post a shorter example?
February 13, 2017 at 12:36 am #71320Hrm, maybe try this? I don’t know what this message means, but its much shorter:
F0 00 01 74 06 2A 29 F7I think that’s a response message back *from* the Axe-FX II, but per the documentation the response messages also use a checksum which I would assume are calculated the same way.
February 13, 2017 at 2:31 pm #71338Ok, there was a error with the method used, but I still don’t get the exact checksum.
Let’s go with you first message: F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 4D F7
Once you XOR all the bytes (F0^00^01^74^06^02^6A^00^27^00^00^00^00^01) the result is CD
Now the error: you must add CD to 7F (CD + 7F = 14C) and remove the leftmost bit: 14C –> 4C
The checksum we get is 4C, but it should be 4D
With the last message you provided, I get the same result:
F0 00 01 74 06 2A 29 F7
F0^00^01^74^06^2A = A9 — A9 + 7F = 128 —> checksum = 28 and it should be 29.We are really close.
February 13, 2017 at 3:22 pm #71339Thanks a ton for your effort in helping crack this! Unfortunately it seems like quite a bit about the Axe-FX is somewhat unusual or nonstandard. A shame since its a fantastic piece of equipment that is used by many of the most famous guitarists in the world.
Anyway, I’m thinking maybe the below will be useful reference since it shows how the checksum ends up with only one byte changed?
Turn Amp 1 bright switch on
F0 00 01 74 06 02 6A 00 27 00 01 00 00 01 4C F7
Turn Amp 1 bright switch off
F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 4D F7February 13, 2017 at 3:40 pm #71340Yes, it doesn’t seem to be an easy implementation.
The bad news is that (not that bad in fact), as far as I know, there’s no automatic checksum calculation of this kind in Ctrlr’s sysex formulas, it should be all done with LUA.Knowing that our calc give us just 1 figure less, just adding 1 to the result could be ok.
I still don’t know how to calc XOR operations in LUA.
February 14, 2017 at 2:39 am #71347Ok, there was a error with the method used, but I still don’t get the exact checksum.
Let’s go with you first message: F0 00 01 74 06 02 6A 00 27 00 00 00 00 01 4D F7
Once you XOR all the bytes (F0^00^01^74^06^02^6A^00^27^00^00^00^00^01) the result is CD
Now the error: you must add CD to 7F (CD + 7F = 14C) and remove the leftmost bit: 14C –> 4C
The checksum we get is 4C, but it should be 4D
With the last message you provided, I get the same result:
F0 00 01 74 06 2A 29 F7
F0^00^01^74^06^2A = A9 — A9 + 7F = 128 —> checksum = 28 and it should be 29.We are really close.
Hrm, I tried using the calculator here:
http://www.miniwebtool.com/bitwise-calculator/?data_type=16&number1=a9&number2=7f&operator=ANDYour XOR to get a result of A9 seems correct. Its the last step where something isn’t right in your calculation.
I used the tool to AND A9 to 7F and got the expected 29
February 14, 2017 at 10:33 am #71351February 14, 2017 at 3:19 pm #71356This is how it looks to me
Attachments:
You must be logged in to view attached files.February 14, 2017 at 3:20 pm #71358Oh, I see what happened in your link. That link was for ADD not AND
February 14, 2017 at 3:34 pm #71359LOL, i thought it was the same!!
February 24, 2017 at 1:43 am #71441So… I guess in order to implement my own checksum calculations and attach that to a modulator, I should be using “Called to calculate the MIDI value to send”?
Can anyone point out a sample panel that does that? So far for reference I’ve been poking through the Prophet 6 panel and not seeing anything like that.
February 24, 2017 at 6:26 am #71442Well, this was my first time writing Lua (I’m not a programmer by any stretch of the imagination). This is what I came up with for the Axe-FX II checksum, and… it works!!
y = bit.bxor(0xF0, 0x00, 0x01, 0x74, 0x06, 0x02, 0x6A, 0x00, 0x27, 0x00, numericModulatorValue, 0x00, 0x00, 0x01)
n = bit.band(y,0x7F)
m = CtrlrMidiMessage({0xF0, 0x00, 0x01, 0x74, 0x06, 0x02, 0x6A, 0x00, 0x27, 0x00, numericModulatorValue, 0x00, 0x00, 0x01, n, 0xF7}) -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.