SXFORMAT Help

Oct 28, 2007 at 6:19pm

SXFORMAT Help

hi all, i’m having trouble using variables with the sxformat plugin. my midi piece requires a checksum, and i can’t figure out a way to come up with a acceptable changeable argument for the variable checksum…i keep getting a checksum error in the midi gear. can anyone help??

sxformat 240 65 9 0 28 18 0 1 12 0 / is $i1 / / is $i2 / / ??? / 247

i have no problem running an object like:

sxformat 240 65 0 0 28 18 0 2 0 3 15 108 247

it’s the changeable argument for the checksum that gets me in trouble. thanks!

#34355
Oct 28, 2007 at 7:00pm

Are you sending this to an external synthesizer? What is it?

On 10/28/07 2:19 PM, “havenhamilton” wrote:

>
> hi all, i’m having trouble using variables with the sxformat plugin. my midi
> piece requires a checksum, and i can’t figure out a way to come up with a
> acceptable changeable argument for the variable checksum…i keep getting a
> checksum error in the midi gear. can anyone help??
>
> sxformat 240 65 9 0 28 18 0 1 12 0 / is $i1 / / is $i2 / / ??? / 247
>
> i have no problem running an object like:
>
> sxformat 240 65 0 0 28 18 0 2 0 3 15 108 247
>
> it’s the changeable argument for the checksum that gets me in trouble. thanks!

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#115759
Oct 28, 2007 at 7:21pm

it’s a Roland DR770 drum machine. i have no problem sending sysex messages with fixed variables, but when i try sending changeable arguments, i cannot come up with a checksum “equation” that the dr770 will accept!

#115760
Oct 28, 2007 at 7:35pm

the manual says “the checksum consists of a value whose lower 7 bits are 0 when the address, size, and checksum itself are added.”

so i figured if i use “sxformat 240 65 0 0 28 18 0 2 0 3 15 108 247″, 0+2+0+3+15 = 20

then 128-20 = 108 = checksum.

so, if i change the object each time, re-entering the data and checksum, i can change things in the DR770, but i want to be able to use changeable arguments so i don’t have to do that. i was hoping to be able to get a third inlet with “$i3″ to calculate checksums outside of the sxformat object, but seems like two inlets are the maximum.

#115761
Oct 28, 2007 at 9:29pm

Usually it is the sum of all data bytes mod 128 (7 bits). Have you tried
sending the message without a checksum? Just skipping it and ending with
247.

On 10/28/07 3:21 PM, “havenhamilton” wrote:

>
> it’s to a DR770 drum machine. i have no problem sending sysex messages with
> fixed variables, but when i try sending changeable arguments, i cannot come up
> with a checksum “equation” that the dr770 will accept!

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#115762
Oct 28, 2007 at 9:31pm

Two inlets are not the maximum. Perhaps you can run all of the data bytes
through an accum object for $i3.

On 10/28/07 3:35 PM, “havenhamilton” wrote:

>
> the manual says “the checksum consists of a value whose lower 7 bits are 0
> when the address, size, and checksum itself are added.”
>
> so i figured if i use “sxformat 240 65 0 0 28 18 0 2 0 3 15 108 247″,
> 0+2+0+3+15 = 20
>
> then 128-20 = 108 = checksum.
>
> so, if i change the object each time, re-entering the data and checksum, i can
> change things in the DR770, but i want to be able to use changeable arguments
> so i don’t have to do that. i was hoping to be able to get a third inlet with
> “$i3″ to calculate checksums outside of the sxformat object, but seems like
> two inlets are the maximum.

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#115763
Oct 28, 2007 at 11:49pm

oh, i see. i didn’t leave spaces in between the slashes. let me mess with that a bit.

i also made some headway in the meantime:

sxformat 240 / 65 / 0 / 0 / 28 / 18 / 0 / 2 / 0 / 10 / is $i1 / / is $i2 / / is checksum ( 6, 11,1) / 247

so now i’m getting the object to add the data correctly before the F7. but, roland requires that i subtract the checksum from 128…so if the checksum is 12, the roland actually needs to see 116.

any tips on as to how to do this? within the object if possible…

#115764
Oct 29, 2007 at 12:11am

i suppose this could work for now:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 260 98 27 196617 +;
#P newex 281 122 39 196617 !- 116;
#P number 468 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 473 303 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 467 325 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 169 33 15 0;
#P newex 130 212 48 196617 thresh 5;
#P number 308 308 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 412 312 35 9 0 0 4 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 350 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 358 309 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 418 340 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 324 147 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 224 66 35 9 0 15 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 169 66 35 9 0 15 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 250 298 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 241 324 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 208 293 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 177 310 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 135 302 35 9 0 0 16 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P newex 169 171 217 196617 sxformat 240 / 65 / 0 / 0 / 28 / 18 / 0 / 2 / 0 / 10 / is $i1 / / is $i2 / / is $i3 / 247;
#B color 5;
#P number 296 327 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 186 236 183 196617 unpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#P connect 9 0 2 1;
#P connect 9 0 22 1;
#P connect 8 0 2 0;
#P connect 8 0 22 0;
#P connect 17 0 8 0;
#P connect 17 0 9 0;
#P connect 2 0 16 0;
#P connect 0 12 19 0;
#P connect 0 13 20 0;
#P connect 0 11 18 0;
#P connect 0 9 11 0;
#P connect 0 10 14 0;
#P connect 21 0 10 0;
#P connect 10 0 2 2;
#P connect 0 8 12 0;
#P connect 0 7 13 0;
#P connect 22 0 21 0;
#P connect 0 6 15 0;
#P connect 0 5 1 0;
#P connect 0 4 7 0;
#P connect 0 3 6 0;
#P connect 0 2 5 0;
#P connect 16 0 0 0;
#P connect 0 1 4 0;
#P connect 0 0 3 0;
#P window clipboard copycount 23;

#115765
Oct 29, 2007 at 12:33am

Yes, you have exactly the right idea. The extra slashes are not needed. I
don’t know which bits of data need to be included in the checksum or whether
is is a simple sum mod 128 or a sum mod 128 subtracted from 128. But
whichever, you need the sum and the math for $i3. You must do this outside
the sxformat object. Something like this…

#P window setfont “Sans Serif” 9.;
#P number 338 325 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 337 289 39 196617 !- 128;
#P number 304 354 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 305 256 40 196617 % 128;
#P message 351 95 26 196617 113;
#P button 289 29 15 0;
#P number 305 217 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 289 53 53 196617 t b b b 0;
#P message 320 96 20 196617 97;
#P message 272 97 20 196617 17;
#P message 230 98 17 196617 1;
#P newex 305 187 27 196617 +;
#P comment 383 96 100 196617 your data points;
#P connect 9 0 10 0;
#P connect 9 0 11 0;
#P connect 11 0 12 0;
#P connect 6 0 9 0;
#P fasten 6 0 1 1 310 242 363 242 363 181 327 181;
#P connect 5 2 4 0;
#P connect 5 2 8 0;
#P connect 8 0 1 0;
#P connect 7 0 5 0;
#P connect 1 0 6 0;
#P connect 5 3 1 1;
#P connect 5 1 3 0;
#P connect 5 0 2 0;
#P connect 4 0 1 0;
#P connect 3 0 1 0;
#P connect 2 0 1 0;
#P window clipboard copycount 13;

On 10/28/07 7:49 PM, “havenhamilton” wrote:

>
> oh, i see. i didn’t leave spaces in between the slashes. let me mess with that
> a bit.
>
> i also been made some headway in the meantime:
>
> sxformat 240 / 65 / 0 / 0 / 28 / 18 / 0 / 2 / 0 / 10 / is $i1 / / is $i2 / /
> is checksum ( 6, 11,1) / 247
>
> so now i’m getting the object to add the data correctly before the F7. but,
> roland requires that i subtract the checksum from 128…so if the checksum is
> 12, the roland actually needs to see 116.
>
> any tips on as to how to do this? within the object if possible…

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#115766
Oct 29, 2007 at 5:47am

Check out Lsum from the Lobjects (more info at maxobjects.com). Use it to
get the sum of all list members except for the check sum byte, then do a
!- 127 to get the check sum, and append the resulting number using append
or zl join.

Best,
Trond

> Two inlets are not the maximum. Perhaps you can run all of the data bytes
> through an accum object for $i3.
>
>
> On 10/28/07 3:35 PM, “havenhamilton” wrote:
>
>>
>> the manual says “the checksum consists of a value whose lower 7 bits are
>> 0
>> when the address, size, and checksum itself are added.”
>>
>> so i figured if i use “sxformat 240 65 0 0 28 18 0 2 0 3 15 108 247″,
>> 0+2+0+3+15 = 20
>>
>> then 128-20 = 108 = checksum.
>>
>> so, if i change the object each time, re-entering the data and checksum,
>> i can
>> change things in the DR770, but i want to be able to use changeable
>> arguments
>> so i don’t have to do that. i was hoping to be able to get a third inlet
>> with
>> “$i3″ to calculate checksums outside of the sxformat object, but seems
>> like
>> two inlets are the maximum.
>
>
> Cheers
> Gary Lee Nelson
> Oberlin College
> http://www.timara.oberlin.edu/GaryLeeNelson
>
>
>

#115767

You must be logged in to reply to this topic.