Assert error when running disassemble phython script

I’m trying to use the re- and python scripts which are provided within the tool directory of the sourcecode.
Unfortunately I always get an AssertionError pointing me to line 92 of the script which looks like:
assert packet[head] == chr(0x40 + (index / 128))
If I comment out this line I get an error with the next line.

I checked the input file and could not find any occurence of a value of “40h”. Does that mean there is something wrong with my dump or do I miss anything else?

Could you please send me your dump?

It happens with nearly every dump, also with the factory set and banks from the forum patch thread.
Sometimes the error shows up in a different line of the python script. Will send you a small package of dumps.

O.K., the attached zip file contains two dumps from the patch thread as well as the factory data dump. All are causing errors.

Line 84 should be:

assert packet[head:head + 3] ‘\\x00\\x21\\x02’ or \
packet[head:head + 3] ‘\\x00\\x20\\x77’

Because I have changed the manufacturer id from something ‘stolen’ to something officially registered to the MIDI Manufacturers association.

test.syx is not a memory backup but a collection of patch dumps. The disassemble tool is only for parsing backups. These are not the same thing.

So what you want to say was that the error was in front of the computer, right? :wink:
I used a fresh dump from my shruthi and executed the script again. Now the script complained about a missing F7 at the end of the file (line 78) but the .syx file contains a F7 at the end, strange.

Are you on windows?

Ah, yes.

Ok, got it ! Try changing the file(…) lines by file(…, ‘rb’)

Ahh, great. It was just one line but now it works perfect.
The reassemble script works fine w/o the need of any changes.

Thanks a lot for your help.

Sorry, but there still is an issue with the REassemble script. I mentioned that it’s not producing errors but today I recognized the output file which will be generated by the script is only about 56kb instead of 177 or 178kb in size.
As an input file I used exactly the same file as the DIassemble script has generated from my .syx input file.
At the moment I don’t have an idea where to start to investigate.

Send me the input file. it’s probably skipping the last patches.

O.K., txt file attached.

When I checked the file I recognized a few of my own patches in the middle of the file which contained some hex data near end of the patch string which is populated with “000000” in all the other patches.
As I said before: the text file has been generated out of the dump from my shruthi.

What about sending the original syx dump first?

Ah yes, makes sense.

Yo need to use the --syx flag to generate a .syx file rather than a big bin blob.

But now I’ve spotted another problem… This tool still references the old unofficial sysex id (\\x00\\x20\\x77) Please replace by \\x00\\x21\\x02.

Sorry for bothering you. Wasn’t aware of the flag :wink:
I changed the Sysex string as well.

Thanks a lot for your help.