Tiny MIDI-Commander v0.0

This is a small and super simple solution to send fixed data to a MIDI port.
The intended purpose is to quickly and efficiently set up any devices on the port by just running the tool.
A good example would be to set the desired MIDI bank for a certain game via batch files.
Doing the same with .MID files on a fully featured MIDI player to send out a couple of bytes is quite inefficient and cause additional delays.

This supports two platforms: DOS (MPU-401) and Win32
Also all arguments are case-insensitive!

Suppressing all console output can be done by adding "Q","/Q","\Q" or "-Q" as argument.
However, certain Win32 drivers could still output to STDOUT separately.
The order of the arguments doesn't matter!

Info for DOS:
The MPU401 port derived in this order.
1. A Hexadecimal number as argument (WITHOUT PREFIX)
2. The BLASTER variable (if a value for 'P' is found)
3. 0x330

Info for Win32:
By default the MIDI Mapper is used (also what is set as default MIDI output in Windows)
Otherwise pass a port number (less than 100) as argument.
The name of the device will be shown in the output.


List of commands:
drmgsb - DreamBlaster X2, Set GS Bank
drmnxt - DreamBlaster X2, Switch to next Bank
drmusr - DreamBlaster X2, Set User Bank
mr_off - TS-MR Controller, Disable*
mr_on  - TS-MR Controller, Enable without Auto-off*
mr_aof - TS-MR Controller, Enable with Auto-off**

*  This controls my MIDI Reset controller. (a PIC12F629 listening on the MIDI line for special SysEx commands)
   It controls a logical output connected to the reset input of an DreamBlaster X2 to reduce power consumption.
   The firmware and hardware details for this can be found in midi_reset.zip on my website or download:
   http://qwertz.w10.site/files/pic/midi_reset.zip

** This one is special as it uses additional code to facilitate a extra parameter. (Also doesn't use main.c but embeds a altered copy)
   A argument is REQURIED for this to work, a decimal value of 1-127 with a prefix of T and optional character '/','\','-'
   This serves as a time-out value in 10 seconds steps, it will trigger if the MIDI output was quiet for this amount of time.

All executables ending with 16 are DOS (12KB), the rest are Win32 (30KB).


Build instructions with WATCOM:
MOST IMPORTANT! You can't build main.c as this shared code base and lacks any required headers on purpose.
change into the midi_ctl directory in the command prompt then run...
For DOS:
C:\WATCOM\binnt\wcl.exe /d0 FILENAME.c -i="C:\WATCOM/h" -bt=DOS -fe=FILENAME16
For Win32:
C:\WATCOM\binnt\wcl386.exe  /d0 FILENAME.c -i="C:\WATCOM/h" -bt=NT -fm


How to make your own commands:
First of all, YOU MUST KNOW WHICH EXACT BYTES TO SEND!!!
Then you change the contents of CmdBytes[]={...} to your desired data
Lastly you change the text after CmdDesc "..." to a descriptive name of the command to let the user know what it is.

Also if you desire to have a command with a parameter then you should checkout mr_aof.c and read the code.
The variable "b" holds the parameter and the line "CmdBytes[8]=b&0xFF;" changes the actual data byte of the command.
You will also see 'T' in the argument parser code for the argument and you can change it as well.


Also special thanks to the excellent author of this fine document on the internet:
http://midi.teragonaudio.com/tech/mpu.htm
for helping me write my own MPU-401 routines.


T. Sosnow. <t-sosnow@posteo.com>
Visit QWERTZ-tek at http://qwertz.w10.site/ for my other stuff
April 23, 2026
