
From mwc!utrix!jim Wed Oct 26 09:12:32 1994
Return-Path: <mwc!utrix!jim>
Received: from mwc by lepanto.mwc.com with uucp
	(Smail3.1.28.1 #3) id m0r0A1g-0001zIC; Wed, 26 Oct 94 09:12 CST
Received: by mwc.com (smail2.5.3-coh) id AA16197; 26 Oct 94 14:56:54 GMT (Wed)
Received: by utrix.mwc.com (Smail3.1.28.1 #3)
	id m0r09nY-0000jdC; Wed, 26 Oct 94 08:57 CST
Message-Id: <9410260957.AA231.V1.5@utrix.mwc.com>
Date: 26 Oct 94 09:57:56
From: jim@utrix.mwc.com (Jim Leonard)
To: fred@mwc.com, hal@mcs.com
(Fred:  This document is quasi-technical, so feel free to edit towards
Status: RO

the more or less technically-inclined as you see fit.

Sound Data:  PCM
~~~~~~~~~~~~~~~~

Most sound cards accept data in one standard format:  PCM, or Pulse Code
Modulation.  The format of the sound data is always the same--it mimics
the actual waveform, with 0 and 255 being the edges of the waveform
(values near the edges produce the loudest sounds), and 127 being the
middle line (silence).   If plotted, it looks like this:


byte (char)
value

255  | 
     |        *****                                  **
     |     ***     ***                            ***
     |   **           **                        **
127  |-**---------------**-------------------***-------
     |                    **             ****
     |                      ***      ****
     |                         ******
0    |_________________________________________________
				time


Most sound file formats are usually this raw data, plus some header
information that describes specific information about the sound data.
For instance, most file formats allow for the following information:

	- whether each sample is 8 or 16 bits long (16-bit samples look
	like the above chart, but the middle line is 32767 and the
	extremes are 0 and 65535.  Also, 16-bit sound takes up twice
	the space, but has improved quality.)
	
	- whether the file is mono or stereo sound (if stereo, each 
	even sample is the left channel, and each odd sample is the
	right channel)

	- what frequency the sound data is played at (how many samples
	per second; common values are 11025, 22050, and 44100 Hz)

	- artist/composer information, title of the sound, and other
	misc. information

Here's some basic information on the most common sound file formats on
the PC:

WAV:	Microsoft RIFF  (Also known as "wave files".)  The format can 
support 8 or 16-bit PCM data, in mono or stereo.   Versatle format;
became popular with the advent of Windows 3.1, which came with
multimedia extensions that made it easy to have sound in your
applications.

VOC:	Creative Lab's Voice file.  Holds mono or stereo, 8 or 16 bit
data, but since the Creative's most popular sound card is the mono,
8-bit Sound Blaster, most VOC files are 8-bit mono sound.

IFF:	Amiga's most common file format (can hold graphics and text as
well).  8-bit mono only, and uses signed char's that have 0 the middle
line, and -128 and 127 as the extremeties.

Here are the most common music file formats:

MID:	MIDI file (Musical Instrument Digital Interface).  MIDI is the
industry standard format of computer-assisted composing, and also
transferring music from one artist/studio to another.  MIDI allows for
24 channels, with several simultaneous notes (chords) on the same
channel; channels are usually used to denote different instruments.  The
only drawback to MIDI is that the instruments are indicated by numbers,
which are different from instrument to instrument.  The "General MIDI"
standard is an effort to standardize this, with all of the instrument
numbers refering to the same instruments on different synthesizers.  For
instance, instrument #1 is always a piano, #2 is always a flute, etc.
Also, MIDI channel #10 is always percussion.  This standard makes it
much easier to have the song sounding the same on many different
platforms.

MOD:	A MOD file (and its variants) has 4 to 8 channels, and
contains both the music data and sampled instruemnts (small sound
recordings of the instrument playing one note, which is then played
higher or lower to simulate the instrument).  This ensures that the song
sounds exactly the same from platform to platform.  There are three
drawbacks to this format, however:  

	- The note structures are not flexible (notes are not
	event driven, but organized into a 4/4 time signature).

	- The composing programs used to create MOD files usually do not
	allow for MIDI keyboard input; most input is via the computer
	keyboard (this is changing, however).

	- Sound output devices that do not allow multiple digital channel 
	output (like the popular Sound Blaster series) must call on the
	CPU to "mix" the multiple channels into one output, which is
	then fed to the sound device.  This takes up CPU time.


From mwc!utrix!jim Wed Oct 26 09:12:33 1994
Return-Path: <mwc!utrix!jim>
Received: from mwc by lepanto.mwc.com with uucp
	(Smail3.1.28.1 #3) id m0r0A1g-000257C; Wed, 26 Oct 94 09:12 CST
Received: by mwc.com (smail2.5.3-coh) id AA16204; 26 Oct 94 14:56:57 GMT (Wed)
Received: by utrix.mwc.com (Smail3.1.28.1 #3)
	id m0r09oU-0001PfC; Wed, 26 Oct 94 08:58 CST
Message-Id: <9410260958.AA243.V1.5@utrix.mwc.com>
Date: 26 Oct 94 09:58:54
From: jim@utrix.mwc.com (Jim Leonard)
To: fred@mwc.com, hal@mcs.com
Subject:  Revised sound formats
Status: RO

(Fred:  This document is quasi-technical, so feel free to edit towards
the more or less technically-inclined as you see fit.  I modified it 
a bit from the last version.  Also, I don't know how you'll duplicate
the chart I did below, but it sure was a bitch in vi!  :-)

Sound Data:  PCM
~~~~~~~~~~~~~~~~

Most sound cards accept data in one standard format:  PCM, or Pulse Code
Modulation.  The format of the sound data is always the same--it mimics
the actual waveform, with 0 and 255 being the edges of the waveform
(values near the edges produce the loudest sounds), and 127 being the
middle line (silence).   If plotted, it looks like this:


byte (char)
value

255  | 
     |        *****                                  **
     |     ***     ***                            ***
     |   **           **                        **
127  |-**---------------**-------------------***-------
     |                    **             ****
     |                      ***      ****
     |                         ******
0    |_________________________________________________
				time


Most sound file formats are usually this raw data, plus some header
information that describes specific information about the sound data.
For instance, most file formats allow for the following information:

	- whether each sample is 8 or 16 bits long (16-bit samples look
	like the above chart, but the middle line is 32767 and the
	extremes are 0 and 65535.  Also, 16-bit sound takes up twice
	the space, but has improved quality.)
	
	- whether the file is mono or stereo sound (if stereo, each 
	even sample is the left channel, and each odd sample is the
	right channel)

	- what frequency the sound data is played at (how many samples
	per second; common values are 11025, 22050, and 44100 Hz)

	- artist/composer information, title of the sound, and other
	misc. information

Here's some basic information on the most common sound file formats on
the PC:

WAV:	Microsoft RIFF  (Also known as "wave files".)  The format can 
support 8 or 16-bit PCM data, in mono or stereo.   Versatle format;
became popular with the advent of Windows 3.1, which came with
multimedia extensions that made it easy to have sound in your
applications.

VOC:	Creative Lab's Voice file.  Holds mono or stereo, 8 or 16 bit
data, but since the Creative's most popular sound card is the mono,
8-bit Sound Blaster, most VOC files are 8-bit mono sound.

IFF:	Amiga's most common file format (can hold graphics and text as
well).  8-bit mono only, and uses signed char's that have 0 the middle
line, and -128 and 127 as the extremeties.

Here are the most common music file formats:

MID:	MIDI file (Musical Instrument Digital Interface).  MIDI is the
industry standard format of computer-assisted composing, and also
transferring music from one artist/studio to another.  MIDI allows for
24 channels, with several simultaneous notes (chords) on the same
channel; channels are usually used to denote different instruments.  The
only drawback to MIDI is that the instruments are indicated by numbers,
which are different from instrument to instrument.  The "General MIDI"
standard is an effort to standardize this, with all of the instrument
numbers refering to the same instruments on different synthesizers.  For
instance, instrument #1 is always a piano, #2 is always a flute, etc.
Also, MIDI channel #10 is always percussion.  This standard makes it
much easier to have the song sounding the same on many different
platforms.

MOD:	A MOD file (and its variants) has 4 to 8 channels, and
contains both the music data and sampled instruemnts (small sound
recordings of the instrument playing one note, which is then played
higher or lower to simulate the instrument).  This ensures that the song
sounds exactly the same from platform to platform.  There are three
drawbacks to this format, however:  

	- The note structures are not flexible (notes are not
	event driven, but organized into a 4/4 time signature).

	- The composing programs used to create MOD files usually do not
	allow for MIDI keyboard input; most input is via the computer
	keyboard (this is changing, however).

	- Sound output devices that do not allow multiple digital channel 
	output (like the popular Sound Blaster series) must call on the
	CPU to "mix" the multiple channels into one output, which is
	then fed to the sound device.  This takes up CPU time.

