[select] : nan, inf, -inf

Samu's icon

hiii

I can get [select] to filter out NaNs and inf values if I pass them in through the inlet as a selector argument, but this obviously has to be done dynamically. If I type in "nan" or "inf" as a selector when instantiating the object, obviously it's looking for that string, and actual nan and inf values aren't matched. Is there any keyword to get [select] to look for these things, or should I just loadbang some division by zero??

Julien Bayle's icon

do you have a patch ?

Max Gardener's icon

Not sure what you're interested in doing precisely, but gen~ has a nice fixnan operator that obligingly returns a zero when fed NaNs [when you're working at single-sample rates and you don't want your patch to just blow up when a NaN shows up, it's a godsend] which I've found useful. One of those stupid gen~-based abstractions I use in MSP all the time....

pdelges's icon

There is a [spat.isnan~] (note the ~) in the, now free, ircam's spat5 package.

Or you could use something like [jstrigger (isNan (a[0]))] or [jstrigger (isFinite (a[0]))]

p