DMP.DOC Documentation for the Dual Module Player v3.00 Copyright (C) 1992,1994 Otto Chrons Dual Module Player is a program for playing music modules on different sound systems on IBM PC compatible machines. It uses DSMI sound programming interface (Digital Sound & Music Interface) to achieve high quality sound and wide sound card support. DMP is cardware so you can freely copy it to your friends and distribute it to BBSes etc. If you like DMP you should send me a postcard! Currently DMP supports following module formats: MOD,NST The original Amiga module format (SoundTracker, NoiseTracker). Also supported by many PC trackers. Original format supported only 4 channels but many variants can support up to 32 channels. STM,S3M Scream Tracker format. S3M can support up to 16 channels while STM is limited to 4. 669 Composer669 module format using 8 channels. FAR Farandole tracker format capable of using 16 channels. MTM MultiTracker format. It's a MOD variant with up to 32 channels. AMF DSMI's internal module format. You can convert all the previous formats to AMF with M2AMF but not vice versa. Using AMF format saves you disk space because AMFs are usually smaller than other module formats. DMP can also load AMFs faster than other formats. But remember that you cannot play AMFs on any other player, nor can you convert AMFs back to any other format. DMP is a simple program without any fancy graphics or interactive file selection menus. Most DMP options can be set with command line parameters, or by setting them into DMP envrionment variable or DMP.INI setup file. This is the command line syntax of DMP: DMP [options] [modulename] [@listfile] [options] where, [modulename] Name of the module (or modules) to play. Wild cards are allowed. [@listfile] name of a file containing a list of module names. You can also use wild cards within the list file. [options] DMP settings -H, -? Show help screen about options. -Sxxxx Set playback rate (4000-60000) or (4-60). Most sound devices can only reproduce up to a certain playback rate (like 44.1kHz) so DMP will automatically adjust the given sampling rate if it's too high. -Ixx Set the sound card IRQ (interrupt) -Pxxx Set sound device port address. This value is given in hexadecimal notation (i.e. 220) -Dx Set sound card DMA channel. -Cxx Force sound device selection: 1 for Sound Blaster 2 for Sound Blaster Pro 3 for PAS+ 4 for PAS16 5 for SB16 6 for general DAC (Covox) 7 for Aria cards 8 for Windows Sound System & compat. (like AudioTrix Pro) 9 for Gravis Ultrasound 10 for PC Speaker 11 for Stereo DAC (LPT1 & 2) 12 for Stereo-on-1 DAC -M Set card to mono mode. Default is stereo mode if sound card supports stereo output. -8 Force 8-bit sound output. Sets 16-bit sound cards to 8-bit mode. This mode is a little bit faster but the quality is very poor compared to 16-bit. See "Quality mode". -Q Use Quality mode. See "Quality mode". -Axxx Amplify by xxx. 31 is normal volume. Should only be used with Quality mode. -Txxxxx Set sound playback buffer size. DMP automatically adjusts the buffer size according to sample size, stereo and sampling rate but if you need larger buffer, you can use this option. -Nxx Set default panning to xx. Most module formats don't support default panning, the channels are either left or right. With this option you can bring the channels close to the middle position. Value 0 means middle panning, 63 sets the channels as much apart as possible and 100 forces surround sound. -Fxx Select digital effect xx as the default effect. Digital effects are defined in DMP.INI -E Disable extended (BPM) tempos. Use this option if you encounter tempo problems with old modules. -G Use non-DMA download mode for Gravis Ultrasound. If you encounter problems with GUS (samples sound incorrect), try this option. -GT Use PC timer instead of GUS timer for playback. If the music stops wihtout a clear reason, it might be a problem with GUS timer. -L Inhibit looping. If you are playing just one module DMP will by default loop the module forever. -O Randomize the playing order of modules. -B Disable EMS usage. -Zxx Use 25 or 50 row display -W[command] Run [command] after staring to play the module. If you want to give command line parameters to [command], put quotation marks (") around the option i.e. "-Wdir *.mod" If [command] exits with error level 68, DMP terminates immediately. -X Inhibit all output. DMP writes absolutely nothing on the screen. Using default options --------------------- If you find yourself using the same options all the time you can make them default options by setting up a DMP evironment variable or including them into DMP.INI. For example, You always want to use quality mode and sampling rate of 22kHz and mono mode, put following line into your AUTOEXEC.BAT SET DMP=-q -s22 -m NOTE! You cannot override single letter options (-l,-o,-m,-q) with command line parameters. All other options can be overriden. Alternatively you can use the CmdLine parameter in DMP.INI for same purpose. Setting up your sound system ---------------------------- You may have to give your soundcard's IRQ number and/or port address if DMP fails to find them. If you don't provide both values then DMP will assume 220h for port address, and 7 for interrupt number. Giving wrong address will hang your machine, but wrong interrupt number only stops the playing after a second. The "-C" option is useful if you want to use some other card, than the one DMP automatically detects. Playing modules --------------- When you start DMP with a module name (or names) that has no extension DMP will try the default extensions defined in DMP.INI. If DMP finds a file with one of the extensions it will automatically load and play it. Automatic extensions feature doesn't work with wildcards, however. You can also build up play lists for DMP (with an external shell program for example). DMP reads this list file and scans each line for a module name. There should be only one file name per line but you can use wildcards. The name extension apply also for module names in play list. Example: DMP beyond *.NST @goodmods goodmods is a text file containing following lines: occ-san stars.mod intro3 DMP will play following modules: BEYOND.MOD, OCC-SAN.STM, STARS.MOD, INTRO3.MOD and all .NST-files in the current directory. Playing modules from archives ----------------------------- You can also play modules inside archives by specifying in DMP.INI how to extract files from the archive. DMP will then extract ALL the files in the archive to a temp directory and play them. Notice that DMP will also try to play non-module files, possibly leading to a crash or error message. The archive support in DMP is not very good or bulletproof, so be careful when using it. Using stereo DACs ----------------- If you have two DACs on LPT1 and LPT2 you can use them as one stereo source with following command line: DMP -c11 ... Note that you don't have to specify port address, DMP automatically reads the port addresses from BIOS data area. If you have a Stereo-on-1 DAC you can use it with following options: DMP -c12 -pXXX ... where XXX is the address of the DAC (LPT1 = 378) DMP configuration file DMP.INI ------------------------------ DMP has a config file called DMP.INI. It should be placed in the same directory with DMP.EXE but DMP will also find it if it's somewhere in the PATH. See the file itself for explanations on config switches and strings. DMP play screen and keys ------------------------ After DMP has loaded the first module and started to play it you see the playback screen. In this screen you can find a lot of information on the currently playing module, like the song name, how much memory is used by the module, where the player is currently playing etc. You also see channel specific information showing you the instrument name that is playing on that track and also other sound parameters. On the right are volume bars that give you an approximation of the sound volume on that track. Under the channel information is a list of instrument names. It is quite common that composers use this space for some messages instead of real instrument names. Pressing 'H' brings up a quick-help showing keys that control the program. Keys: P Pause module playback. Pressing any key resumes. 1-9,0 Turn track 1-9 on/off. 0 turns selected track on/off. S Set selected track to solo mode i.e. all other tracks are muted. Pressing 'S' again on the same track unmutes other channels. up/down Select a track. left/right Jump to previous/next pattern. F1-F10,+,- Set playback volume. [,] Decrease/increase speed (module tempo). {,} Decrease/increase module BPM tempo. L,M,R,U Set panning to full left/middle/right or surround. , . Pan to left/right F Turn SB Pro filter on/off. Default is off. V Select real/fake volume bars. Default is real. E Select digital effect (not available on GUS). Shows a menu where you can select the effect with up/down or with numbers 0-9 and X. N Stop playing current module and load next module. Z Switch between 25- and 50-row screen. D DOS shell (write 'EXIT' to get back to DMP) ESC Exit DMP. Technical information ===================== DMP uses software mixing routines to play up to 32 different digital sounds on one mono/stereo digital channel of your sound system. With Gravis Ultrasound, however, DMP uses the GUS onboard processor to do all the sound mixing. The software mixing routines are highly optimized assembly language and there are multiple routines to achieve best performance with any sound system. Quality mode ------------ Quality mode was orignally implemented only on 8-bit sounds cards to overcome the dynamic limitation of 8-bits. It uses 16-bit mixing routines to achieve 96dB dynamic range (instead of 48dB) and post processes the 16-bit data into 8-bits with a look-up table that amplifies the sound. Because of this post processing, the Quality mode takes more processor power but it's worth it. To further amplify the sound you can use '-Axx' command line option. For 16-bit cards there's no need to use Quality mode to improve the quality of the sound. But with up to 32 channels the dynamics of individual channels go worse i.e. the volume is lower. You can of course use '-Axx' to amplify the sound but there is always a risk of click and noise if the sound overruns. This is where 16-bit Quality mode comes in. It uses a temporary 32-bit buffer to do the mixing and post processes the buffer by clipping values that can't fit to 16-bits. Unlike 8-bit Quality mode, there is no default amplification in 16-bit Quality mode. To overcome this DMP uses an autogain feature that sets the amplification (like using '-Axx') to a level equal to a 4 channel music regardless of the channel count of the module. This way even 16+ channel modules still sound as loud and clear as normal 4 channel MODs. You can still use '-Axx' to further amplify the volume. Digital effects --------------- New to DMP 3.00 is the support for digital effects. Currently you can do reverb/echo style of effects and simple lowpass filtering. These effects are only available on sound systems where DMP does the mixing in software (i.e. the final sound data can be post processed), so you cannot use them with GUS. You can have up to 10 predefined effects (defined in DMP.INI) and select between them while playing by pressing 'E' or with command line parameter '-Fxx'. Filters You can use two different lowpass filters to filter the noise caused by aliasing in mixing routines. These filters are really simple so they don't use much processor power. Filter 1 algorithm is defined as: y(n) = 0.5*x(n) + 0.5*x(n-1) Filter 2 is: y(n) = 0.75*x(n) + 0.25*x(n-1) Of course the actual filter routines use simple additions and shifts instead of floating point multiplications to achieve best possible speed. See DMP.INI how to use these filters. By default DMP uses the Filter 2 (this can be changed in DMP.INI or with '-Fxx' command line parameter). Reverb/echo effects DMP uses a user definable reverb/echo engine to create effects from massive reverbs to funny sounding echos. Here is the diagram of that engine. ÚÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄ¿ ³InputÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄ´ ³ ÚÄÄÄÄÄÄ¿ ÀÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄ¿ ³ ³ Filter ÃÄÄÄÄÄÄÄÄÄÄ´Output³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄijÄÄ´ ³ ÀÄÄÄÄÄÄÙ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ´ Filter ³ ³ ÀÄÄÄÄÄÄÄÄÙ ³ ³ ÚÄÄÄÄÄÄÄ´ ÃÄ¿ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ -----³ ³ ³ ³ feedback\ G /³ G = gain "echos"³ ³ ³ \_/ ³ / \ / \ / \ ³ ³ D = delay / G1\ / G2\ / G3\ ³ ³ ----- ----- ----- ³ ³ ³ ³ ³ ÚÁÄÄÁ¿ ³ ³ ³ ³ + ³ ³ ³ ³ ÀÄÄÂÄÙ ³ ³ ³ ³ ³ ³ ³ ³ D1 ³ D2 ³ D3 ³ ³ ÚÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ÚÄ´ delay line ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The number of echos can be from one to eight and each has its own position on the delay line and its own gain value. You can change the number of echos and paramters for each echo in DMP.INI [DigitalEffects] section. You can also set the "feedback" value. You can also use negative gain values to create a 180 degree phase shift. The filters used in reverb are the same as in filter 1. Setting a reverb in DMP.INI looks like following: Effect1 = R ... See DMP.INI for examples on reverbs and echos. Reverb performance Calculating one echo in reverb engine requires a few simple arithmetic instructions and one multiplication. In addition calculating feedback requires another multiplication. So with a 6 echo reverb the routine must do seven multiplications and lots of simple instructions for EACH AND EVERY SAMPLE from input. In comparison the mixing routines in the actual sample playback engine require only a few simple instructions per sample. Unless you have a powerful 486 it's not wise to use stereo mode because this doubles the reverb overhead. Even on a 486/33 using reverb with 44kHz stereo data can bring the machine on its knees. On slower machines you will start to hear the playback buffer repeating as DMP can't keep up with sound card DMA. Using simple echos requires a lot less processor computing power, it's all dependant on the number of echos. Contacting the author ===================== If you have suggestions/questions/problems about DMP, feel free to contact the author. Email is preferred. Mail address: Otto Chrons Vaajakatu 5 K 199 FIN-33720 TAMPERE FINLAND Internet e-mail: otto.chrons@cc.tut.fi Getting new versions of DMP --------------------------- Newest version is always available at: BBS: ---- R.A. LAW +358-37-5849007 19.2ZyX, v32bis Internet FTP: ------------- ftp.eng.ufl.edu /pub/msdos/demos/music/pplayers For a distribution site near you, check out SUPPORT.DMP. See DMP.REV for revision history.