MODUS - Mod Player for the Ultrasound V0.1 ----------------------------------------- NOTICE: playing mods and working on important projects at the same time may be hazardous to your data. This is a beta program with known bugs. Their is a high possibility of the program causing you to have to reboot, so beware. This is the first release of the MODUS player, and as such it has a couple of problems. The main problem is the conflict with the ultrasnd.drv ultrasound windows drivers. You won't hear any midi or wav sound after playing a mod. Playing the windows exit wav also causes windows not to be able to exit. However, the player itself is pretty stable. MODUSPLY.EXE the MODUS module player was written by Benjamin Cooley (C) 1993, the GUSPLAY.DLL was converted from source code released by Robert Adolfson of CASCADA (C) 1993 (Much thanks for the code). GUSPLAY.DLL functions... Here is a description of the funcions available in the GUSPLAY.DLL library. You can access the functions in the .DLL via LoadLibrary() and GetProcAddress(), or you can create an import library (see your c compiler reference) which will automatically link the functions below into your program. Function descriptions: BOOL FAR PASCAL MODInit(void) Initializes the MOD player. Returns FALSE if couldn't initialize. void FAR PASCAL MODFree(void) Frees all resource allocated by the MOD player. BOOL FAR PASCAL MODLoad(LPSTR lpstrFileName) Loads a MOD file. Returns FALSE if failed. void FAR PASCAL MODPlay(); Plays the loaded file void FAR PASCAL MODStop(); Stops playing and resets the position to the start. void FAR PASCAL MODPause(); Pauses play. void FAR PASCAL MODResume(); Resumes play. void FAR PASCAL MODClear(); Clears the current MOD from memory. WORD FAR PASCAL MODLength(); Returns the length (in patterns) of the current MOD. int FAR PASCAL MODMode(); Returns the play mode for the MOD. MODE_NOT_READY 0 MODE_STOP 1 MODE_PLAY 2 MODE_PAUSE 3 WORD FAR PASCAL MODLength(); Returns the length (in patterns) of the current MOD. int FAR PASCAL MODCurrentPattern(void); Returns the current pattern the MOD is playing 1..end. int FAR PASCAL MODCurrentRow(void); Returns the row in the current pattern being played 1..64 int FAR PASCAL MODVolume(); Returns the current play volume 0..64 void FAR PASCAL MODSetPattern(WORD wNewPattern); Sets the pattern being played to wNewPattern. Sorry, can't set rows because it ends up sounding like garbage. void FAR PASCAL MODSetVolume(WORD wNewVolume); Sets the volume to wNewVolume 0..64 LPVOID FAR PASCAL MODInfo(void); Returns a pointer to the MOD file data sans the samples at the end. int FAR PASCAL MODNumChannels(void); Returns the number of channels this MOD uses. Can be 4, 6, or 8. WORD FAR PASCAL MODChannelOn(void) Returns a bit map of the channels currently enabled for playing.. bit 0 is channel 1, bit 7 is channel 8. void FAR PASCAL MODSetChannelOn(WORD wNewChannelOn); Sets the channels specified by wNewChannelOn on or off. Bit 0 is channel 1, bit 7 is channel 8. void FAR PASCAL MODSetCallBack(HWND hCallbackWnd, WORD wCallbackMsg); Tells the MOD library to send the message specified by wCallbackMsg to the window hCallbackWnd every time a row is played or a command is executed in the MOD player. The window may then update its display to show what's happening. The wCallbackMsg should be a user defined message (i.e. WM_USER + 101). The wParam parameter returns the message type, and the lParam parameter returns a data structure describing the state of the MOD player. wParam - Type: MODMSG_REC 1 - Sent when a mod record is played (every beat of song) MODMSG_LOAD 2 - Sent when a file is loaded MODMSG_PLAY 3 - Sent when a file is played MODMSG_PAUSE 4 - Sent when the MOD is paused MODMSG_RESUME 5 - Sent when the MOD is resumed MODMSG_STOP - Sent when the MOD is stopped MODMSG_CLEAR - Sent when the MOD is cleared MODMSG_VOLCHANGE - Sent when the volume is changed MODMSG_POSCHANGE - Sent when the position is changed by the user not the mod MODMSG_CHANCHANGE - Sent when the channel play status is changed MODMSG_SONGDONE - Sent when the curent song is done playing lParam - MODRECINFO structure typedef tagMODRECINFO { WORD wPlayMode; // Current Play Mode WORD wCurrentPattern; // Current pattern playing WORD wPatternPos; // Position in the song from beginning 1..end WORD wRowPos; // Current row position 1..64 WORD wNotePlayed; // Bit map of notes played for all tracks BYTE bPatches[8]; // Patch numbers of notes played } MODRECINFO; Sorry about the bugs.. enjoy.