summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev/midiin.cpp
diff options
context:
space:
mode:
author Devin Acker <d@revenant1.net>2022-08-14 22:24:09 -0400
committer GitHub <noreply@github.com>2022-08-14 22:24:09 -0400
commit2e91b7bbd5afbdc48011d1020f78fb675bac2011 (patch)
treee6b75e73f63e2dc98ffa5373cf3e23aa5fa15e00 /src/devices/imagedev/midiin.cpp
parent9ae123ea7888f046259510819e3660fdf22a13e2 (diff)
imagedev/midiin.cpp: send All Notes Off CC when unloading a MIDI file (#10221)
Diffstat (limited to 'src/devices/imagedev/midiin.cpp')
-rw-r--r--src/devices/imagedev/midiin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp
index d75d9495026..dc15ea3980f 100644
--- a/src/devices/imagedev/midiin.cpp
+++ b/src/devices/imagedev/midiin.cpp
@@ -203,6 +203,16 @@ void midiin_device::call_unload()
{
m_midi->close();
}
+ else
+ {
+ // send "all notes off" CC if unloading a MIDI file
+ for (u8 channel = 0; channel < 0x10; channel++)
+ {
+ xmit_char(0xb0 | channel);
+ xmit_char(123);
+ xmit_char(0);
+ }
+ }
m_midi.reset();
m_sequence.clear();
m_timer->enable(false);