Skip to content

Bugfix: fix panic in ListenTo for some msg types

Fixes #55 (closed)

Previously, the function _channelMessage took two data bytes, even though the AfterTouch and ProgramChange messages only have a single data byte. At the only callsite of _channelMessage, this caused us to always index into the raw message for both data bytes. This would panic with index out of range for AfterTouch and ProgramChange messages, since the raw message is shorter.

To fix this, we pass the raw data message into _channelMessage as a byte slice and only index into the second data byte for the messages that use both data bytes.

Merge request reports

Loading