I'm not very proficient in js scripting or the structure of Open Stage Control, so thank you if you are able to help.
I'm using Open Stage Control with MIDI2vJoy to trigger game device buttons. I have basic buttons triggering correctly using the button widgets.
I'd also like to have a pair of game device buttons pulse on / off as I rotate an encoder widget - one game device button pulse on/off as the encoder widget rotates clockwise per increment, and another game device button do the same when the encoder widget rotates counter-clockwise. I'm guessing it would require a midi data value, note value and a high velocity value to be sent, followed briefly after by the same message but with a zero velocity value, per increment, per direction.
Would it be possible to modify the existing encoder widget to behave in this way using the script pane?
I think I may be part way to a solution. Could you let me know if I'm on the right track?
I've bypassed the OSC output.
In the widget's scripting "OnValue" I can use something like this for each direction;
send('midi:mymidiport', '/note', 2, 0, 127)
create a short delay
send('midi:mymidiport', '/note', 2, 0, 0)"
I think all I now need is a way to read the direction of the encoder so I can pop the above code into an "if / then".
Can anyone suggest a relatively simple way to read the current OSC output value of the encoder? Depending on it's rotation direction, would I be expecting to see the output as a +1 / -1 or 0 / 127?
Because I would occasionally get a stuck on game button, I've tried adding a note off message for the two buttons when the encoder is released, though the issue might be within MIDI2vJoy itself.
Just an update - It appears to be the MIDI2vJoy python installable version that is slow (Github Master version). I've uninstalled that and I'm now using a version called MIDI2vJoy2 (v2.2.0) which is an executable. It's far more responsive. Your .conf file will need small modifications if you wish to use it instead.
Is there an easy way, just for cosmetic reasons, to enter a "release" value in the field and have the encoder handle remain where it is at release? (and not snap back to 12 o clock on release even though the encoder setting is "circular")