Are there equivalents for these?

- min(x, y) or max(x, y)
- clip(value, min, max), wrap(), fold()
- floor(), ceil(), round()

hjh

]]>Are there equivalents for these?

- min(x, y) or max(x, y)
- clip(value, min, max), wrap(), fold()
- floor(), ceil(), round()

hjh

]]>[int] might be the equivalent of "round"?

David. ]]>

[int] seems to be floor() rather than round().

Maybe I'll make an abstraction for 'fold', then.

hjh

]]>You need to scale by power of 10 according to number of decimal points as in the attached

Interestingly it looks like floats get rounded in display to 4 dp anyway ?

]]>'fold' (not parameterized) turned out to be pretty straightforward too.

BTW is there a more idiomatic way to do reciprocals or negation than `[expr 1 / $f1]`

? I vaguely recall Max has alternate [-] and [/] operators where the left input becomes the second operand.

hjh

]]>]]>

A-ha... little by little, these idioms will sink into my skull.

(FWIW, I'm a 17-year user of SuperCollider -- so, WRT to Pd, I know a lot of synthesis and a lot of programming logic already. I can get around in data flows somewhat, but I'm not fluent yet. Catching up though. I found that students in my university struggle with the infamous SC learning curve a bit too much, so that's why I'm looking at Pd for some new courses [plus I need GEM for one of them]. Really appreciate the help here so that I can speak Pd more cleanly.)

hjh

]]>expr~ has functions for floor/ceil/round, check its help file

the else libraries has objects for those as well and also else/wrap2, else/wrap2~, else/fold & else/fold~

]]>