Dec 232017
 
TP5.0 unit for playing CMF files in background.
File CMFUNIT.ZIP from The Programmer’s Corner in
Category Pascal Source Code
TP5.0 unit for playing CMF files in background.
File Name File Size Zip Size Zip Type
ACTION.CMF 17358 2266 deflated
CMFUNIT.DOC 3486 1579 deflated
CMFUNIT.TPU 4000 1787 deflated
PLAYCMF.PAS 130 123 deflated

Download File CMFUNIT.ZIP Here

Contents of the CMFUNIT.DOC file


CMFUnit is a background CMF player for Turbo Pascal 5.0+. If your running
TP 7.0, this unit is considered 'obsolete' and you're screwed: But blame that
on Borland, not me.

PROCEDURES:

In order for any of the procedures listed below to operate, the Creative
Labs SBFM driver MUST be installed. This driver should come with
Soundblaster, Soundblaster Pro, and any other FULLY compatable sound card.
Ofcourse, of all the sound cards that claim '100% compatability', none
have had a compatible driver. So much for that, huh?
If you do not have this driver, the try mooching it off somebody who
has an SB or SB Pro. Heck, it's only 5k.

PlaySong(Name:String);
Searches for the specified file in the CMFPATH directory. By default,
this is the current directory. No extension need be specified. The
procedure will return while the song is playing. The CMFStatus variable
is set when this procedure returns. NOTE: Be sure there is enough
unallocated heap memory to load the file. To do this, use the $M
compiler directive.

PlayMem(Head:CMFHeader;CMFIns,CMFSong:pointer);
Plays a song already loaded into memory. This is useful for music
creation programs which construct the CMF file in memory. The CMFHeader
type is defined below. The CMFStatus variable is set upon return.
NOTE: Be sure there is enough unallocated heap memory to load the file.
To do this, use the $M compiler directive.

Transpose(steps:ShortInt);
This function transposes the notes of the song by the number of half steps
specified. This function should be called immediately after PlaySong, and
will not work if called before. (Don't worry, the notes will be changed
before the sound even reaches the speakers)

Stop;
Stops playback of the song and decays any active instruments.

Pause;
Pauses the song.

Continue;
Continues after a pause. Will not work after Stop is called.

OTHER STUFF:
CMFHeader =
Record
ID : Array[1..4] of Char;
Ver,
InsOfs,
MusOfs,
TperQ,
TperS,
Title,
Name,
Remarks : Word;
Channels: Array[0..15] of Byte;
NumIns,
Tempo : Word;
End;
The CMFHeader type defines the header located at the the start of the
CMF file. You will not need to use this, however it is provided here
to aid in song editors, and to use with the PlayMem procedure.

CMFPath : String[60];
The CMFPath string contains the directory to search for the CMF files.
The string starts out empty. If you change the string, be sure to
include the ending slash. Ex.
CMFPath:='C:\SB\CMFSONGS\'; Correct
CMFPath:='C:\SB\CMFSONGS'; Incorrect

CMFStatus : Word;
This word is nonzero during the playback of the song.

CMFInt : Byte;
This is the interrupt that the Creative Labs SBFM driver is installed
on. It is auto-detected at start up.

If you need tgo contact me, or have some overwhelming urge to send me a large
sum of money(,or even a small one,) I may have an similar overwhelming urge
to send you the source code. I can be reached at:

William Garrison BTW- No, I am not on the Internet, so TUFF COOKIES!
3625 Double Rock Lane
Baltimore, MD 21234

Party On Dudes.
END OF LINE


 December 23, 2017  Add comments

Leave a Reply