Here I present DOSMid, an open-source MIDI player for DOS.
Today I released a new version of DOSMid, the v0.8. In this version I added support for additional hardware, fixed a few minor bugs, and optimized the code so DOSMid runs comfortably on an 8086 (wanna see? here's a video of DOSMid running on an 8086 with 256K of RAM and a mono screen: https://youtu.be/8ssDGBTssUI ).
- SBMIDI support (can drive MIDI synths attached to SB 1.x and 2.x cards),
- serial (RS-232) output support (/com=xxx or /com1.. […] Show full quote
- SBMIDI support (can drive MIDI synths attached to SB 1.x and 2.x cards),
- serial (RS-232) output support (/com=xxx or /com1..4),
- implemented 'controller' MIDI support on OPL output,
- added support for relaying SYSEX messages to the MIDI device,
- DOSMid adds a 2s silence gap before each song,
- support for monochrome video modes (autodetected),
- fixed parsing of hex I/O ports with non-numerical chars (like "3f8"),
- reduced timing inaccuracy from ~0.02% to <0.005% (relies on PIT's quality),
- restoring initial video mode after DOSMid quits,
- reliable detection and reporting of out of memory conditions,
- /noxms handles more than 64K of memory (bigger files can be played),
- support for custom SYSEX initialization via a SYX file (/syx=FILE),
- "expensive" features can be easily disabled at compile-time (AWE, OPL),
- screen refresh optimizations - runs without lagging on my 8086 now.
Can it play large midi files (bigger than 500kb for example) ?
I don't have such big MIDI files to test (have some links to such monsters? I'd be curious to see), but in theory - yes, it should play such files without troubles if you have enough XMS memory.
I just tested on my 200mmx build with a MPU401AT interface + MT-32, DOSMID can play a 1.5MB midi file just fine! It take a little to load but it works - that's a first in DOS midi players , we were always limited by the amount of free conventional memory. So glad to see a working solution to this.
I am attaching a zip file with some MT-32 soundtracks from the Quest Studios website , there are some really large one midis in there that work for the first time under DOS 😎
Kudos on the player mateusz.viste! btw, have you considered giving the option to use a small config file so users like me don't have to always use "/mpu=330" when there are both SB and dedicated mpu installed on the system? One other suggestion would be to make the player assume .mid so a command like this works: dosmid lsl3mt (lsl3mt.mid is the file we want to play)
I also notice that if you let DOSMID load the corresponding *SYX file before playback the MT-32 displays the "buffer overflow" error. On the same setup the DUMP.EXE util does not produce that error (dump.exe was in the Quest Studios site here: https://web.archive.org/web/20130120051532/ht … /utilities.html)
Is there a way to get it to load an alternate instrument bank for MUS files? Comparing to MUSPlay by V. Arnost, I find that it sounds exactly the same when playing through DOSBOx's MPU-401, but quite different when playing through the OPL emulated at port 388h. MUSPlay sounds nicer in this case (using the original Genmidi lump from DOOM).
It could be related to the general remark by leileilol about certain instruments being off-key...
Exelent ! , works perfect in my 386 DX40MHZ 8mb RAM , SBPRO conected to MT32 , great program , any chance of having a file selector in the same program? .. Thank you !
First of all, I'm really sorry for my quite long response time. To tell the full truth, I'm not a big fan of these "forum" things (I'm more of a usenet guy), so I rarely check out here. And for some reasons, vogons didn't notified me about this thread's activity even though it appears in my "watched threads" list.
keropi wrote:
btw, have you considered giving the option to use a small config file so users like me don't have to always use "/mpu=330" when there are both SB and dedicated mpu installed on the system?
I am unsure whether such config file would really have a significant added value... DOSMid will use by default whatever is set in your BLASTER variable, so if it contains the correct port of your dedicated MPU, then that's what will be used. And even if you'd like to use a custom port specifically for DOSMid, then it's just a single batch file away:
1@DOSMID /MPU=330 %1 %2 %3
Nonetheless, I can understand why one would prefer a configuration file, as it might appear "cleaner" than a custom *.bat... So yes, I will most probably add such (optional) config file support.
leileilol wrote:
I've noticed some instruments are off-key on some certain midis in OPL mode...
Well, DOSMid's OPL support is kind of a "proof of concept" - I developed it mostly because I wanted to see if I would be able to.. But it's far from perfect. What you mean, I guess, is that some MIDI files played via OPL sound different than what they sound in other contexts (in-game or so). This is related to the fact that I hard-coded 'generic' OPL instruments inside DOSMid, while most OPL-playing applications used to provide their own sound fonts. Hence the solution would be to make it possible to feed DOSMid with an OPL sound font file - and this is something that I certainly plan to do, at some point in the future.
keropi wrote:
if you let DOSMID load the corresponding *SYX file before playback the MT-32 displays the "buffer overflow" error.
Is your MT-32 a "rev00" model by any chance? Sadly, I do not own a MT-32 myself, so I can't test, but I hear these tends to be quite sluggish when it comes to sysex processing. I added an additional delay of 40ms between each SYX event, and an additional 200ms delay for specifically for the "reset all parameters" event which might need a longer time to reinit the hardware. Could you please tell me if your "buffer overflow when loading SYX" problem still happens when using the version below?
Is there a way to get it to load an alternate instrument bank for MUS files?
It's not really a MUS-related question. I take you play MUS files via an OPL (as opposed to a wavetable MIDI processor), so the answer I wrote to leileilol also applies (that is, "need to implement custom OPL soundfont support - on the roadmap, but can't commit to any deadlines for now").
thierry wrote:
any chance of having a file selector in the same program?
Yes, this is something I plan to add for the DOSMid v1.0 (to be expected before 2020). :) Unfortunately my spare time is very rare these days, and it doesn't look like this situation is going to improve, so while I am still very into retro-computing development, I hardly get the time to get anything bigger done.
First, excellent player! The only one that actually sends SysEx from a mid file on my machine without having to tweak the sound blaster, using the MPU port.
Kudos!
I can't make SYX files to work win DOSMid.
No matter what I write after /syx="********" the return is always "Error: You have to provide the path...."
EDIT:
Okay, it had to be sent together with a MID file. But WHY?
I just want to initialize the unit with a SysEx Reset command without actually playing anything or applying the patch list DOSmid sends when it exists.
Even worse, when I load the MT32EMUL.MID which sets custom instruments to all channels, DOSMid overwrites them on exit.
Why the custom patch list when starting or exiting DOSMid?
When I play a GS_Reset.MID with nothing but a single SysEx inside, I want the unit to stay initialized, not have a custom patch list.
All Notes, All Sounds to OFF = alright.
Midi Volume sysex to Max = alright.
Custom Patch list = Totally Not Cool!
Moreover, this list sets patch 09 to Drums???
Do you realize there is no such patch on channel 10 for drums and many synths will have silence instead of drums!
Anyway, I don't know the reason for that patch list on enter or exit but it's definitely does more harm than good with MPU and real synths.
Last edited by James-F on 2016-06-10, 05:25. Edited 2 times in total.
Hi Mateusz, I'm so glad you maintain this project! Make sure that I use it a lot for to enjoy my music collection on vintage sound cards such as the ADLIB or the SBPNP32 (using the OPL3 or the EMU8k). Considering the offer, I think you might have what could be the best dos midi player in your hands. I have read many of the file in your source code and they are examples of how to lay down a project and how to document it, it's barely believable that you made all this alone, have you?
I'm sorry to get back to you with that, but if I found a good GM.IBK in the CakeWalk5demo directory, I have yet to find some good general midi drum .IBK file. I am sure you should package DOSMid with an instrument and drum .IBK file, could encourage people to use your support for custom sound banks on opl soundback.
I have hear that someone here coded some sf2 support but due to dos real mode, he could not just only load the .sf2 into the emu8k ram and let it wait here for some player to use it like in windows. I think you should get in touch with that guy and merge his sf2 loading routine with your emu8k .mid player, that would really get you one step beyond.
I can't make SYX files to work win DOSMid.
No matter what I write after /syx="********" the return is always "Error: You have to provide the path...."
Can you please provide the full command line you execute, as well as the exact version of DOSMid you use?
Note, that your example above contains quotes around the syx filename. These should be removed. Example:
1dosmid canyon.mid /syx=myinit.syx
Tested it right now on DOSMid v0.9, works for me.
Why the custom patch list when starting or exiting DOSMid?
The patch is far from "custom", it's simply a reset to default GM assignations.
When I play a GS_Reset.MID with nothing but a single SysEx inside, I want the unit to stay initialized, not have a custom patch list.
This is what the /syx feature is designed for. If it doesn't work, it needs to be fixed, but for that I'd need to know more about your trouble (see my previous questions).
Moreover, this list sets patch 09 to Drums???
Do you realize there is no such patch on channel 10 for drums and many synths will have silence instead of drums!
Indeed, the channel 9 reset could be removed. I just iterate through channels from 0 to 15 and point them to instruments 0 to 15 now. Didn't care about skipping the special-case channel 9, but you are right that it would be cleaner to. All synths I tested are fine with it, though. Have you actually run into the "silent drums" trouble? I'd be curious to know on what synth hardware.
Anyway, I don't know the reason for that patch list on enter or exit but it's definitely does more harm than good with MPU and real synths.
The patch list reset happens before loading every MIDI file. Why? Simply because I have MIDI files that expect the synth to have standard GM patches pre-loaded in the default order. Without the reset, playing such MIDI file right after one that changed the patch set leads to funky results (ever listened to Scott Joplin playing on flutes?). :)
The patch list reset happens before loading every MIDI file. Why? Simply because I have MIDI files that expect the synth to have standard GM patches pre-loaded in the default order. Without the reset, playing such MIDI file right after one that changed the patch set leads to funky results (ever listened to Scott Joplin playing on flutes?). 😀
This is absolutely not true!
The default midi instruments after a GM reset on any synth are channel 1-16 Piano.
Your player is the only one among many other players that does anything but 1-16 piano list.
You fixed your broken midi but destroyed countless others that expect instrument 0 (piano) on all channels after reset (Drums on channel 10). "standard GM patches in the default order".. where did you read that? There is no such thing in the 25 years of midi existence.
Here is the most complete midi player available on the PC: Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
I helped Falcosoft debug and improve this player to perfection.
You can ask him if there is such thing as "standard GM patches in the default order".
Or you can check it's midi behavior at Start/Stop (1-16 piano obviously).
Having said that, next is the SysEx command that doesn't work (using DOSMid 0.9).
Here is my full command:
1dosmid.exe /syx=reset.syx
Yes I know it doesn't work because I have not added a MID file to the command, but I wish it did to avoid your custom instrument list.
Running only GS_Reset.MID destroys the Reset by applying your custom instrument list at the end... why would you do that? 😵
I also have MT32EMU.MID that pre-loads a custom patch list to emulate the MT-32 on the SC-55, but again. your player destroys that.
I am talking strictly about MIDI (MPU-401) here, not OPL or other options.
Again, I have no idea where you read about "standard GM patches in the default order" but that simply not the way to do it.
Is suggest you fix your broken MIDIs instead of forcing the world to use a custom instrument list. 😉
If I may request to have an option to apply ONLY "All Notes Off", "All Sounds Off" and "Reset Control" when using MPU mode, that will solve many problems.
An option to run a custom Sysex at Start and/or at Stop will be very useful, many other player do that including the one I noted.
In other words, "All Notes Off", "All Sounds Off" and "Reset Control" are default and everything other should be optional/user customizable.
In other other words, please remove this utterly pointless and destructive instrument list at the end.
Hi James, thank you for your hints! The MIDI files that were going crazy without resetting channels were all Scott Joplin tunes I like to listen to from time to time (obviously all piano), and almost all of them use channel 0 exclusively - that's why it was working in my case. The patch reset itself won't go away, because I need it, but I will definitely change it to "all piano" instead "0..15".
The second problem you describe is that my reset destroys your syx initialization - this I agree is pretty sad. I haven't checked yet, but suspect it's simply because I call it in the wrong order, that is "apply syx" followed by "apply reset", instead of the other way around. I have a 10h flight ahead of me today so I will surely fix that in the plane. I will get back here when done.
As for using DOSMid to only apply a sysex - well, that's not the goal of DOSMid. Surely there are much simpler and specialized tools out there for just that. I believe though that changing my reset to "all piano" and running SYX *after* the piano reset will solve both your troubles, right?
Actually I hacked it quickly right now, while still on the ground. James, could you please confirm that this version works better for you? http://mateusz.viste.fr/temp/dosmid-james/
Hi mateusz, thank you for addressing this so quickly.
Thank you for changing it to 1-16 piano, like it should be.
1. The test version applies the "apply reset" sequence TWICE at start and nothing at exit (bug).
2. The "apply syx" should be BEFORE the "apply reset" but only at start.
3. At exit, do NOT apply the instrument piano list or the Sysex, only Notes, Sounds, Ctrl Offs.
SysEX -> "apply reset (w/ piano list)" -> Play Midi -> "apply reset (NO piano list)"
That may mean that you'll have to have two reset lists in your code.
The reason for not having piano list or sysex at exit is because the attached MT32EMU.MID sets custom instrument list (using sysex commands) so DOS games can use the SC-55 in MT32 mode,
so we do not want to overwrite that at exit with sysex or with other instrument list. It doesn't matter if you leave the patch list as-is at exit in any case.
Most games do just that at exit, leave the patch list as-is, never harmed anyone yet.
I you want, you can have an option to apply the Sysex at exit too, but that should be decided by the user.
That's all there is to it.
EDIT:
Fixed the order, please read again.
Sorry about that. 😊
1. The test version applies the "apply reset" sequence TWICE at start and nothing at exit (bug).
Yes, I know. First time is during initialization, second time just before starting the playback. I might optimize it later, but it's not that important after all (meaning nothing harmful could result from this).
Nothing at exit - this is on purpose, too. I don't touch the MPU once I played the file, so this opens the possibility of using DOSMid for some kind of initialization-only stuff, even though that is not its primary purpose.
James-F wrote:
2. The "apply syx" should be BEFORE the "apply reset" but only at start.
I am not sure I follow why. The SYX file could very well wish to set things like volume, pre-load some patches, etc. Running the 'apply reset' afterward would undo actions that the user tried to execute via the SYX.
James-F wrote:
3. At exit, do NOT apply the instrument piano list or the Sysex, only Notes, Sounds, Ctrl Offs.
As you observed, I do nothing at exit since yesterday's version.