home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
utilities
/
utilsf
/
ifftext
/
8SVX
next >
Wrap
Text File
|
1993-06-24
|
28KB
|
667 lines
"8SVX" IFF 8-Bit Sampled Voice
Date: February 7, 1985
From: Steve Hayes and Jerry Morrison, Electronic Arts
Status: Adopted
1. Introduction
This memo is the IFF supplement for FORM "8SVX". An 8SVX is an IFF
"data section" or "FORM" (which can be an IFF file or a part of one)
containing a digitally sampled audio voice consisting of 8-bit samples.
A voice can be a one-shot sound orQwith repetition and pitch scalingQa
musical instrument. "EA IFF 85" is Electronic Arts' standard interchange
file format. [See "EA IFF 85" Standard for Interchange Format Files.]
The 8SVX format is designed for playback hardware that uses 8-bit
samples attenuated by a volume control for good overall signal-to-noise
ratio. So a FORM 8SVX stores 8-bit samples and a volume level.
A similar data format (or two) will be needed for higher resolution
samples (typically 12 or 16 bits). Properly converting a high resolution
sample down to 8 bits requires one pass over the data to find the
minimum and maximum values and a second pass to scale each sample
into the range -128 through 127. So it's reasonable to store higher
resolution data in a different FORM type and convert between them.
For instruments, FORM 8SVX can record a repeating waveform optionally
preceded by a startup transient waveform. These two recorded signals
can be pre-synthesized or sampled from an acoustic instrument. For
many instruments, this representation is compact. FORM 8SVX is less
practical for an instrument whose waveform changes from cycle to cycle
like a plucked string, where a long sample is needed for accurate
results.
FORM 8SVX can store an "envelope" or "amplitude contour" to enrichen
musical notes. A future voice FORM could also store amplitude, frequency,
and filter modulations.
FORM 8SVX is geared for relatively simple musical voices, where one
waveform per octave is sufficient, where the waveforms for the different
octaves follows a factor-of-two size rule, and where one envelope
is adequate for all octaves. You could store a more general voice
as a LIST containing one or more FORMs 8SVX per octave. A future voice
FORM could go beyond one "one-shot" waveform and one "repeat" waveform
per octave.
Section 2 defines the required property sound header "VHDR", optional
properties name "NAME", copyright "(c)J", and author "AUTH", the optional
annotation data chunk "ANNO", the required data chunk "BODY", and
optional envelope chunks "ATAK" and "RLSE". These are the "standard"
chunks. Specialized chunks for private or future needs can be added
later, e.g. to hold a frequency contour or Fourier series coefficients.
The 8SVX syntax is summarized in Appendix A as a regular expression
and in Appendix B as an example box diagram. Appendix C explains the
optional Fibonacci-delta compression algorithm.
Caution: The VHDR structure Voice8Header changed since draft proposal
#4! The new structure is incompatible with the draft version.
Reference:
"EA IFF 85" Standard for Interchange Format Files describes the underlying
conventions for all IFF files.
Amiga[tm] is a trademark of Commodore-Amiga, Inc.
Electronic Arts[tm] is a trademark of Electronic Arts.
MacWrite[tm] is a trademark of Apple Computer, Inc.
2. Standard Data and Property Chunks
FORM 8SVX stores all the waveform data in one body chunk "BODY". It
stores playback parameters in the required header chunk "VHDR". "VHDR"
and any optional property chunks "NAME", "(c)J", and "AUTH" must all
appear before the BODY chunk. Any of these properties may be shared
over a LIST of FORMs 8SVX by putting them in a PROP 8SVX. [See "EA
IFF 85" Standard for Interchange Format Files.]
Background
There are two ways to use FORM 8SVX: as a one-shot sampled sound or
as a sampled musical instrument that plays "notes". Storing both kinds
of sounds in the same kind of FORM makes it easy to play a one-shot
sound as a (staccato) instrument or an instrument as a (one-note)
sound.
A one-shot sound is a series of audio data samples with a nominal
playback rate and amplitude. The recipient program can optionally
adjust or modulate the amplitude and playback data rate.
For musical instruments, the idea is to store a sampled (or pre-synthesized)
waveform that will be parameterized by pitch, duration, and amplitude
to play each "note". The creator of the FORM 8SVX can supply a waveform
per octave over a range of octaves for this purpose. The intent is
to perform a pitch by selecting the closest octave's waveform and
scaling the playback data rate. An optional "one-shot" waveform supplies
an arbitrary startup transient, then a "repeat" waveform is iterated
as long as necessary to sustain the note.
A FORM 8SVX can also store an envelope to modulate the waveform. Envelopes
are mostly useful for variable-duration notes but could be used for
one-shot sounds, too.
The FORM 8SVX standard has some restrictions. For example, each octave
of data must be twice as long as the next higher octave. Most sound
driver software and hardware imposes additional restrictions. E.g.
the Amiga sound hardware requires an even number of samples in each
one-shot and repeat waveform.
Required Property VHDR
The required property "VHDR" holds a Voice8Header structure as defined
in these C declarations and following documentation. This structure
holds the playback parameters for the sampled waveforms in the BODY
chunk. (See "Data Chunk BODY", below, for the storage layout of these
waveforms.)
#define ID_8SVX MakeID('8', 'S', 'V', 'X')
#define ID_VHDR MakeID('V', 'H', 'D', 'R')
typedef LONG Fixed;
/* A fixed-point value, 16 bits to the left of the point and 16
* to the right. A Fixed is a number of 216ths, i.e. 65536ths. */
#define Unity 0x10000L /* Unity = Fixed 1.0 = maximum volume */
/* sCompression: Choice of compression algorithm applied to the samples. */
#define sCmpNone 0 /* not compressed */
#define sCmpFibDelta 1 /* Fibonacci-delta encoding (Appendix C) */
/* Can be more kinds in the future. */
typedef struct {
ULONG oneShotHiSamples, /* # samples in the high octave 1-shot part */
repeatHiSamples, /* # samples in the high octave repeat part */
samplesPerHiCycle; /* # samples/cycle in high octave, else 0 */
UWORD samplesPerSec; /* data sampling rate */
UBYTE ctOctave, /* # octaves of waveforms */
sCompression; /* data compression technique used */
Fixed volume; /* playback volume from 0 to Unity (full
* volume). Map this value into the output
* hardware's dynamic range. */
} Voice8Header;
[Implementation details. Fields are filed in the order shown. The
UBYTE fields are byte-packed (2 per 16-bit word). MakeID is a C macro
defined in the main IFF document and in the source file IFF.h.]
A FORM 8SVX holds waveform data for one or more octaves, each containing
a one-shot part and a repeat part. The fields oneShotHiSamples and
repeatHiSamples tell the number of audio samples in the two parts
of the highest frequency octave. Each successive (lower frequency)
octave contains twice as many data samples in both its one-shot and
repeat parts. One of these two parts can be empty across all octaves.
Note: Most audio output hardware and software has limitations. The
Amiga computer's sound hardware requires that all one-shot and repeat
parts have even numbers of samples. Amiga sound driver software would
have to adjust an odd-sized waveform, ignore an odd-sized lowest octave,
or ignore odd FORMs 8SVX altogether. Some other output devices require
all sample sizes to be powers of two.
The field samplesPerHiCycle tells the number of samples/cycle in the
highest frequency octave of data, or else 0 for "unknown". Each successive
(lower frequency) octave contains twice as many samples/cycle. The
samplesPerHiCycle value is needed to compute the data rate for a desired
playback pitch.
Actually, samplesPerHiCycle is an average number of samples/cycle.