hi there,

this has been bugging me for a longer period of time. is there a possibility to reconnect a midi device to a running bela program? right now as soon as i unplug my usb-midi device i cannot reconnect it while the patch is still running... it would be really convenient if that could somehow work. reason being that for live usage sometimes you get a loose connection or somebody touches your cable etc.

It can be implemented, but it's not there at the moment. Workaround would be to restart the program by quickly tapping The Bela Button. But it should be there. I added a feature request.

10 days later

done here. I couldn't yet test if recovering the output device works fine, but I have no reason to think otherwise . Please try and see if it works for you. It may take a few seconds after you reconnect the MIDI device for it to come back to life.

    lokki . will this update work from the old IDE?

    not sure what you mean there. If you update the code to the version that is on that branch, you will also get the new IDE. If the question is about updating THROUGH an old IDE, then it won't work, you'd have to run scripts/update_board. If the question is: can you update that one commit on top of an "old" core code, then the answer is mostly yes: the affected files (Midi.cpp and Midi.h) have not changed much in the last couple of years.

    4 days later

    ok, did the update. all went smooth! i used the update_board.sh script. great!

    and the midi reconfig also works smoothly so far, actually it is a lot faster then "a few seconds".

    this is really useful for me, thanks!

    btw. is there a way to send a message to pd/heavy once the midi device has been reattached (is ready)? (this would allow me to send the UI changes via MIDI on reconnect therefore recreating the state before the disconnect.

      lokki and the midi reconfig also works smoothly so far, actually it is a lot faster then "a few seconds".

      great!

      lokki is there a way to send a message to pd/heavy once the midi device has been reattached (is ready)? (this would allow me to send the UI changes via MIDI on reconnect therefore recreating the state before the disconnect.

      Is this to, e.g.: set LEDs on the MIDI device to mirror the state of the running program?
      A clean implementation of this would probably use something like an on_connect() callback, at which point there should also be some on_disconnect(). Let me have a think about it.

        giuliomoro Is this to, e.g.: set LEDs on the MIDI device to mirror the state of the running program?

        exactly. the LEDs on the quneo reflect the preset settings...

        but it is not that high priority for me. if you find the time great. otherwise i can also live with the fact that i simply get the LED feedback on the next preset i load via the controller