How to compress or expand a list from multislider?

May 23, 2012 at 2:48pm

How to compress or expand a list from multislider?

Hi,

I’ve been trying to work out how i can shrink or expand a list produced my multislider – i.e. so if i stretch it it duplicates the right number of items to fit the new length, or if shrunk, it removes the right number.

I’m trying to have a morphable spectral filter so i can define a middle point in multislider (controlling index in a PFFT), and then modulate that centre point up or down so one side of the list shrinks and one expands.

I’ve sort of got it to work, but it never works smoothly.

Is there an easy way to do this that i’m missing?

here’s my rough try (scuse the mess)

– Pasted Max Patch, click to expand. –

- it doesn’t really work, but it should give you an idea of what i’m trying (I thought divide the original length by the desired length to get a factor – then use modulo to repeat a slider when needed)

/edit – i should say, the crappy example above only has 16 sliders, but i want to work in one with 256 (a tweak of the max4live pluggo spectral filter)

#61703
May 23, 2012 at 4:47pm

What i ‘d do is store the list in a 1 row, 256 columns matrix. Then resize by sending it to an other matrix with the wanted dimensions with interpolate set to on (or not, depending on what you need). That will do the dirty math work for you.

#222777
May 23, 2012 at 5:06pm

cheers for the reply. Do you mean matrix~/matrix object or something else? (cos i couldn’t find an interpolate attribute in them)

#222778
May 23, 2012 at 5:26pm

Hello,

i think dtr speak about [jit.matrix] ;

have a look here too : http://cycling74.com/forums/topic.php?id=33213

HTH

#222779
May 23, 2012 at 5:33pm

aaaah thanks – i’ll try it now…

#222780
May 23, 2012 at 5:52pm

don’t know if this relates, but [filtergraph~] is interesting for grabbing points and moving around like an EQ with “magnetic” sliders that follow a grabbed point. You can query the values of the line and send the list into [multislider], this makes a similar EQ-ish set of controls where ones to the sides of the center point fall off from it. So you can use it purely for its unique UI features rather than setting [biquad~] values.

#222781
May 23, 2012 at 6:25pm

yes indeed, jit.matrix

#222782

You must be logged in to reply to this topic.