tmick0 / alesisvsysex

Python tool for configuring Alesis V-Series MIDI controllers
MIT License
16 stars 7 forks source link

Program Hangs on Repeat Send To Device commands #8

Open gary-1959 opened 8 months ago

gary-1959 commented 8 months ago

I was having a problem with the program hanging after a couple of Send To Device operations. I found this about mido: https://github.com/mido/mido/issues/37 which talked about only receiving 1000 messages before input hangs. Following the discussion I inserted a sleep command into AlesisV25Device._send (line 26 in alesisvsysex>device>alesis.py) as follows:

def _send(self, message): if not isinstance(message, SysexMessage): raise ValueError("Can only send a SysexMessage") p = mido.Parser() p.feed(message.serialize()) self._port.send(p.get_message()) time.sleep(0.001) # added because of save to device hang

Of course time has to be imported beforehand.

This seems to have resolved the problem.

Hope this helps,

Gary