CreepyPants
2019-05-30 20:27:36
Okay, I have an output routine that needs to cycle through 16 for one set of outputs, and 4 for another. Both of these output timers are triggered by the same event - part of a refresh routine. As in: - Button is presssed on a Controller - MTPro hears this, and data in Global Variables is updated in MTPro per Rules (non-Timer Event) - Timer: Output routine uses the Globals and calcs output to a Sequencer and also back to the controller and sends the appropriate Note On & CC values.
Add'l info: One set of events cycles through 16 bits of a mask and creates one of two CC values depending on the bit's mask status 0/1. The other set of events cycles through 4 bits of a different mask (well, actually two masks separately) and creates Note Velocity values to feedback to the controller.
Can I call one Timer event with different repetitions?
Alternatively, I could do something like: - Call the Timer for 16 repeats - Do the 16 repeat event - Test to see if the counter is divisible evenly by 4 - if it is, then do the 4 repeat event - If not, skip to the end
Questions: - If i use a Jump (GOTO) and put the label at the end of the Rules, I'm assuming the it effectively jumps over the rules in question, gets to the end, does the output, repeats as expected. Yes? - If I use a test such as if the modulo of the counter != 0, then Exit Rules, Execute Outgoing Action *while* in a Timer, does that stop the timer iterations or does the timer continue as normal, just skipping anything at the end of my Rules, but still repeating if there are iterations still to do? - Is there a better way to do this thing? One Timer needs to go 16 times, another goes 4 times, and the simpler it is the better in case I need to troubleshoot later and also because this is a very small part of a much larger project.
I guess, the Timer Control, specifically number of repetitions, is not inherent in the Timer Translator, but in the Translator that called the Timer?
I think my problem is that I'm approaching Timers as a For/Next or a Do/While and that is nerfing my wrapping my head around them.