vMix Forums
»
General
»
3rd Party Software and Development
»
Script for action on button hold of X seconds
Rank: Advanced Member
Groups: Registered
Joined: 5/6/2016(UTC) Posts: 83 Was thanked: 5 time(s) in 5 post(s)
|
Looking to implement the following:
* Midi controller button is held for 4 seconds, so Dynamicvalue1 is set to foo * Upon release of button, Dynamicvalue1 is set to bar
It's easy enough to determine when the midi button is in a pressed state (velocity = 127 for instance), but how would I determine how long it's been in that state to then do the next action (set dyanmicvalue)? And of course if it's released before 4 seconds, it resets to default state.
Any examples exist? I've searched but didn't seem to find any.
Thanks!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: roverradio Looking to implement the following:
* Midi controller button is held for 4 seconds, so Dynamicvalue1 is set to foo * Upon release of button, Dynamicvalue1 is set to bar
It's easy enough to determine when the midi button is in a pressed state (velocity = 127 for instance), but how would I determine how long it's been in that state to then do the next action (set dyanmicvalue)? And of course if it's released before 4 seconds, it resets to default state.
Any examples exist? I've searched but didn't seem to find any.
Thanks! Does it have to be like this and not say press again within 4 seconds or not ?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/6/2016(UTC) Posts: 83 Was thanked: 5 time(s) in 5 post(s)
|
Doesn't have to be that way per se, just figured it would be the most user-friendly. It's for setting PTZ preset to an NDI camera on a TYST 4M/E, which has Cam ID 1-8 and Preset 1-8 buttons below the PTZ joystick. see herePresently here's what I did to set PTZ preset: * Press and hold CAM ID * Press preset # you want to set That fires a script that makes an http post to birddog camera API to write the current position to the cameras's associated preset #. Works well, EXCEPT you need to release the Preset button before you release the Cam ID button. Holding the CAM ID button (velocity = 127) sets the camera to be set and a dynamicvalue to "save" as opposed to the normal "recall" which just recalls the PTZ position. If you release cam ID and Preset at the same time, it reverts back to recall and doesn't save the value. So I figured the easiest way to idiot-proof it would be to just "press and hold" for 4 seconds whatever preset button you wanted to set, without needing to press the cam ID button.
|
|
|
|
vMix Forums
»
General
»
3rd Party Software and Development
»
Script for action on button hold of X seconds
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close