Need help with detecting if HW encoder is being "touched"

Post Reply New Topic
RELATED
PRODUCTS

Post

I have hit a bit of a wall in my java/api understanding and am throwing myself upon the mercy of the forum to help me out. I have googled, I have read the API docs, I have tried to interpret other scripts (Moss ofc) to no avail.

I am updating my controller script for the Atom SQ. It has a nice display, and I want to display the name and value of whatever an encoder is currently mapped to momentarily on the display when it being rotated/the value is being changed. Display text and changing the text based on the current mode is no problem. Such things are setup on button press. I need this bit to be momentary, so I want it to check if the knob is currently being moved, then update the display appropriately.

My idea so far is to check in Flush if the encoder is being activated, and if so, write the name/value to the display. My problem is that I cannot figure out the "If" part of this equation. I have the following parameters "marked" in Init:

Code: Select all

mEncoders[0].targetName().markInterested();
mEncoders[0].targetValue().markInterested();
mEncoders[0].isUpdatingTargetValue().markInterested();
mEncoders[0].modulatedTargetDisplayedValue().markInterested();
mEncoders[0].targetDisplayedValue().markInterested();
mEncoders[0].isBeingTouched().markInterested();
in Flush I print f.e. the "isUpdatingTargetValue" and "isBeingTouched" but both return false, although the name and value change appropriately (f.e. if I switch to a new instrument or rotate the encoder).

So at this point I have 2 questions:

1. Is there a better way to go about this? Just want to check. :)
2. How can I capture the "is being currently rotated" value/boolean properly (the encoders are setup as RelativeHardwareControls)?

I would be grateful for any and all suggestions. :)

Post

great question!

There might be a different approach here... i'm suprised isUpdatingTargetValue() doesn't work like you expect. Not sure what one would use that for reading the API...

For the touched action you could assign a midi event to the beginTouch and endTouch... then the isBeingTouched() value would adjust based on that. Same thing happens for RemoteControls... One must somehow bind an event to when a control is being touched.

hardware_knob.beginTouchAction() <- there you would assign an action matcher for your callback. and do the same for endTouchAction().

I hope that explains the isBeingTouched() stuff.


I don't have the Atom SQ programming guide. is there a midi event for when you touch the encoder? That is what you really want for this to play smoothly.

... Another approach... try adding an observer to hardware_knob.targetDisplayedValue().addValueObserver(...) and have that go directly to your display. BUT if those things are automating... your display won't really show the right value.

...ok so thats kind of lame :D... lets try another approach.

Create a HardwareBindable object. and then bind that to your hardware knob in addition to the parameter/remote control binding. When the knob turns you'll get a callback and you'll know what knob was touched and you can update the display based on that info.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Thank you! i will look into those options as soon as I have time. :)

Post Reply

Return to “Controller Scripting”