From 2703bfc2215b6048198b2380e0f3eb9232447e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Figli=C3=A8?= <88441442+onirob@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:01:26 +0200 Subject: [PATCH] Fix for midi freeze Reset midiEventMemoryIndex in AlsaDriver.cpp when starting MIDI processing and when clearing midiEventCount to avoid stale index/state issues while using expression pedals. --- src/AlsaDriver.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index d49a0b3..32f3f58 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -2,6 +2,7 @@ * MIT License * * Copyright (c) Robin E.R. Davies + * Copyright (c) Roberto Figliè * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -1681,6 +1682,7 @@ namespace pipedal AlsaMidiMessage message; midiEventCount = 0; + midiEventMemoryIndex = 0; auto alsaSequener = this->alsaSequencer; // take an addref if (!alsaSequener) { @@ -1772,6 +1774,7 @@ namespace pipedal break; } this->midiEventCount = 0; + this->midiEventMemoryIndex = 0; // snd_pcm_wait(captureHandle, 1); ssize_t framesToRead = bufferSize;