shithub: choc

Download patch

ref: ac1f0c32193abd006536eb3bfd20dc8b3a6b691a
parent: d66009a89528c4a8686319a7e6b1975383187080
author: ceski <56656010+ceski-1@users.noreply.github.com>
date: Wed Jan 25 18:38:30 EST 2023

win midi: Send "reset all controllers" when song loops (#1571)


--- a/src/i_winmusic.c
+++ b/src/i_winmusic.c
@@ -1081,6 +1081,10 @@
                 }
                 else if (song.looping)
                 {
+                    for (i = 0; i < MIDI_CHANNELS_PER_TRACK; ++i)
+                    {
+                        SendShortMsg(0, MIDI_EVENT_CONTROLLER, i, MIDI_CONTROLLER_RESET_ALL_CTRLS, 0);
+                    }
                     RestartTracks();
                     continue;
                 }
@@ -1407,7 +1411,7 @@
 {
     if (song.tracks)
     {
-        int i;
+        unsigned int i;
         for (i = 0; i < song.num_tracks; ++i)
         {
             MIDI_FreeIterator(song.tracks[i].iter);