Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timers - Subsecond resolution? #128

Open
PWBENNETT opened this issue Oct 27, 2017 · 4 comments
Open

Timers - Subsecond resolution? #128

PWBENNETT opened this issue Oct 27, 2017 · 4 comments

Comments

@PWBENNETT
Copy link

I have a situation where I want to briefly "tap" a button. In other words, setPressed(... True) when some event happens, record the T = time when it was pushed, let the event loop run a few milliseconds or so, and as soon as time > T + some_value, then I know it's safe to setPressed(... False). What's the best hi-res timer to access within IronPython?

@zelmon64
Copy link
Collaborator

@PWBENNETT how quick a tap do you want? Here's some information on the timing. Here's an example.
If you use setPressed(key) without a boolean it sends a brief tap.

@PWBENNETT
Copy link
Author

I'm using vJoy.setPressed() at the moment, around line 33 of this:

https://gist.github.com/PWBENNETT/8f2c44f8b17d24fee7094459b5ec89b8

However, I found out this evening when I went to resume debugging it that none of my vJoy devices work at all. No errors, and reading the MIDI devices goes fine, but none of the vJoy axes or buttons are being changed when I slide sliders and twist knobs.

@PWBENNETT
Copy link
Author

For now, I'm reinstalling vJoy itself, but the installer isn't finishing (yet), even though it's been several minutes at 99% or 100% (it's hard to tell from the bar graph).

@PWBENNETT
Copy link
Author

Yeah, it seems that midi[n].update() on this type of control (like a jog wheel) leaves the buffer data with a control value of either 63 (turn -ve) or 65 (turn +ve), never returning it to "no update" / "not moving". This seems to be inherent in MIDI itself, since I've seen it with other software on other OSes. I'm guessing (on the fly) that my devices are maybe waiting for some kind of ACK in response before de-signalling its state. I will continue to research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants