Simple question, just can’t figure out how to do it. I need to filter a list to exclude certain numbers. For example I only want numbers from 6000 to 7200 to pass through the filter. All other numbers will be excluded.
Hi
U can use band-filter (in Basic tools/list-processing)
Best
K
Perfect! Got it to work.
And if I need to use a function to operate the filter?
For example I have a list of numbers (n, n1, n2, n3…) and I need all numbers between n1 and n3+1500 to pass through, is there any way of doing it?
Is n3 the last in the list or the greatest value in the list?
If last then you could use the last-elem, add 1500 and feed that into the band filter with the original list. If greatest value then find that value with list-max, add 1500 and feed that into the band filter.
Hello gph, thanks very much for your answer
So, in fact, the amount of values in the list is variable. The list corresponds to possible divisions of the interval of an octave. It can admit more or less numbers depending on the behavior of a previous function…
And also, I find very difficult to feed with a function the “bounds” input of the band filter, once it apparently only works if you send to it a list with two lists, as it is shown in the documentation page: [default = ((0 2) (5 10))]
Dear Lucas,
Please can you be more specific about your kind of list you want to filter, say giving a MWE (minimum working example). This will help us guide you in a working answer.
Best
K
Hi karim
So I have a list of values obtained by the division of an octave. These values are variable, once the division is set by a function. Sometimes this list has 5 elements, sometimes it has 11, etc.
And I would like the filter to exclude the notes that are not between a specific range, that may be variable too. For example, I need all values between the second number of the scale (n1) and a fifth above (n1+7000). The highest value of the filter is always related to the lowest.
Yes i “think” i get what you want, but please can you provide a concrete example of one of these lists, and the required exact type of filtering, so i can give you a correct solution.
Best
K
Ok
here “maybe?” is what you are looking for. After if you need to to generate other filters you will need to embed the loop in another one…
and the patch:
Patch 2.omp (12.7 KB)
Best
K
Karim, this works perfectly
And sorry, I should have provided a more concrete example, but then thanks even more for the extra work of deducing the goal I was trying to achieve