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

Confused about event API, especially empty messages [] #16

Open
patmaddox opened this issue Dec 12, 2020 · 2 comments · May be fixed by #17
Open

Confused about event API, especially empty messages [] #16

patmaddox opened this issue Dec 12, 2020 · 2 comments · May be fixed by #17

Comments

@patmaddox
Copy link

patmaddox commented Dec 12, 2020

I am a bit confused about the event API, and hope @lucidstack can clear it up for me. I am admittedly very new to elixir and so am not sure if it's normal or not.

First, the documentation says that a received event looks like {144, 112, 127}. I am seeing events that look like this though: [{{146, 46, 127}, 36124}].

Okay, I'm guessing that the events are now a list of events with a timestamp. Cool. But I'm seeing LOTS of empty events. Sometimes when I press and release a button on my controller, there are several hundred empty events between the on and off. Example:

[{{146, 36, 127}, 79898}]
[]
[]
...286 more times
[]
[{{130, 36, 127}, 79989}]

What's the purpose of those empty events?

Also, other times I can press the buttons on my controller hundreds of times without seeing an empty event. Why is that?

Also sometimes only the first few button presses register and it seems to get stuck. It's pretty inconsistent and I'm not sure what's going on.

I'm just a bit confused and could use some help clearing it up :)

@patmaddox patmaddox linked a pull request Dec 13, 2020 that will close this issue
@thbar
Copy link
Collaborator

thbar commented May 9, 2021

I have seen the exact same behaviour on all counts: empty events at time, and "stuck" process then coming back to life.

I have seen a few commits in forks mentioning a "sleep", will try that out and investigate.

@thbar
Copy link
Collaborator

thbar commented May 9, 2021

It is fixed by #15 for me (which I'll incorporate in my fork at https://github.com/thbar/ex-portmidi).

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

Successfully merging a pull request may close this issue.

2 participants