-
Couldn't load subscription status.
- Fork 260
Closed
Description
Currently, the Tokenizer just drops data bytes if there was no status byte set in the current message:
Lines 56 to 65 in b884bc3
| def _feed_data_byte(self, byte): | |
| if self._status: | |
| self._bytes.append(byte) | |
| if len(self._bytes) == self._len: | |
| # Complete message. | |
| self._messages.append(self._bytes) | |
| self._status = 0 | |
| else: | |
| # Ignore stray data byte. | |
| pass |
The MIDI spec, however, allows to omit status bytes (see MIDI running status) in which case the last transmitted status should be used. In my case a hardware device uses this feature and by this totally scrambles the parser state. 😢
If I see this correctly, the only change needed would be to store the last status byte when completing a message with at least one data byte and only ignore 'stray data bytes' if nothing was set yet.
Metadata
Metadata
Assignees
Labels
No labels