VOGONS


First post, by Low power

User metadata
Rank Newbie
Rank
Newbie

Hello.

I has been using DOSMid for some time, and recently I bought a few LPT sound cards from Serdaco, which are very neat. When searching for applications for use with the CMSLPT, I found the CMS-enabled DOSMid fork made by Tronix; this version works with the TSR driver that emulates the CMS (CMSLPT.COM). I then had the idea of adding native support for this card based on Tronix's work.

This fork is actually based on a merge of upstream version 0.9.7 (commit r347) and Tronix's fork; the detail of this rebase and merge process can be found at https://github.com/Tronix286/DOSMID/issues/2.

The native support for CMSLPT can be activated by using option:

/cms=lpt#

where # is the LPT unit number, ranged from 1 to 4.

I later also added native support for OPL2LPT and OPL3LPT. Because there's no way to auto-detect whether it is a OPL2LPT or a OPL3LPT, it must be specified maunally via one of following new options:

/opl2=lpt#
/opt3=lpt#

In addition to supports of those LPT sound cards, this fork also implemented some other improvements:

  • Because I'm most comfortable to work in an Unix-like environment, A Makefile for GNU Make has been added, along with a few other minor changes, to enable cross-building on GNU/Linux.
  • Likewise, my fingers are VERY used to type '-' when I start typing a command line option, so I changed the option handling function to recognize both '-' and '/' as option prefix.
  • My DOS setup have a small program that changes cursor shape to a full block cursor on boot (I like block cursor, I think I can blame the FreeBSD project for this); like many other DOS programs, DOSMid resets the cursor to the usual underscore shape on exit; I inserted a few codes to ui.c, which saves current cursor shape on starting, and restores back to original shape on exiting.
  • DOSMid will now exit on 'q' key, as same as ESC key.
  • The CMS support code now handles the 'pan' control change message (10), useful for stereo playback with CMS.

The source code repository is available at https://sourceforge.net/p/rivoreo/dosmid-code … oreo-fork/tree/ and https://github.com/Low-power/DOSMid/tree/rivoreo-fork/.

Also, since I don't have an OPL3LPT, I tested this mode only under QEMU; it would be great if people with a real hardware to confirm it actually working.

Please see the commit log for detailed changes:
https://sourceforge.net/p/rivoreo/dosmid-code/ci/HEAD/log/

Complete man page
DOSMID(1)               FreeBSD General Commands Manual              DOSMID(1)

NAME
DOSMid - a low-requirements MIDI and MUS player for DOS and UNIX

SYNOPSIS
dosmid [<options>] [--] <midi-or-m3u-file>

DESCRIPTION
DOSMid is a MIDI, MUS and RMID player, originally made for DOS.

The DOS version is a real mode application designed to run on very
modest hardware configurations.

The UNIX version supports kFreeBSD-based and Linux-based operating
systems on i386 and amd64 architectures.

DOSMid plays standard MIDI files (both format 0 and format 1), as well
as MIDI in RIFF (ie. RMID), and even MUS tunes (as used by Id Software
in numerous games like Doom, Heretic, Hexen, etc).

DOSMid requires MIDI-capable hardware of some sort. Note, that some
sound cards have an MPU-401 interface, although many need an additional
'wavetable' daughterboard to produce actual MIDI sound.

DOSMid can also emulate MIDI through FM synthesis using an OPL chip
(that is one of the Yamaha YM3812 or YMF262 chips, found on most sound
cards from the nineties), or using dual SAA1099 chips (the Creative
Music System / Game Blaster). Be warned however that, most of the time,
the MIDI-over-OPL emulation will yield less than desirable results,
unless the MIDI file was specifically crafted for OPL; and using
SAA1099 chips will only produce square waves, which can be dramatically
different from the intended instruments.


OPTIONS
Options are case-insensitive. In addition to '-', any option may also
begin with '/'. To specify a file that named with a leading '-', or an
absolute path on UNIX (with a leading '/'), use the end-of-option
marker '--', for example:

dosmid -cms=lpt1 -random -- -.m3u
dosmid -cms=ppi0 -volume=25 -- /test.mid

For options with a <hex-number> argument, the argument should be
written without 0x prefix. For example:

dosmid -cms=230 ...

Will set output device to Creative Music System on I/O port 0x230 (560,
230h).

-mpu[=<hex-number>]
Use MPU-401 on port <hex-number>. If port is omitted, DOSMid
scans the BLASTER environment variable for the MPU port, and if
not found, it fallback to port 330.

-awe[=<hex-number>]
(DOS only) Use the EMU8000 synth chip found on SoundBlaster
AWE32/AWE64 cards on port <hex-number>. KNOWN BUG: On some AWE
Show last 240 lines
              cards, the FM music module becomes muted or noisy after using
the EMU8000 chip. This is not a bug in DOSMid, and happens with
other applications using AWE as well. If you have this problem,
execute AWEUTIL /S after using DOSMid to reinit FM. I observed
this problem on an AWE64 CT4390 ("Gold"), but not on an AWE32
CT2760.

-opl[=<hex-number>]
Use an OPL2-compatible or OPL3-compatible chip on port <hex-
number>. This should be a last resort option if you don't have
any wavetable device. Do NOT expect pleasing results. The
default port is 388 if not specified.

-opl2[=<hex-number>]
Use an OPL2-compatible chip on I/O port <hex-number> as output
device. The default port 388 will be used if omitted. It will
be used in OPL2 mode, even the chip is OPL3-compatible.

-opl3[=<hex-number>]
Use an OPL3-compatible chip on I/O port <hex-number> as output
device. The default port 388 will be used if omitted.

-opl{2|3}=lpt{1|2|3|4}
Use an OPL2-compatible or OPL3-compatible chip on a LPT port
specified by an PC BIOS unit name. This is for OPL2LPT and
OPL3LPT device.

-opl{2|3}=<ppi-device>
(kFreeBSD only) Use an OPL2-compatible or OPL3-compatible chip
via a kFreeBSD ppi(4) device. This is a recommended alternative
to -opl{2|3}=lpt{1|2|3|4}, because it dosen't require low-level
port I/O privilege.

-opl{2|3}=<parport-device>
(Linux only) Use an OPL2-compatible or OPL3-compatible chip via
a Linux ppdev(4) device. This is a recommended alternative to
-opl{2|3}=lpt{1|2|3|4}, because it dosen't require low-level
port I/O privilege.

-cms[=<hex-number>]
Use Creative Music System / Game Blaster on I/O port <hex-
number> as output device. The default port 220 will be used if
omitted.

-cms=lpt{1|2|3|4}
Use CMSLPT card on the LPT port specified by an PC BIOS unit
name.

-cms=<ppi-device>
(kFreeBSD only) Use CMSLPT card via a kFreeBSD ppi(4) device.
This is a recommended alternative to -cms=lpt{1|2|3|4}, because
it dosen't require low-level port I/O privilege.

-cms=<parport-device>
(Linux only) Use CMSLPT card via a Linux ppdev(4) device. This
is a recommended alternative to -cms=lpt{1|2|3|4}, because it
dosen't require low-level port I/O privilege.

-sbmidi=<hex-number>
Drives an external synth connected to the gameport of your Sound
Blaster card. Will read environment variable BLASTER for port
if it is not specified.

-com=<hex-number>
Send MIDI messages out via the RS232 port at I/O port <hex-
number>. This can be used to hook a hardware synth to a computer
with no MIDI interface, only a standard serial port. DOSMid does
NOT reconfigure the serial port, so you should take care of
setting it correctly, for example using 'MODE COM1: ...' command
on DOS, or stty(1) on UNIX.

-com{1|2|3|4}
(DOS only) Use an unit name of a COM device queried from PC
BIOS.

-com=<tty-device>
(UNIX only) Send MIDI messages to the specified terminal device.

-gus (DOS only) Use the Gravis UltraSound card, relying on its
ULTRAMID API.

-nosound
Disable sound (not very useful for a music player!)

-syx=<file>
Uses SYSEX instructions stored in <file> for initializing the
MIDI device. <file> must be in "SYX" format, and can contain one
or more SYSEX messages.

-delay=<n>
Insert an extra delay of <n> msec in range 1...9000, before
playing the MIDI file. Setting this to 100 or 200 might help in
some cases where the sound hardware needs more time to
initialize completely, or when complex sysex data is fed via the
-syx option. You can also use this simply to make the silence
longer between the files of your playlist.

-sbnk=<file>
Makes DOSMid load a custom sound bank. This is supported only on
OPL and AWE hardware. The sound bank file must be in the IBK
format when used with OPL, and SBK format for AWE. OPL accepts
one or two IBK files (eg. sbnk=file1.ibk,file2.ibk). If two are
provided, the first one will be used for the standard
128-instrument GM set, and the second one for defining
percussion instruments.

-preset={GM|GS|XG|NONE}
Preset the MIDI device into a specific mode before playing
(default is GM).

-volume=<n>
Set default volume in percentage of <n>.

-nocolor
Don't colorize TUI even if the system appear to support it.

-noxms (DOS only) Use conventional memory instead of XMS. This is
obviously useful only if you don't have XMS. Don't use this
option otherwise, since without XMS you won't be able to load
big MIDI files.

-xmsdelay
(DOS only) Wait 2ms before each XMS access. Such waiting is
required sometimes when the MPU controller is emulated by a TSR
driver (specifically, the AWEUTIL driver used with SoundBlaster
AWE 32n64 cards happens to crash if XMS accesses are not
slightly delayed).

-log=<file>
Logs all DOSMid activity to <file>. This is a debugging feature
that you shouldn't be interested in. Beware, the log file can
get pretty big (MUCH bigger than the MIDI file you are playing).

-fullcpu
(DOS only) Do not let DOSMid being CPU-friendly. By default
DOSMid issues an INT 28h when idle, to let the system be gentler
on the CPU, but on some hardware this might lead to degraded
sound performance.

-dontstop
Never ask the user to press a key after an error occurs. This is
useful if you want to play a long playlist and don't care about
bad MIDI files, simply skipping them (or if you play a single
file and wish that DOSMid exit immediately if the file is
unplayable).

-random
Randomize playlist order.

-quirk=<name>[,<name>[,...]]
Activate one or more workarounds for the specified quirks.

Recognized quirk names:

norstctrl
Don't reset controllers on end of each file.

-version
Print version and copyright information, as well as optional
features of this DOSMid build. DOSMid will exit afterward.

-?, -h, -help
Print a brief usage message and an incomplete list of available
opitons. DOSMid will exit afterward.


INTERACTIVE CONTROLS
ESC, q Quit.

+, - Increase or decrease volume by 5%.

SPACE Pause the song (press any key to resume).

ENTER Skip to next song in the playlist.

BACKSPACE
Jump to previous song of the playlist.


ENVIORNMENT VARIABLES
BLASTER
When not forced into a specific configuration via command-line
switches, DOSMid scans the BLASTER environment variable to find
out the most desirable settings. This environment variable
usually looks similar to this:

BLASTER=A220 I5 D1 T3 P330 H6 E620

The bits DOSMid is interested in are "A220", "P330" and "E620".
P330 provides the port address of the MPU-401 MIDI interface,
while E620 tells the port address of the EMU8000 onboard synth
(available only on 'AWE' models). A220, on the other hand,
provides the base I/O address of the SoundBlaster card, so
DOSMid can output directly to the card's MIDI port. If not
instructed otherwise, DOSMid will always try to use the EMU8000
synth if found in the BLASTER string, and if not, it will use
the MPU-401. If neither of them are found in the BLASTER string,
or if there is no BLASTER variable at all, then DOSMid will try
to fall back to FM synthesis on port 388h, unless an ULTRADIR
environment variable is present, see below.

ULTRADIR
(DOS only) If this variable is set, DOSMid will try to detect a
Gravis UltraSound card through the ULTRAMID TSR API.

HOME (UNIX only) Instructs DOSMid where to find the configuration
file. DOSMid will skip loading configuration file if this
variable is not set.


CONFIGURATION FILE
Depending on platform, DOSMid will try to read a configuration file
from either
$EXEC_PATH\dosmid.cfg
on DOS, where $EXEC_PATH is where the executable resides, or
$HOME/.dosmid.cfg
on UNIX, where $HOME is the content of HOME environment variable.

When reading the configuration file, DOSMid interprets each line as a
command line option. A line may contain only 1 option, optionally with
its argument if applicable; empty lines, lines containing only
whitespace characters and lines starting with '#' are ignored.


AUTHORS
DOSMid was initially written by Mateusz Viste.

Creative Music System output support by Tronix.

CMSLPT, OPL2LPT and OPL3LPT output support by WHR <whr@rivoreo.one>.

Ported to UNIX by WHR <whr@rivoreo.one>.

This man page was based on dosmid.txt file from original DOSMid 0.9.7
release by Mateusz Viste. It was expanded by WHR to cover the added
features in this fork.


2024 DOSMID(1)

UNIX port details.

Attachments

Last edited by Low power on 2024-01-12, 13:29. Edited 3 times in total.

Reply 3 of 9, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

Hi,
Since your fork seems to be in active development I would like to ask you to add another parameter that would help the also Serdaco made Dreamblaster S2 to be set to MT-32 compatibility mode.
The problem is this:
Re: DOSMid - an open-source MIDI player for DOS
Re: Dreamblaster S2 - MT32 mode

Unfortunately Mateusz has not reacted to this request so far.
The cure would be an option/parameter NOT to send CC#121 (Reset All Controllers) at exit. This code part can be found in OUTDEV.C -> dev_clear().
Thanks in advance.

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 4 of 9, by Low power

User metadata
Rank Newbie
Rank
Newbie

Hello Falcosoft,
I recently forked and customized DOSMid mostly to satisfy my own preferences. I don't expect this fork to remain active in long term.
But since this particular issue seems easy to workaround, I will look into it.
Considering this is really a workaround for a particular quirk, instead of adding a dedicated option for it, I suggest adding a 'quirk' option, which would accepting one or more workarounds to activate:

/quirk=<name>[,<name>[,...]]

this design will enabling more workarounds for different quirks be added in future as needed, while keeping them under a single option.
I will trying to implement this when I got some more time.

Reply 5 of 9, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
Low power wrote on 2023-12-27, 17:25:
Hello Falcosoft, I recently forked and customized DOSMid mostly to satisfy my own preferences. I don't expect this fork to remai […]
Show full quote

Hello Falcosoft,
I recently forked and customized DOSMid mostly to satisfy my own preferences. I don't expect this fork to remain active in long term.
But since this particular issue seems easy to workaround, I will look into it.
Considering this is really a workaround for a particular quirk, instead of adding a dedicated option for it, I suggest adding a 'quirk' option, which would accepting one or more workarounds to activate:

/quirk=<name>[,<name>[,...]]

this design will enabling more workarounds for different quirks be added in future as needed, while keeping them under a single option.
I will trying to implement this when I got some more time.

Hi,
I like your idea about the expandable 'quirk' option.
I hope that your preferences will imply further development so there will still be an active fork.
Thanks in advance anyway!

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 6 of 9, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
Low power wrote on 2023-12-27, 06:26:

I made a video to demonstrate this DOSMid version, as well as my Compaq LTE laptop.

https://youtube.com/watch?v=ubmClncOmaw

thanks for making the demo video, I like it !

Visit http://www.serdashop.com for retro sound cards, video converters, ...
DreamBlaster X2, S2, S2P, HDD Clicker, ... many projects !
New X2GS SE & X16GS sound card : https://www.serdashop.com/X2GS-SE ,
Thanks for your support !

Reply 7 of 9, by Low power

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote on 2023-12-27, 06:59:

The cure would be an option/parameter NOT to send CC#121 (Reset All Controllers) at exit. This code part can be found in OUTDEV.C -> dev_clear().
Thanks in advance.

This has been implemented in a recent commit; it can be activated by using the newly added 'quirk' option, for example:

-quick=norstctrl

Beside that, the CMS support now handles the 'pan' control change message (10). This message is used by many MIDI files, useful for stereo playback. Remember the CMS supports stereo output, comparing to AdLib.

Reply 8 of 9, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
Low power wrote on 2024-01-02, 09:26:
This has been implemented in a recent commit; it can be activated by using the newly added 'quirk' option, for example: […]
Show full quote

This has been implemented in a recent commit; it can be activated by using the newly added 'quirk' option, for example:

-quick=norstctrl

Thank you! Would you make a release on Github so anyone could get the DOS executable without needing to compile the source ?

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 9 of 9, by Low power

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote on 2024-01-02, 10:20:

Would you make a release on Github ...

I'm moving away from GitHub due its crap JS and other issues; I currently uses GitHub only for mirroring repositories I forked from GitHub, as well as filing pull-requests for other projects.

I plan to open my own source code browsing website, may be I can make binary builds available there when it is ready.