I have run various test programs, following the examples, to play a wav file, then a MIDI (with or without loading of patches), then play a wav file again. The first wav play is fine. MIDI is fine. The final wav always fails. I have used remove_sound, and remove_keyboard, remove_timer (after destroy_midi) in the MIDI function, followed by the install counterparts in the wav routine, tried MIDI independently as a child process, tried repeating Allegro initialization, even having a test program shut down with an atexit routine to call a batch to restart.
The only thing that works is letting the program exit and manually calling it again, whereupon it plays the first wav, then the MIDI, then fails with the second call to play a wav. I've tried even combining them in turn in main, leaving keyboard and timer installed. I've tried double installation and the appropriate _NONE calls.
I normally have MIDI as a child process and DIGI as a function in my program. It took a while to notice that the normal sounds weren't working after MIDI play, since MIDI is used by the alarm clock, and I or a user wouldn't normally touch the computer for a while after shutting off the alarm. Actually, the MP3 and voice alarm options get more usage than MIDI. No problem with them.
At first I thought it was a bug in my program. Then I made various tests, mentioned above. I thought remove_sound, if the MIDI routine were in the main program, or return 0 from main if a child process, would be enough to put MIDI to bed when finished. One thing I just thought of to try is exit(0) instead of return 0 in the child version.
I checked the old threads back to 1999 for this question. Didn't see it.