Forums > Max For Live

measuring numbers to control volume sliders with thumb joysticks

March 4, 2014 | 12:54 pm

hi
im quite new to all this, but i’m learning slowly so if anyone can help me with my current problem it’d be much appreciated

i am trying to use the thumb joysticks on a generic gamepad to control various elements within ableton live.

so far i have managed to get a volume slider to go up when you push the joystick up and down when you move it down but when you let the joystick go it returns to its central position and the volume slider goes back to the corresponding midpoint too.

the top position gives a value of 1, the resting position gives a value of 0.5039, and the bottom position is 0
what i want it to do is to increase when i push the stick up and stay there until i pull it down past its resting position (giving a value of less than 0.5039). and vice versa – if i pull the value down i want it to stay there until i push the joystick up past the resting position so the value is greater than 0.5039

i been trying all sorts of combinations but i’m finding using the relevant objects required to perform the operation really confusing so if anyone can help i’d be very grateful

many thanks for any help


March 4, 2014 | 3:48 pm

You’ll have to detach the joystick value from the volume value. I would suggest setting up an increment/decrement scheme.

I don’t have a patch or anything, and I’m not sure how it would work for a joystick, i’ve done this for an endless encoder. But you’d set it up so that when the joystick value is less than .5039 you subtract from the volume value. When the joystick value is greater than .5039 then you would add to the volume value. When it is at resting position, you do nothing.

Hope this helps, and I’d be open to hearing ideas from other people as well. There may be better ways


March 5, 2014 | 2:34 am

hi there

thanks for your reply – any advice on setting up such an increment/decrement scheme? i was looking at something like the counter object but am a bit unsure about how to incorporate that with adding or subtracting

thanks again


March 5, 2014 | 12:48 pm

I set up two different inc/dec schemes here, not that elegant, but hopefully it gives you an idea.

<code>

– Pasted Max Patch, click to expand. –

</code>


March 5, 2014 | 1:07 pm

Here’s another version. Bit more involved but only changes when numbers are moving away from .5039

<code>

– Pasted Max Patch, click to expand. –

</code>


March 6, 2014 | 1:18 am

hi fellers

many thanks for these ideas – i’ll check them out later when i get home and see if i can hook them into my patch correctly

i’ll report back later

thanks again


March 6, 2014 | 12:17 pm

hi there

thanks for your help – im getting to grips with it but im struggling again. i have put your examples in subpatchers and have attempted to link them into the signal path in various ways to try and see which works best. but so far i have had no luck getting any response from the volume slider in live.
hopefully the part of the bigger patch which is relevant i have pasted properly below so that you can see what i mean. i am sure it is just something simple that i am missing but at the moment i cannot get any values to go from the two subpatchers i have made using your examples out to the part of the patch which controls the volume slider of the current track

any further advice and help will be much appreciated

<code>

– Pasted Max Patch, click to expand. –

</code>


March 6, 2014 | 1:31 pm

The release joystick was just there to simulate the release it’s not needed when attached to the stick. Try this version.

<code>

– Pasted Max Patch, click to expand. –

</code>


March 6, 2014 | 2:07 pm

hi – thanks everso much for your quick reply

i pasted this version into my patch and i can see that numbers are changing in the message boxes under the two t f b objects, the left message box gives readings from .5039 up to 1 and the right gives reading from 0 up to .5039, corresponding to when i move the joystick up and down. but the number in the output number box at the bottom doesnt really change much and the volume slider in live only moves very very slightly, if at all.

i’m putting number objects on outlets to test signal flow and checking object help files but my knowledge is still struggling.

thanks again


March 6, 2014 | 11:20 pm

Try increasing the step size and see if that helps.

<code>

– Pasted Max Patch, click to expand. –

</code>


March 8, 2014 | 10:09 am

hi again – i’ve spent the last two days trying to sort out this joystick movement problem – but haven’t had much luck, hence i’m asking here again. i’ve been analysing the patch, putting bang objects and number boxes here and there to check the signal flow but under the accum object the signal always seems to be 1 – which at the moment just sends the volume slider right up to the top, where it stays. i’ve been looking down the patch and i am reasonably clear on what happens at each stage and i feel that the answer is close but i’m not quite there yet. increasing the step size doesnt seem to do anything

many thanks again for any further help

<pre>

– Pasted Max Patch, click to expand. –

</code></pre>


March 8, 2014 | 11:50 am

<code>

– Pasted Max Patch, click to expand. –

</code>


March 8, 2014 | 1:25 pm

hi – thanks for your continued patience

i loaded the above patch – maybe im doing something wrong but im not sure – the slider you mention in the patch does nothing when i change the values in the number box which you have highlighted. at one point it jumped from the bottom straight to the top but then i couldnt reproduce it. i can see the numbers changing in the message boxes in the patcher joystick1 but nothing seems to come out of the bottom of the patcher

when i bypass the patcher joystick1 and go straight from the outlet of the scale to the inlet of the trigger b f object then the volume slider in live works ok – just not how i want it to, as it goes back to the middle when i let go of the joystick (as the thumbstick goes back to the central resting position).

the top position gives a value of 1, the resting position gives a value of 0.5039, and the bottom position is 0
i want it to increase when i push the stick up and stay there until i pull it down past its resting position (giving a value of less than 0.5039). and vice versa – if i pull the value down i want it to stay there until i push the joystick up past the resting position so the value is greater than 0.5039

hope this makes sense :)

thanks again


March 8, 2014 | 4:42 pm

The patcher works here on my system, I have no idea why it would not work the same way on yours. Someone else will have to assist you. Good luck!


March 11, 2014 | 4:43 am

ok thanks for your help though – i think i’m slowly getting there, by asking around on other places and trying stuff out for myself. and a bit of trial and error too

cheers


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