Forums > MaxMSP

List cull?

October 25, 2013 | 5:26 pm

So – I’ve been tearing my hair out a little on this one…

Say I have two integers which are dynamic, a maximum and minimum. Let’s say 9 and 12.

I also have a list of values, running from index 0 – 64, which are also dynamic.

Basically, I want to extract the indexes 9, 10, 11 and 12 from the list. I know this must have a simple solution but the list objects are running me around in circles…

Thanks for your time!

- Rich


October 25, 2013 | 7:37 pm

Many ways to do that. Here’s one.
<code>

– Pasted Max Patch, click to expand. –

</code>


October 26, 2013 | 2:27 am

Woop! Thanks I think ‘iter’ was the missing piece of the puzzle!

- Rich


October 26, 2013 | 8:41 am

Or here’s another.
<code>

– Pasted Max Patch, click to expand. –

</code>


October 26, 2013 | 8:57 am

I misread your original question, thinking you were looking to extract the values 9 through 12 rather than indices 9 through 12. To get specific indices, you probably want to use [zl lookup].
<code>

– Pasted Max Patch, click to expand. –

</code>


October 28, 2013 | 2:48 pm

Cheers Christopher!

- Rich


October 31, 2013 | 10:26 am

I do have another question actually if you have any time – and that’s do you know of an object that will create a range running between a max and min, or does this have to be constructed using a series of objects…Say – if I were to input 4 and 9, it would output a series of integers 4, 5, 6, 7, 8, 9?

Cheers,

- Rich


October 31, 2013 | 10:13 pm

No such object that I know of. Ya just roll yer own.
<code>

– Pasted Max Patch, click to expand. –

</code>


November 5, 2013 | 12:44 pm

Well nicely ‘rolled’ then – works like a charm dude thanks…

- Rich


Viewing 9 posts - 1 through 9 (of 9 total)