home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d185
/
tp_iff_specs
/
8svx.chanandpan
next >
Wrap
Text File
|
1988-12-13
|
4KB
|
96 lines
SMUS.CHAN and SMUS.PAN Chunks
Stereo imaging in the "8SVX" IFF 8-bit Sample Voice
---------------------------------------------------
Registered by David Jones, Gold Disk Inc.
There are two ways to create stereo imaging when playing back a digitized
sound. The first relies on the original sound being created with a stereo
sampler: two different samples are digitized simultaneously, using right and
left inputs. To play back this type of sample while maintaining the
stereo imaging, both channels must be set to the same volume. The second type
of stereo sound plays the identical information on two different channels at
different volumes. This gives the sample an absolute position in the stereo
field. Unfortunately, there are currently a number of methods for doing this
currently implemented on the Amiga, none truly adhering to any type of
standard. What I have tried to to is provide a way of doing this
consistently, while retaining compatibility with existing (non-standard)
systems. Introduced below are two optional data chunks, CHAN and PAN. CHAN
deals with sounds sampled in stereo, and PAN with samples given stereo
characteristics after the fact.
Optional Data Chunk CHAN
________________________
This chunk is already written by the software for a popular stereo sampler. To
maintain the ability read these samples, its implementation here is
therefore limited to maintain compatability.
The optional data chunk CHAN gives the information neccessary to play a
sample on a specified channel, or combination of channels. This chunk
would be useful for programs employing stereo recording or playback of sampled
sounds.
#define RIGHT 4L
#define LEFT 2L
#define STEREO 6L
#define ID_CHAN MakeID('C','H','A','N')
typedef sampletype LONG;
If "sampletype" is RIGHT, the program reading the sample knows that it was
originally intended to play on a channel routed to the right speaker,
(channels 1 and 2 on the Amiga). If "sampletype" is LEFT, the left speaker
was intended (Amiga channels 0 and 3). It is left to the discretion of the
programmer to decide whether or not to play a sample when a channel on the
side designated by "sampletype" cannot be allocated.
If "sampletype" is STEREO, then the sample requires a pair of channels routed
to both speakers (Amiga pairs [0,1] and [2,3]). The BODY chunk for stereo
pairs contains both left and right information. To adhere to existing
conventions, sampling software should write first the LEFT information,
followed by the RIGHT. The LEFT and RIGHT information should be equal in
length.
Again, it is left to the programmer to decide what to do if a channel for
a stereo pair can't be allocated; wether to play the available channel only,
or to allocate another channels routed to the wrong speaker.
Optional Data Chunk PAN
_______________________
The optional data chunk PAN provides the neccessary information to create a
stereo sound using a single array of data. It is neccessary to replay the
sample simultaneously on two channels, at different volumes.
#define ID_PAN MakeID('P','A','N',' ')
typedef sposition Fixed; /* 0 <= sposition <= Unity */
/* Unity is elsewhere #defined as 10000L, and
* refers to the maximum possible volume.
* /
/* Please note that 'Fixed' (elsewhere #defined as LONG) is used to
* allow for compatabilty between audio hardware of different resolutions.
*/
The 'sposition' variable describes a position in the stereo field. The
numbers of discrete stereo positions available is equal to 1/2 the number of
discrete volumes for a single channel.
The sample must be played on both the right and left channels. The overall
volume of the sample is determined by the "volume" field in the Voice8Header
structure in the VHDR chunk.
The left channel volume = overall volume / (Unity / sposition).
" right " " = overall volume - left channel volume.
For example:
If sposition = Unity, the sample is panned all the way to the left.
If sposition = 0, the sample is panned all the way to the right.
If sposition = Unity/2, the sample is centered in the stereo field.