rslider math

Dec 16, 2010 at 1:59pm

rslider math

Hi
I’m using [rslider] to set some pitch ranges, and I assumed that simply subtracting the slider’s min from the max would give me the range value. Not so; it seems that scrolling the slider, and discrete clicking produce different behaviours: the patch below explains:

– Pasted Max Patch, click to expand. –

Could someone tweak this, so that the number box updates the range/difference whether [rslider] is clicked or scrolled?

Brendan

#53977
Dec 16, 2010 at 2:17pm
– Pasted Max Patch, click to expand. –
#194229
Dec 16, 2010 at 2:49pm

are you wanting mid of slider to be correct pitch. if so i just made one using a select object box. the object box should read select 0 1 2 3 4 (and so on till you get to) 157, then on the 58 out put a message box with a 1 in it then on 59 place a box with 1.01 and so on then link all these to the sfplay~ speed int. theirs probably a quicker way to do it but it works.

#194230
Dec 16, 2010 at 2:50pm

78 not 58 sorry
oh and 79 not 59

#194231
Dec 16, 2010 at 3:01pm

Thanks everyone

@pid
strange that [!-] works, and [-] doesn’t..although, i reversed the inputs to [pak] and changed [!-] to [-], and it appears ok; the math object prefers the two element list apparently.
nice one

Brendan

#194232
Dec 16, 2010 at 10:12pm

n00b_meister, I think maybe you’re overlooking that the max value comes out of rslider before the min value (because it’s farther to the right). So, in your initial example, you’re always triggering the calculation with the max value, but using the min value from the previous time. The patch posted by pid sorta fixes that, because pak will be triggered by both the max value and the min value, but that causes it to put out one wrong answer followed by one right answer, so it’s not a clean solution. I think swap is probably the most suitable object for your purposes:

– Pasted Max Patch, click to expand. –
#194233
Dec 16, 2010 at 10:23pm

Hi Christopher
schoolboy error on my part (hangs head in shame)!!

While I was more-or-less considering the R-L ordering, I thought it would be ‘fixed’ (compensated?) by the hot/cold inlets of the [-] object.

Anyhoo, your solution is, as ever, perfect.
Thanks
Brendan

#194234
Dec 16, 2010 at 11:53pm

There’s an attribute that makes rslider output a list, that makes it even easier.
_
johan

– Pasted Max Patch, click to expand. –
#194235

You must be logged in to reply to this topic.