VOGONS


First post, by pavel

User metadata
Rank Newbie
Rank
Newbie

Hi, guys!

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

I've looked at hundreds of sites, old FTP-servers and BBS archives. And all i could find is SDK 2.0, more older SBK with the SMF support and also SDK for CMS.

I'm very surprised because a lot of old game developers used this SDK (SBK) to implement the music support in their projects.

Yes, i know about this topic on the forum.

So, newer SDK 2.0 hasn't functions to play CMF files at all. Newer manual prescribes to convert it into MIDI before using in a programm.

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

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

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

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

The 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 was used by GameMaker software.

Finally, i've found the link in this forum on the official SBDEVKIT here manual with proper description, but no link to libraries

According to manual i've found, SBK distributed on the diskettes with the 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, it will be very nice if our dear members of the forum will help to find the floppy images of that SDK (SBK). But any information will be useful as well. As we can see this framework was very popular among the game programmers, but all of i can find is the manual and some Chinese forum with a little pieces of examples. So, i would be very greatful if someone will help me with my search.

Last edited by pavel on 2021-10-18, 17:40. Edited 2 times in total.

Reply 1 of 10, 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
64 downloads
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 modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 2 of 10, 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
71 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 modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 3 of 10, 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
102 downloads
File license
Fair use/fair dealing exception

- posted in other thread

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

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

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 4 of 10, 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 10, 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
1212 views
File license
Public domain
contents.jpg
Filename
contents.jpg
File size
256.35 KiB
Views
1212 views
File license
Public domain

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

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 6 of 10, 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 10, 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

Reply 8 of 10, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++

Got the SBK today and the disks read just fine.

The_Developer_Kit_for_SB_v1.jpg
Filename
The_Developer_Kit_for_SB_v1.jpg
File size
125.09 KiB
Views
1123 views
File license
Public domain

I put the disk images and the files themselves in a single zip:

Filename
The_Developer_Kit_For_Sound_Blaster_Series_v1.zip
File size
944.11 KiB
Downloads
128 downloads
File license
Fair use/fair dealing exception

I'll put together a package with everything and upload to vogonsdrivers.com, archive.org and maybe some other places when I get a chance.

I still haven't heard back from that other seller who has the used SBK manual... their eBay store is currently on vacation.

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 9 of 10, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++

Just a small update. Months ago the seller that had the SBK manual got back to me and I purchased it from them. I still don't have a document scanner though and I don't really want to destroy it scan it.

I want to eventually build a non-destructive scanner that uses 2 P&S digital cameras. There is already software out there that combines all the scans/pics into a PDF I think. I actually haven't looked into it that much since I don't currently have the space to hold one if I did build it.

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 10 of 10, by pavel

User metadata
Rank Newbie
Rank
Newbie
cyclone3d wrote on 2021-03-26, 23:35:

Just a small update. Months ago the seller that had the SBK manual got back to me and I purchased it from them. I still don't have a document scanner though and I don't really want to destroy it scan it.

Wow! Thank you for your great work. That's totally awesome that you did!
Last summer i've implemented the functions signatures from object file of this SBK in IDA disassembler. So, F.L.I.R.T. could recognize the standard functions from this SBK in disassembled binaries now. I will show the result a little bit later because i've leaved it on the PC at my country house.