what does '?' Ternary operator

Nov 26, 2012 at 11:56am

what does '?' Ternary operator

hi folks!

I don’t have gen but i try to convert a patch of Gen in Reaktor, but what does this ‘?’ object ? (used with history) can’t find help in max msp and google.

thank in advance !

Nov 26, 2012 at 12:34pm

I mean in my patch, the [?] first inlet in connected by the impulse osc (in fact the famous delta < 0 of a phasor) the second inlet is connected by a variable signal and the third by a feedback history, that's a kind of Sample and Hold no ?

– Pasted Max Patch, click to expand. –
Nov 26, 2012 at 12:59pm

It functions indeed as a sample and hold.

– Pasted Max Patch, click to expand. –
Nov 26, 2012 at 6:41pm

The [?] operator is shorthand for [switch]. It’s the C ternary operator. It tests for a condition (the first inlet). If the condition is true, it passes the second inlet’s value. Otherwise, it passes the 3rd inlet’s value.

Nov 26, 2012 at 9:01pm

And after a while I realized that my example was a little awkward. This gives a better idea:

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.