## Gen~ and order of execution...

Feb 03 2012 | 5:01 pm
Cycling Folks,
Is there any way of predicting order of execution in gen~ when patching? I'd like to reset +=, then add an offset amount to it. I imagine codebox is the way to go, but I'd like to know if there is a different way (and so I can understand what happens when an object has multiple inlets that may be changing on the same sample)
Thanks!

• Feb 03 2012 | 5:50 pm
Hi Peter. Everything in the gen domains is synchronous. If at a given sample, the second inlet of += has a non-zero value, the output for that sample will be the minimum count value (default 0). For all other cases, += will output the previous value + the left inlet increment.
Hopefully that answers your question. If not, please let us know.
• Feb 03 2012 | 5:54 pm
So for that sample the left inlet isn't looked at? (it makes perfect sense when you're wanting to reset to the minimum, but it makes it tricky when you want to, say, reset to the maximum (in the case of reverse counting).
This is probably better handled in codebox (which I'm looking at).
• Feb 03 2012 | 6:16 pm
Exactly. For that sample, the left-inlet isn't used. If you're counting backward, couldn't you just invert the output of += with a [!- max_value]?
• Feb 03 2012 | 6:23 pm
Yes, if I were doing it consistently, but I'm switching forwards and backwards at any given moment. (It's an analog step sequencer that you can drive automatically or with pulses; positive pulse = advance, negative = backwards)
• Feb 03 2012 | 6:27 pm
In that case, you can use the [?] operator to choose up or down depending on the pulse.
• Feb 03 2012 | 6:33 pm
I'm not sure how I could generate things like this:
+1 -1 +1
1,2,3,4,5,6,7,6,5,4,3,2,1,0,15,14,13,12,13,14,15,0,1,2
Actually, now that I look at it, this is not a job for +=, but one for + (and use wrap/clip in the loop) (I have oneshot/loop modes)
Thanks, Wes!
Don't suppose you have any suggestions on the assignment question I just posted...