-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feature request: Auto-reconnect device #371
Comments
MIDI does usually "just" reconnect (on OSX). Which devices are you thinking of? |
MIDI. On linux I have to set up automatic reconnection through another program, something like qjackctl's patchbays.
However, there is something specific to the pedalboard I'm using, which is that when I plug it in, I have to send a special sysex for it to be in "hosted" mode. |
I want to add that what currently blocks me from implementing this separately is #372. I posted the present feature request because I thought it could be an interesting feature to add to Modality, not knowing that on mac it "just" works :) |
did not intend to bully, just tried to understand what's wrong... |
Opssss some communication didnt work right here! I didn't intend to sound pissed, and havent felt bullied at all! Sorry if yiu got that impression, and thanks for your work and replies! |
no worries :) |
hm, this should actually be in SC itself - it reconnects without modality already:
|
I can confirm that automagic reconnection doesn't happen on Linux without an external program doing it. I think this is then out of Modality's scope. If such a feature would be implemented in SC, maybe Modality could have some hooks to it, but probably that wouldn't really be needed anymore. So feel free to close this issue :) If anyone is interested, I sketched a (working :)) Linux implementation, that extends SC_AlsaMIDI's processEvent() to forward port-related messages to sclang, so that MIDIFunc/defs can respond to them: Thanks for your collaboration! |
Newly connected devices do not show up until you call MIDIClient.init:
and there is no automatic system notification when a new device was connected.
OK, will do when we know that is the way to go.
I checked, polling MIDIClient.prList is really cheap,
|
I also thought about polling initially, then my problem was that if you disconnect and reconnect a device quicker than the poll rate, you loose that event, and that would be meaningful to me in case I have to call a function every time a device is connected (e.g. setting the device in "hosted" mode by sending a sysex). The advantage of a poller though, is that it would be automatically cross-platform, leaving communication with the specific midi driver as a responsibility for a lower level... |
@elgiano - do you have any numbers how short these dropouts can get? |
It would be great to have an auto-reconnect feature, in case of accidental unplug of a device during a performance.
Here is how I see it could be done:
try{this.closeDevice}; this.device = nil; this.openDevice
)The text was updated successfully, but these errors were encountered: