8000 Sending a message immediately after connection seems to lose the message or the reply · Issue #167 · Boddlnagg/midir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Sending a message immediately after connection seems to lose the message or the reply #167
Open
@caprica

Description

@caprica

I create my input and output connections in the usual way.

For this particular piece of code, I don't hold on to the connections for the lifetime of my application. Instead, I acquire them, do some code, and then release them. It's for iterating the list of preset instruments in my keyboard on application startup, and caching them.

Immediately after I have created those connections, after checking for connection errors, I send a message via the output connection (it happens to be a SysEx identify message).

Either my MIDI device does not receive that message, or my device responds to that message before the callback is ready. Whichever case, this first message is seemingly lost, the callback never receives it.

I have worked around this by doing a sleep for 50-100ms before sending the message, and that does work.

However, I expected that since I have a valid connection instance, by the time I have that instance everything should already be set up and ready to go.

If the short sleep is the answer, then fair enough, but is there no more deterministic way to make this work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0