Gen~ and order of execution…

Feb 3, 2012 at 5:01pm

Gen~ and order of execution…

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)


– Pasted Max Patch, click to expand. –
Feb 3, 2012 at 5:50pm

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 3, 2012 at 5:54pm

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 3, 2012 at 6:16pm

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 3, 2012 at 6:23pm

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 3, 2012 at 6:27pm

In that case, you can use the [?] operator to choose up or down depending on the pulse.

Feb 3, 2012 at 6:33pm

I’m not sure how I could generate things like this:

+1 -1 +1


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…


You must be logged in to reply to this topic.