|
Post by gurbz on Aug 20, 2019 13:57:45 GMT
Hi, somehow and after some MDP layout modification I get a lot same sysex messages. Is it possible to filter it to one message? So if message one is being send five times can streambyter filter out the other 4?
Cheers,
Gurbz
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 21, 2019 9:58:58 GMT
Hi gurbz , Assuming you are talking about those katana sysex messages, then here is one technique: IF M0 == F0 41 00 00 # roland sysex IF M7 == 12 60 00 # KATANA
# detect dupe message within last 100ms # If is a dupe, set L83 to 1 ASS L83 = 0 # assume not a dupe
# compare message with previous # previous data of katana message is in # L80-2 (address+value) IF MA == L80 L81 L82 # use a timer variable to limit # the compare window IF T0 < 64 ASS L83 = 1 END END
# always remember the last message (address+val) # into L80-2 ASS L80 = M0A M0B M0C
IF L83 == 0 # we have a new message, so you put your code # that processes the message inside this IF/END ... END
# dupe, message should be blocked IF L83 == 1 XX = XX +B END END ENDIn later versions of Stream Byter you can block and terminate the script, but for the version in MDP, it is safer to set that L84 flag and put in conditionals since a XX = XX +B (block) removes the event but the script will continue which could have unexpected results if you were examining the message further down that has been blocked. It would also be possible to write code that retained/compared any message whatsoever, but this might add a bit of overhead as each message needs to be compared and maintained with loops. Regards, Nic.
|
|
|
Post by gurbz on Aug 21, 2019 11:41:11 GMT
Thank you Nic!
That works after modifying “IF T0 < 64” into : “IF T0 > 64”? ( tried bigger values and smaller then 64 but then I get same results.
Cheers,
Gurbz
|
|
|
Post by gurbz on Aug 21, 2019 12:24:33 GMT
I’m not totally right but 64 is too small. I changed it to IF T0 < 1000 and that works OK! Thanks Nic!
|
|
|
Post by gurbz on Aug 21, 2019 12:34:08 GMT
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 22, 2019 8:17:50 GMT
Hi gurbz , I had assumed the dupe messages were being sent at the same time (or close together) so that is why I made the timeout small. You don't have to have a timeout at all of course, but you figured it all out for your own setup in any case. BTW - IF T0 < 1000 will be a 4 second timeout (since that's a hex number). I checked out the MD post - thanks! Regards, Nic.
|
|
|
Post by gurbz on Aug 22, 2019 8:46:27 GMT
It’s a bit strange yeah, 1000. I’ll mess around with it a bit more. If you own a mdp license you could check out what’s going on, whats cookin’ there.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 22, 2019 9:18:44 GMT
You might be OK removing that IF T0 clause entirely in your case?
|
|
|
Post by gurbz on Aug 22, 2019 12:47:07 GMT
Gonna try that: less is more!
|
|