Page 1 of 1

arraytostring not behaving as expected

Posted: 17 Jan 2013 11:34
by bint
My template (EvolverProgrammer.jzml - attached) receives a 226 Byte SysEx dump in function ReceiveState(MIDI_ARGS) then uses a function ArrayToHex(array) to convert 8 Bytes to hex, and then return them as a string using arraytostring. This string is then displayed on a monitor object.

Since I only do 8 Bytes at a time (this is the "packet" size for the DSI Evolver) I need to make multiple calls to ArrayToHex(array).

PROBLEM: the 15th call to ArrayToHex(array), and every call after that returns 0. The reason I think it's an issue with arraytostring() is that if I modify ArrayToHex(array) to do all the munging but then just return the decimal values, i.e. not call arraytostring(), everything works fine.

I've been working at for a while and am a bit stumped - anyone got any ideas? Am I doing something obviously stupid? I can work around it for now, but it concerns me that I don't understand why it's not working - it might come back to bite me!

Attached are the template file, and a sysex dump (SysExDump.jzml) I've been using to troubleshoot (you need to change the extension to .syx as there was an issue uploading a .syx file). You can use this free program to send the sysex to Lemur: http://www.snoize.com/SysExLibrarian/

thanks!

Re: arraytostring not behaving as expected

Posted: 19 Jan 2013 13:24
by bint
looks like there have been a few downloads of my attached files - was anybody able to recreate my problem?

cheers!

Re: arraytostring not behaving as expected

Posted: 22 Jan 2013 21:18
by Macciza
HI Bint

One way to approach such problems is to split it down and see what works . . .
I tweaked your Project a bit - in search of a solution
Basically it now writes the incoming sysex to 2 smaller arrays - SYX and SYX2
I also split the processing algorithm to match the new arrays and execute when they change
EvolverProgrammerFIXED.jzml
(29.49 KiB) Downloaded 80 times
I will refer the matter on to investigate the reason behind the initial issue
MM

Re: arraytostring not behaving as expected

Posted: 28 Jan 2013 19:11
by bint
Thanks Macciza, I'm on holidays right now but will try this out as soon as possible.