Programming a "pickup" function (automatic midi mapping for my midicontroller)

stoersignal's icon

Hi guys,
i try to build an auto mapping patch for my controller (bitstream3x). its not a big deal, but i dont know how to program something like the integrated pickup mode in Live. When i try the same inside of max its no problem, like you can see in the attached file. anyway, when i try the same to control, lets say the volume fader from live it doesnt work. it must be, because of the latency o. i thought a pipe object would solve the problem, but it dont. i attached a mini version of my patch, maybe somebody can help me out.
sorry for my bad english, i hope its understandable.

1274.pickupproblem.amxd
amxd
xanadu's icon

This is an interesting problem. I had to make a much more complex device to get it working, but this one at least does the job. I hope someone comes up with a simpler solution.

I changed the live.remote to a live.observer. Now I can change the dial on live with my mouse and see if it is picked up correctly. The gate is replced by a gswitch just for visual feedback.

Comparing floating point numbers with == is error prone. Comparing with >= and

When the dial within Live is changed with the mouse the gate must close again, waiting for the next pickup. This is where the counter comes in. Each time when the midi controller changes the counter is reset to zero. It will be incremented to one by the live.observer, but this will not reach a count of 2. Only when the dial in Live is changed there is no reset and the counter reaches 2 and higher figures. This causes the gate to close.

1280.pickupproblem.2.amxd
amxd
stoersignal's icon

hi xanadu,
thanks for your work, but for any reason your patch is not working for me.
i don`t find the bug, everything seems to work (gate is opening and closing at the right time) but the live.object doesnt send the value. i tried to change the live.object to a live.remote~ again, but no luck. any ideas?

xanadu's icon

Hi Stoersignal,

It is a mistake I made in the send and reveive pair for path1. I renamed the senedr to ---path1. This means it won't send to other devices, but I did not change the receiver. It is fixed in the pickupproblem.3amxd download.

Sorry for this.

1285.pickupproblem.3.amxd
amxd
stoersignal's icon

You are my king! Thanks a lot

12root2's icon

I know this is an old thread but I've got a more global solution for this which can make life easier. Connect the knob's right outlet (raw data) or other UI object with 0. to 1. range to the left outlet, and send the parameter Id to the right inlet (to get its min-max values for scaling). The abstraction outputs a scaled value only when the parameter and the knob values are matching (i.e pickup takeover mode).

RP_pickUp.maxpat
Max Patch
Roman Random's icon

Thank you for that! Very useful. Here is a slight variation adapted for general use:

control-pickup.maxpat
Max Patch