what does '?' Ternary operator

djlbe's icon

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 !

djlbe's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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 ?

jvkr's icon
Max Patch
Copy patch and select New From Clipboard in Max.

It functions indeed as a sample and hold.

Wesley Smith's icon

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.

jvkr's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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