Roland Sysex Checksum calculator

Started by philjynx, August 13, 2017, 01:09:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

philjynx

...

Beanow

This caught my attention since it's implemented differently from what I have in Go code. For the 5 byte example it works as expected. For a large sample (245 input bytes) I get different results.

Indeed 40 11 00 41 63 => 0B

Another one that I grabbed from a real-world command, enables BTS mode.
7F 00 00 01 01 => 7F

The other two examples I placed in here are sections of an entire patch being reported back by the Katana.
Sorry for butchering the markup!

Golang checksum function for reference. https://github.com/katana-dev/lib-katana/blob/develop/sysex/message.go#L58
And in Python https://github.com/snhirsch/katana-midi-bridge/blob/master/katana.py#L78

Main difference is the MOD is applied after every addition.

Beanow

#2
They mentioned a step in that tutorial you've skipped.

2. Add the values together, but if the answer to any sum exceeds 127 then subtract 128.

Edit: I see they mentioned your version as a second approach.
Perhaps this is where it comes from? Both code examples use the first approach.

vtgearhead

Quote from: Beanow on August 13, 2017, 12:41:29 PM
2. Add the values together, but if the answer to any sum exceeds 127 then subtract 128.

Yes, MOD 128 (aka 7-bit overflow) is always how I've understood it.

alexmcginness

WOW. I remember the days back when the SC-55 sound canvas came out and we had to use a calculator to work this out and that was after I reversed engineered it from some code that Peter Ganon put into the atari version of Band In a Box. He later showed me how he figured it out. Havent used them for a dogs age. Nice to see a calculator that will work this out for ya.
VG-88V2, GR-50, GR-55, 4 X VG-99s,2 X FC-300,  2 X GP-10 AXON AX 100 MKII, FISHMAN TRIPLE PLAY,MIDX-10, MIDX-20, AVID 11 RACK, BEHRINGER FCB 1010, LIVID GUITAR WING, ROLAND US-20, 3 X GUYATONE TO-2. MARSHALL BLUESBREAKER, SERBIAN ELIMINATOR AMP. GR-33.

gumtown

Here attached is an old windows 16bit checksum calculator program.
It will only run under windows Xp or earlier.
It is zipped for posting, so it needs to be de-compressed first.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

gumtown

Removed original file and linked 1st post to new one.  ;)
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

gumtown

#7
Might want to check those links,
make sure I didn't delete revision 3 and link all to revision 2.

EDIT: sorted  ;D
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

Beanow

Quote from:  philjynx on August 13, 2017, 07:51:36 PM
I've just re-read this! No wonder you get different results, the sheet as it stands has 5 labelled single byte fields to enter. Put petrol in a diesel car and you'll get undesirable results too.

Of course, that's why this was a great way to see if the math checks out  ;)
Looks like you password protected this one so I haven't had a look what you did differently. What changed?

Beanow

Quote from:  philjynx on August 14, 2017, 03:41:08 AM
You know the password  ;)

iamgod1234?
admin?
Don't know really.

Quote from:  philjynx on August 14, 2017, 03:41:08 AM
The change is only that it now has slots for 250 bytes, they get summed, then mod128 of their sum is subtracted from 128 like the 5 byte version.

So in other words, I just messed up expanding it?  :-X

gumtown

It is easy to unprotect a password protected*.xlsx worksheet,
the checksum magic is in the hidden column.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

Beanow

Quote from:  philjynx on August 14, 2017, 05:19:04 AM
When I downloaded your version, excell moaned that it had to repair it, what it then displayed had no formulae in it.

Of course Microsoft would be sure to treat libre office documents as broken. What was I expecting?

alancarl

Quote from: philjynx on August 13, 2017, 01:09:30 AM
Saw one or two people asking for a spreadsheet calculator for this, so I wrote one.
You can find it here https://www.vguitarforums.com/smf/index.php?action=downloads;sa=view;down=96

Hi Phil,
     I was one of the people asking for the spreadsheet to calculate the Roland Checksum.
Initially it seemed that this was not possible but never say never:-)

I just happened to come upon your post here from a Google search. A great discovery INDEED!
Thanks ;)
Since you were so kind to create this useful tool can I ask if you might include a hex to decimal converter?

Also it took me a minute to realize that the Checksum result in your spreadsheet is in decimal...a bit confusing as the Byte values are to be entered in Hex.

Thanks Phil!
Al

alancarl

Quote from:  philjynx on February 23, 2018, 08:26:55 AM
Nope, the result is in HEX don't forget any result less than 10 (decimal) will appear the same in HEX or Decimal. I just downloaded the version here to check that the result is in HEX.
Behind the scenes it works with decimal integers, but the user input and result output is HEX. Once you go beyond 10 the difference is only obvious if the result happens to be one where letters are used.
26, for instance in decimal is, well, er 26! Whereas 26 (HEX) is 38 (Decimal).



Hi Phil
     here is an example of a Roland(Boss) Katana amp SYSEX string with a valid checksum calculation.
F0 41 00 00 00 00 33 12  60 00 01 75 14 16 F7
When I put the Parameter HEX Bytes into your spreadsheet I get a number (22) that when I convert it from decimal to HEX it matches the checksum (16) that the Roland device calculates.
What am I missing?
Thanks Phil,
AL
p.s. I find the need for any HEX to Decimal and Decimal to HEX conversions

alancarl

Hey Phil,
     I am using a Mac and the Excel file is handled by Pages so it occurred to me that this may be a factor?
I am positive of the decimal output in my scenario.
Actually that's one resin I asked for a DEC-HEX AND vise versa conversion.
In any case your spreadsheet is a BIG help for sure.

I now have multiples Ipads to edit different parameter blocks of my Katana Amp!

admin

#15
Quote from:  philjynx on February 23, 2018, 10:55:28 AM
Regarding your apparently erroneous results - I don't have a Mac or any clue what 'Pages' is, so I have no clue.

and if you are on Apple - you should be using "Numbers" for Excel *.xls files ( not "Pages", the apple MS Word equivalent)

https://www.apple.com/numbers/


I suggest get free Libre Office instead of Apple offerings

https://www.libreoffice.org/

https://www.pcmag.com/article2/0,2817,2418419,00.asp

alancarl

Quote from: admsustainiac on February 23, 2018, 11:08:57 AM
and if you are on Apple - you should be using "Numbers" for Excel *.xls files ( not "Pages", the apple MS Word equivalent)

https://www.apple.com/numbers/


I suggest get free Libre Office instead of Apple offerings

https://www.libreoffice.org/

https://www.pcmag.com/article2/0,2817,2418419,00.asp

I am actually using Numbers...doesnt it come with Pages...i will check out  Libre Office as well.
Thanks
Al

admin

#17
Quote from: alancarl on February 23, 2018, 11:30:21 AM
I am actually using Numbers...doesnt it come with Pages..

Pages and Numbers  are completely separate apps  - but often "choke" on many types of  MS Excel *.xls, *.xlxs files

https://discussions.apple.com/thread/6032864





admin


alancarl

Couple things in this:

Thanks I am aware of the online HEX CONVERTERS :)

What i meant was i thought i copped Numbers bundled w Pages. :)

What i have observed is as i re-downloaded the posted Excel file from here half a dozen times one of the iterations actually did work as expected on my Mac.
On my MBP all of the spreadsheets had the exact same DEC2HEX formula at the bottom  to bring the checksum result back to HEX format but only one actually did the math.

Now since i rarely use spreadsheets and thus Numbers i was unaware of the cross platform flakiness..but why should i be surprized.
In any case i really appreciate Phil sharing his expertise with spreadsheet calculations as i find it very helpful to cross check myself when using SYSEX.
Thanks everyone!
Al

gumtown

Here is a nice midi checksum calculator program I found.
https://www.bwalk.com.au/Convert/Convert.html



Much of the current Roland/Boss gear, the Start Byte should be "7"
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/