|
Post by mo13 on Oct 26, 2022 7:59:31 GMT
I'm looking for a way to reset a cycle to 0, in this example an extra msg B0 04 7F is being sent back to it's own instance to reload the saved SB preset, so in other terms, is there a way to reinitiate a cycle within these rules upon host stop?
If load ass K0 = 00 03 ass L0 = K0 set LB0 SCC_Cycle set LB1 S-- End
if M0 == B0 00 7F calc I0 = B0 + M1 send I0 L0 7F set LB1 L0 +D calc L0 = L0 + 1 if L0 > K1 ass L0 = K0 End End
If M0 == F0 7D Snd B0 04 7F End Block
|
|
|
Post by redheronmusic on Oct 27, 2022 22:11:39 GMT
Re: “ in this example an extra msg B0 04 7F is being sent back to it's own instance to reload the saved SB preset”
You are sending a B0 04 F7, but your if statement is matching on B0 00 7F.
The “inject” flag is a way to send a message directly back to the input of SB code. With this, you can use a synthetic message, then block it when you finish processing.
In the second if block, you are testing for M0 == B0 00 7F, but you are then running a calculation on M1. With this “if”, M1 will always be 00, so no need for a calculation.
There is also a +D without a value in that loop, seems that install should error on that.
Re: “is there a way to reinitiate a cycle within these rules upon host stop?”
If host stop is a unique command, then you would watch for that. If there is not a command to watch, then maybe the host sends a periodic command while running. You could watch that, then time out to reset if that signal goes away. May ways to approach, but may need more specific info.
|
|
|
Post by mo13 on Nov 2, 2022 6:53:28 GMT
If host stop is a unique command, then you would watch for that. If there is not a command to watch, then maybe the host sends a periodic command while running. You could watch that, then time out to reset if that signal goes away. May ways to approach, but may need more specific info. Thanks for all the clarifications redheronmusic , The +D is there for the label to be shown in decimals. SB is always receiving start and stop commands by host which are F0 7D 01 7A F7 and F0 7D 01 7C F7, I don't have too much experience with the inject flag yet, but also, is it needed in this case? If I understand correctly, the cycle can be then reset by the hosts stop command?
|
|
|
Post by redheronmusic on Nov 4, 2022 20:50:46 GMT
Sorry, I have rarely used the display, so I missed the two unique things with interacting with the display and widget feedback.
I am also not understanding what you mean by resetting the cycle on host stop. But you said that you get a F0 7D 01 7C F7 on host stop. If that is the case, why not just watch for that, then execute the desired reset commands?
If M0 == F0 7D 01 7C # Only can match up to four bytes, but this is enough in this case. # do reset cycle stuff here End
I only mentioned the Inject since you said that you were sending a B0 04 7F back to its own instance, which sounded like an inject.
|
|
|
Post by mo13 on Nov 4, 2022 21:30:20 GMT
I could've explained it better as well, I was literarily sending B0 04 7F out of SB's script routed back to midi control in the host (AUM) which was mapped te reload the preset (reinitiate if load) aka resetting the cycle upon receiving F0 7D 01 7C. Yes I was trying to make that point as well, unfortunately I'm not equipped enough on what rules I should put there to reset the cycle to B0 00 7F. So when the host restarts then the cycle will start on B0 00 7F again and not where it left off. Hence this post to see if there is a way to tell those rules to reset upon F0 7D 01 7C. Would gladly hear any solutions to this!
|
|