How to use SXFORMAT with a 75 byte list?

Vojislav Dimitrijevic's icon

Hi all,
I am fairly new to M4L and my main interest is in creating own control surfaces for controlling and managing my external MIDI gear. So far it's going very good and I have a good grip on basics of communication, however, I've hit a snag that I've been trying to get around, but I just don't have enough knowledge with M4L to figure out how to bypass it.

Problem is this; I am using SXFORMAT to format bytes and send them as SysEx. All works as intended if bytes are typed in manually or if I have up to 9 bytes (because it supports 9 inlets). I am also able to get first 9 bytes out of a formed list into the SXFORMAT if I open up 9 inlets, but my SysEx has 75 bytes.

How can I format the list so that SXFORMAT understands that my left input is a list of 75 elements that should parse out into individual elements and output as bytes? Is that even possible?

Any and all help is greatly appreciated, I'm fairly stumped at this point...

Bill 2's icon

You don't actually need the sxformat object. Just make the correct list of numbers using any method you like, without dealing with what sxformat can or can't do, and send it out midiout (Credit to Source Audio for recently telling me this.) Would that work for you?

Vojislav Dimitrijevic's icon

Hello Bill and thanks for a quick reply :)

I tried to do this method this morning, but first I had to make a process to calculate the Cheksum (that's why I was hoping SXFORMAT could do the trick, since I was lazy, but now that's in place and working fine).

Once I was getting the right checksum, I tried using the assembled message, including start stop and everything, but hardware won't budge. Not receiving the message at all. I tried sending the list as a list result and as a result of a "message" object directly into the midiout. I captured the message on output and all checks out, but hardware isn't receiving it.

Also a quick double check, when assembling the list and sending it directly to midiout I am using hex not dec, since that's what the device is expecting and since I noticed that SXFormat is doing exactly that. Is that the correct method or does midiout do the conversion and maybe that's where my mistake lies?

Bill 2's icon

Umm, yeah... I'm a bit out of my depth here, but I always thought dec or hex was just for the user and it all gets sent in hex anyway. In my recent dealings with sxformat https://cycling74.com/forums/checksum-within-sxformat-message-for-roland-integra-7 I just used decimal integers. Posting your patch can be helpful, btw. :-)

Vojislav Dimitrijevic's icon

I'll try plugging dec list into midi out and see what happens when I get back home :) Thanks anyway, as for the patch it's complex atm, but if it's still bothering me by the end of the evening and refusing to budge, then I'll make a simple example patch, so that it's more clear.

Vojislav Dimitrijevic's icon

Thanks to Bill for the workaround which is so much more efficient to use. Trick is to simply use numbers, so send messages in dec only, M4L takes care of to-hex conversion. As soon as I switched the message to Dec, devices shook hands, exchanged sums and said "we're friends now!" :) So, yay!

Bill 2's icon

And they all lived happily ever after! :-)

But I'd be a fraud to accept your thanks when it was Source Audio who told me only 11 days ago.

Vojislav Dimitrijevic's icon

Then many thanks to both you and to Source Audio! (lucky timing for me) :)