|
Post by edsaxman on Nov 4, 2019 20:30:12 GMT
Trying to use a simple IF/ELSE rule, but Stream Byter (MIDI Designer Pro) seems to refuse the "ELSE" keyword, marking it as #ERROR, no matter what.
But still nothing. A bug, maybe?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 4, 2019 21:06:32 GMT
Hi edsaxman, The version of Stream Byter in Midi Designer is a little behind. The ELSE rule was added in a later version. Regards, Nic.
|
|
|
Post by edsaxman on Nov 5, 2019 20:41:50 GMT
D'oh! That's a pity. Any plans to update that?
How to replicate this behaviour without ELSE?:
IF () IF () .... ELSE ... END END By the way, there is any way to invert the value of a boolean?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 6, 2019 9:21:18 GMT
Hi edsaxman , > D'oh! That's a pity. Any plans to update that?You'd need to ask Dan about that. > How to replicate this behaviour without ELSE?:You need to simulate the ELSE with two IFs with each condition reversed. Be aware that if the first IF changes the data used in the test for the second IF, then you might see both IFs being true (ie. not a true else) eg: # message is a note IF M0 == 90 END # messages is not a note IF M0 != 90 END> By the way, there is any way to invert the value of a boolean?I tend to use xor operator '^' to do that (and use convention false = 0 and true = 7F) # toggle boolean (0 and 7F) MAT I1 = I1 ^ 7FRegards, Nic.
|
|
|
Post by edsaxman on Nov 8, 2019 9:17:29 GMT
Thank you Nic! Got it!
Another question.... There is any way to send messages "on init"? I mean, once, just when the layout is loaded (think in sending some text to a LCD screen to show a welcome message or whatever.
I have tried using SND inside IF LOAD, but it dont seems to be working (not sending anything when the layout is loaded)
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 8, 2019 9:47:05 GMT
Hi edsaxman , That's the right technique (SND inside IF/LOAD), but I'm not 100% sure how this works in MDP. If you're doing this in the 'Input' StreamByter you might try adding a delay to the send: IF LOAD SND B0 12 34 +D500 ENDI think MDP will add StreamByter events to its log. That might give you some indication too. Regards, Nic.
|
|