VOGONS


First post, by pavel

User metadata
Rank Newbie
Rank
Newbie

Hi, guys!

I'm trying to reverse-engineering some old formats of FM-music in old games and would like to research one program that uses quite old Sound Blaster SDK that allows to play CMF-files by SBFMDRV.COM.

I'm looked at hundreds of sites, old FTP-servers and BBS archives, but could only find SDK 2.0, more older SBK with SMF support and SDK for CMS.

I'm very surprised because a lot of old game developers used that SDK (SBK) to implement music support.

Yes, i know about this topic on the forum.

So, newer SDK 2.0 hasn't functions to playing CMF files at all and its manual prescribes to convert it to MIDI before use in program.

There is a very old SBDEVKIT that allows to work only with SMFs (Standard Midi File). So, it's different.

I found also QB_SBKIT that has examples and SDK that i need, but it's for Basic. I need the same but for Turbo C.

I found only the book in Chinese with some examples of using the SDK that i'm looking for and source code of official sample DEMOFM.C here. I didn't found that file anywhere else. According to book this SDK called "SBK".

The SDK that i'm looking for has at least files following below:
SBCMUSIC.H
SBC.H
SBCn.LIB where N is type of memory model.

File SBCL.LIB consists CMF routines and has copyright string inside:

FM-Music Functions, Copyright (c) Creative Technology Pte Ltd, 1990.  All rights reserved.

The SDK provides following functions:

Low- and high-level

Reference for SBFM High Level Functions
sbfm_init
sbfm_version
sbfm_instrument
sbfm_sys_speed
sbfm_song_speed
sbfm_transpose
sbfm_play_music
sbfm_stop_music
sbfm_pause_music
sbfm_resume_music
sbfm_read_status
sbfm_reset
sbfm_terminate

SBFM Low Level Functions:
sbfd_init
sbfd_instrument
sbfd_note_on
sbfd_note_off
sbfd_program_change
sbfd_music_off
sbfd_setmode
sbfd_reset

The SDK used by GameMaker software.

Finally, i could find on this forum the link on official SBDEVKIT here with proper description, but no link to the kit that i need.

According to found manual, SBK distributed on the diskettes with following directory structure:

Disk contents

The diskettes are organized into 5 sub-directories:

\BIN : executable utilities and drivers
\CMF : sample CMF files
\QBASIC : include files, quick libraries and example programs
for QuickBasic and Basic PDS 7.0
\MSC : include files and libraries for Microsoft C and
Turbo C. Example programs for Microsoft C
\TPASCAL : include files, Turbo Pascal Unit (TPU) and examples
program for Turbo Pascal

So, the ideally if dear members of forum will help to find the floppy images of that SDK (SBK), but any information will be useful. As we can see this framework was very popular among game programmers, but all of i can find is manual and some Chinese forum with example. So, i would be very greatful if someone will help me with my search.

Last edited by pavel on 2020-05-23, 14:57. Edited 1 time in total.

Reply 1 of 7, by cyclone3d

User metadata
Rank l33t
Rank
l33t

I was thinking.. hey, I might have that and then went to the forum post you linked and realized I had posted almost everything I had found before.

And now I have the QB_SBKIT as well.... which really could be converted to Turbo C.. if I had the time to do so.

Anyway, I will look for the other files and see if I can find them. In the meantime, here is some info on CMF I found at some point:

Filename
cmf_form.txt
File size
3.63 KiB
Downloads
1 download
File license
Public domain
Date: Wed, 9 Mar 94 16:14:20 PST
From: awiggins@sdcc5.UCSD.EDU (Adam Wiggins)
Subject: Re: Need CMF format
Newsgroups: rec.games.programmer

> I need the format of CMF files, particularly the FM instruments part.
>Thanks in advance.

CMF consists of 3 different block structures: header block, instrument block
and a music block.

Header Block.

Offset Description

00-03 File ID'CTMF'
04-05 Version # (currently 1.10)
06-07 Offset of instrument block from start of file
08-09 Offset of music block from start of file
0A-0B Ticks per quarter note (default=120)
0C-0D Clock ticks per second (default=96)
0E-0F Offset of music title from start of file (0=none)
10-11 Offset of composer name (0=none)
12-13 Offset of remarks (0=none)
14-23 Channel-in-use table (16 bytes long)
24-25 # of instruments used
26-27 Basic tempo
28- Title, composer and/or remarks


Instrument Block

Each instrument block is 16 bytes long.

Offset Description

00 Modulator characteristic
01 Carrier characteristic
bit 7 Pitch Vibrato
6 Amplitude Vibrato
5 Sustaining Sound
4 Envelope Scaling
3-0 Frequency Multiplier
02 Modulator Scaling/Output Level
03 Carrier Scaling/Output Level
bit 7-6 Level Scaling
5-0 Output Level
04 Modulator Attack/Delay
05 Carrier Attack/Delay
bit 7-4 Attack Rate
3-0 Delay Rate
06 Modulator Sustain Level/Release Rate
07 Carrier Sustain Level/Release Rate
bit 7-4 Sustain Level
3-0 Release Rate
08 Modulator Wave Select
09 Carrier Wave Select
bit 7-2 (all cleared)
0-1 Wave Select
0A Feedback/Connection
Show last 49 lines
                   bit 7-4 (cleared)
3-1 Modulator Feedback
0 Connection
0B-0F Not used (Reserved)


Music Block

The music block is single track, polyphonic, with a max of 16 channels.
It adheres to the Standard Midi File format. It is like:

Music block = <delta time> <Midi event> <delta time> <Midi event>...

where: Delta time = amount of time before Midi event (in ticks)

Midi event = any Midi channel message

Here is where the book gets foggy. Some Midi events are Control Change events
but it doesn't say if all are like that. These are the only ones discussed:

Control Number Control Data
66h 1-127 (Used as markers in music)
67h 0-Melody mode
1-Rhythm mode

I don't know of the 0 or 1 are bits or follow the Control Number but it
appears that there will be a 66h then a number between 1 and 127
designating seminote length (1 seminote = 1/128 of a tick or something)
or a 67h and a 0 or 1 to determine the mode. In Rhythm mode, the last
5 channels are:

Channel Rhythm
12 Bass Drum
13 Snare
14 Tom-tom
15 Top-cymbal
16 High-hat

Control Number Control Data
68h 0-127 (Changes pitch upward by the # of 1/128 seminotes.
0=Cancel pitch change)

69h 0-127 (Changes pitch downward by the # of 1/128
seminotes. 0=Cancel pitch change)


Sorry about the ^M's.

...Boone

Yamaha YMF modified setupds and drivers
Yamaha XG resource repository - updated November 27, 2018
Yamaha YMF7x4 Guide
AW744L II - YMF744 - AOpen Cobra Sound Card - Install SB-Link Header
Epstein didn't kill himself

Reply 2 of 7, by cyclone3d

User metadata
Rank l33t
Rank
l33t

Here is some CMF Pascal code from a book called "Werken met de SB" (that is, "Working with the Sound Blaster"):

Filename
midicmf.zip
File size
3.8 KiB
Downloads
2 downloads
File license
Public domain

Edit:

I dug around in the github repository and the files you are looking for are here.. or are there other files you need as well?
https://github.com/gandrewstone/GameMaker/tre … /master/code/GM

I also have a book titled: The Sound Blaster Book by Josha Minnik and Eric Oostendorp - ISBN 0-7821-1320-6
Pages 129-147 detail the CMF file format, how to play, and also has Pascal examples. There are some more code samples on page 416-436.

Another book titled: The Sound Blaster Book by Alex Stolz - ISBN 1-55755-181-2
This book has CMF information and examples on pages 260-307.

I'll get that scanned and uploaded if you want.

I've got another newer book titled: The Ultimate Sound Blaster Book by Martin L. Moore - ISBN 1-56529-298-7
It says this on page 114 about CMF:

The original Sound Blaster file format, no longer
supported by Creative Labs. CMF files rely on the
availability of the C/MS chip set used in the original
Game Blaster and Sound Blaster V1.0 cards.

Then, on pages 373-376 it details the CMF file format that the above 2 books do as well.

Is that statement about having to have the CM/S chips even correct?

Yamaha YMF modified setupds and drivers
Yamaha XG resource repository - updated November 27, 2018
Yamaha YMF7x4 Guide
AW744L II - YMF744 - AOpen Cobra Sound Card - Install SB-Link Header
Epstein didn't kill himself

Reply 3 of 7, by cyclone3d

User metadata
Rank l33t
Rank
l33t

Found another copy of at least part of the one Developer's Kit disks. They at least have all the SBCn.LIB files and the documentation for them.
They also have DETECTn.LIB files and documentation.

I posted the one in that other thread:

Filename
SBD.ZIP
File size
320.14 KiB
Downloads
3 downloads
File license
Fair use/fair dealing exception

- posted in other thread

Filename
SB_DEV.ZIP
File size
214.02 KiB
Downloads
2 downloads
File license
Fair use/fair dealing exception

- found at http://www.retroarchive.org/cdrom/nightowl-00 … 044A/index.html

Yamaha YMF modified setupds and drivers
Yamaha XG resource repository - updated November 27, 2018
Yamaha YMF7x4 Guide
AW744L II - YMF744 - AOpen Cobra Sound Card - Install SB-Link Header
Epstein didn't kill himself

Reply 4 of 7, by pavel

User metadata
Rank Newbie
Rank
Newbie

Thank you very much!

I know about all of these kits and i know CMF format structure. So, it's not the same what i'm looking for. 😀

cyclone3d wrote on 2020-05-17, 02:42:

And now I have the QB_SBKIT as well.... which really could be converted to Turbo C.. if I had the time to do so.

Yes, but it takes some time and i know there is an official kit with Turbo C examples but i can't find. So, It's interesting to have it in collection.

cyclone3d wrote on 2020-05-17, 03:43:

Here is some CMF Pascal code from a book called "Werken met de SB" (that is, "Working with the Sound Blaster"):
midicmf.zip

Thanks, interesting example. Worth it can play without driver.

cyclone3d wrote on 2020-05-17, 03:43:

I dug around in the github repository and the files you are looking for are here.. or are there other files you need as well?
https://github.com/gandrewstone/GameMaker/tre … /master/code/GM

Yes, interesting to see full sb-kit with all libs for all memory models and with demo sources. I observed the repository very precisely as i told before and it helped me, but official SDK could be better.

cyclone3d wrote on 2020-05-17, 03:43:
I also have a book titled: The Sound Blaster Book by Josha Minnik and Eric Oostendorp - ISBN 0-7821-1320-6 Pages 129-147 detail […]
Show full quote

I also have a book titled: The Sound Blaster Book by Josha Minnik and Eric Oostendorp - ISBN 0-7821-1320-6
Pages 129-147 detail the CMF file format, how to play, and also has Pascal examples. There are some more code samples on page 416-436.

Another book titled: The Sound Blaster Book by Alex Stolz - ISBN 1-55755-181-2
This book has CMF information and examples on pages 260-307.

I'll get that scanned and uploaded if you want.

I have the first book in PDF. About second one i'm also know. Thank you so much for help. Actually, i'm more interested not about how to program CMF. I'm interested how the linker composed the application binary and external official Sound Blaster libs. So, i need official SDK.

cyclone3d wrote on 2020-05-17, 03:43:

Is that statement about having to have the CM/S chips even correct?

Not sure, because your documentation (SBDEVKIT.ZIP) from here is official for Sound Blaster and it has a lot of references to CMF format. It seems this manual delivered with libraries that i'm looking for. I think it came after CMS libs but before SBK 2.0.

cyclone3d wrote on 2020-05-17, 06:25:
Found another copy of at least part of the one Developer's Kit disks. They at least have all the SBCn.LIB files and the document […]
Show full quote

Found another copy of at least part of the one Developer's Kit disks. They at least have all the SBCn.LIB files and the documentation for them.

I posted the one in that other thread:
SBD.ZIP - posted in other thread
SB_DEV.ZIP - found at http://www.retroarchive.org/cdrom/nightowl-00 … 044A/index.html

Yes, i know about it. Both archives issued in 1989 and consist only Standard Midi File (SMF) player example. Seems it's substituted by CMF after.

The last official version 2.0 of Sound Blaster SDK issued in 1996, but no longer support CMF anymore because it substituded by classical MIDI format.

So, i'm looking for official Sound Blaster SDK issued between 1990 and 1995. Nothing have found in the Internet but it's widespread in software of that time. For now we've found only manual of it and it's already posted on forum.

So, many thanks cyclone3d for help! I think if we could can find this, it will be good not only for understanding past software architectures, but for historical reasons as well.

Last edited by pavel on 2020-05-23, 14:51. Edited 2 times in total.

Reply 5 of 7, by cyclone3d

User metadata
Rank l33t
Rank
l33t

You will never believe what I found and now have on the way. Paid a pretty penny for it but didn't want to pass up the chance and probably never see it again:

box.jpg
Filename
box.jpg
File size
179.31 KiB
Views
84 views
File license
Public domain
contents.jpg
Filename
contents.jpg
File size
256.35 KiB
Views
84 views
File license
Public domain

It will probably take about a week or so to get here... hopefully sooner.

Yamaha YMF modified setupds and drivers
Yamaha XG resource repository - updated November 27, 2018
Yamaha YMF7x4 Guide
AW744L II - YMF744 - AOpen Cobra Sound Card - Install SB-Link Header
Epstein didn't kill himself

Reply 6 of 7, by pavel

User metadata
Rank Newbie
Rank
Newbie

Wow! So cool! Seems this is what we are looking for! 😀 Will pray that diskettes are in good condition and you can take 100% images of them!

Thank you very much for your help! So, if you need some compensation of your investments to this gem, let me know.

Reply 7 of 7, by Stiletto

User metadata
Rank l33t
Rank
l33t

Gotta say, I'm really surprised Cloudschatze or MobyGamer hasn't turned up to say "oh hey I made a scan of that manual and images of the disks back in 2010, here's the link." They tend to collect stuff such as this.. 😉

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto