home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d185 / iff.lha / TP_IFF_Specs / 8SVX.CHANandPAN next >
Text File  |  1988-12-13  |  4KB  |  96 lines

  1.  
  2.                      SMUS.CHAN and SMUS.PAN Chunks
  3.             Stereo imaging in the "8SVX" IFF 8-bit Sample Voice 
  4.             ---------------------------------------------------
  5.                  Registered by David Jones, Gold Disk Inc.
  6.  
  7. There are two ways to create stereo imaging when playing back a digitized
  8. sound. The first relies on the original sound being created with a stereo
  9. sampler: two different samples are digitized simultaneously, using right and
  10. left inputs. To play back this type of sample while maintaining the
  11. stereo imaging, both channels must be set to the same volume. The second type
  12. of stereo sound plays the identical information on two different channels at
  13. different volumes. This gives the sample an absolute position in the stereo
  14. field. Unfortunately, there are currently a number of methods for doing this
  15. currently implemented on the Amiga, none truly adhering to any type of
  16. standard. What I have tried to to is provide a way of doing this
  17. consistently, while retaining compatibility with existing (non-standard)
  18. systems. Introduced below are two optional data chunks, CHAN and PAN. CHAN
  19. deals with sounds sampled in stereo, and PAN with samples given stereo
  20. characteristics after the fact.
  21.  
  22.  
  23. Optional Data Chunk CHAN
  24. ________________________
  25.  
  26. This chunk is already written by the software for a popular stereo sampler. To
  27. maintain the ability read these samples, its implementation here is 
  28. therefore limited to maintain compatability.
  29.  
  30. The optional data chunk CHAN gives the information neccessary to play a
  31. sample on a specified channel, or combination of channels. This chunk
  32. would be useful for programs employing stereo recording or playback of sampled
  33. sounds. 
  34.     
  35.     #define RIGHT        4L
  36.     #define LEFT        2L
  37.     #define STEREO        6L
  38.     
  39.     #define ID_CHAN MakeID('C','H','A','N')
  40.     
  41.     typedef sampletype LONG;
  42.     
  43. If "sampletype" is RIGHT, the program reading the sample knows that it was
  44. originally intended to play on a channel routed to the right speaker,
  45. (channels 1 and 2 on the Amiga). If "sampletype" is LEFT, the left speaker
  46. was intended (Amiga channels 0 and 3). It is left to the discretion of the
  47. programmer to decide whether or not to play a sample when a channel on the
  48. side designated by "sampletype" cannot be allocated. 
  49.  
  50. If "sampletype" is STEREO, then the sample requires a pair of channels routed
  51. to both speakers (Amiga pairs [0,1] and [2,3]). The BODY chunk for stereo
  52. pairs contains both left and right information. To adhere to existing
  53. conventions, sampling software should write first the LEFT information,
  54. followed by the RIGHT. The LEFT and RIGHT information should be equal in
  55. length.
  56.  
  57. Again, it is left to the programmer to decide what to do if a channel for
  58. a stereo pair can't be allocated; wether to play the available channel only,
  59. or to allocate another channels routed to the wrong speaker. 
  60.  
  61.  
  62.  
  63. Optional Data Chunk PAN
  64. _______________________
  65.  
  66. The optional data chunk PAN provides the neccessary information to create a
  67. stereo sound using a single array of data. It is neccessary to replay the 
  68. sample simultaneously on two channels, at different volumes. 
  69.  
  70.     #define ID_PAN MakeID('P','A','N',' ')
  71.     
  72.     typedef sposition Fixed; /* 0 <= sposition <= Unity */
  73.                              /* Unity is elsewhere #defined as 10000L, and
  74.                               * refers to the maximum possible volume.
  75.                               * /
  76.     
  77.     /* Please note that 'Fixed' (elsewhere #defined as LONG) is used to 
  78.      * allow for compatabilty between audio hardware of different resolutions.
  79.      */
  80.      
  81. The 'sposition' variable describes a position in the stereo field. The
  82. numbers of discrete stereo positions available is equal to 1/2 the number of
  83. discrete volumes for a single channel.
  84.  
  85. The sample must be played on both the right and left channels. The overall
  86. volume of the sample is determined by the "volume" field in the Voice8Header
  87. structure in the VHDR chunk. 
  88.  
  89. The left channel volume = overall volume / (Unity / sposition). 
  90.  "  right   "       "   = overall volume - left channel volume.
  91.  
  92. For example:
  93.     If sposition = Unity, the sample is panned all the way to the left.
  94.     If sposition = 0, the sample is panned all the way to the right.
  95.     If sposition = Unity/2, the sample is centered in the stereo field.
  96.