zl filter a specific range of numbers

Justin Baird's icon

Hello everyone,

I am looking to find a method to filter only a certain number range, in other words, a subset of values from a list.

The issue is that trying to use zl filter for a number range for example from 0 to 100 in a list is not so easy if the list contains other very large numbers, e.g. 60,000, 45768 and sometimes these larger out of range values are not known ahead of time. My list is being generated externally from a hardware device so I can't always know all the values to filter.

Looking at all of the zl functions, I can see zl filter to remove specific values, but nothing to allow a range.

Perhaps this could be solved by regexp with an if $i1 < 100 but I can't find any documentation for using if statements within regexp.

Any help greatly appreciated, thank you!

JB

pdelges's icon

Maybe something like this :

Max Patch
Copy patch and select New From Clipboard in Max.

Justin Baird's icon

Awesome thank you yes that works perfectly! Very much appreciated

I had initially looked into [split] but then realised it wouldn't work with a list, but yes your use of iter with split works the magic ;)