home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / sound2 / audio_fm.zip / A2 < prev    next >
Text File  |  1993-05-11  |  42KB  |  1,046 lines

  1. Archive-name: audio-fmts/part2
  2. Submitted-by: Guido van Rossum <guido@cwi.nl>
  3. Version: 3.02
  4. Last-modified: 11-May-1993
  5.  
  6. Appendices
  7. ==========
  8.  
  9. Here are some more detailed pieces of info that I received by e-mail.
  10. They are reproduced here virtually without much editing.
  11.  
  12. Table of contents
  13. -----------------
  14.  
  15. FTP access for non-internet sites
  16. AIFF Format (Audio IFF)
  17. The NeXT/Sun audio file format
  18. IFF/8SVX Format
  19. Playing sound on a PC
  20. The EA-IFF-85 documentation
  21. US Federal Standard 1016 availability
  22. Creative Voice (VOC) file format
  23. RIFF WAVE (.WAV) file format
  24. U-LAW and A-LAW definitions
  25. AVR File Format
  26. The Amiga MOD Format
  27.  
  28. ------------------------------------------------------------------------
  29. FTP access for non-internet sites
  30. ---------------------------------
  31.  
  32. From the sci.space FAQ:
  33.  
  34.     Sites not connected to the Internet cannot use FTP directly, but
  35.     there are a few automated FTP servers which operate via email.
  36.     Send mail containing only the word HELP to ftpmail@decwrl.dec.com
  37.     or bitftp@pucc.princeton.edu, and the servers will send you
  38.     instructions on how to make requests.  (The bitftp service is no
  39.     longer available through UUCP gateways due to complaints about
  40.     overuse :-( )
  41.  
  42. Also:
  43.  
  44.     FAQ lists are available by anonymous FTP from pit-manager.mit.edu
  45.     (18.72.1.58) and by email from mail-server@pit-manager.mit.edu (send
  46.     a message containing "help" for instructions about the mail server).
  47.  
  48.  
  49. ------------------------------------------------------------------------
  50. AIFF Format (Audio IFF) and AIFC
  51. --------------------------------
  52.  
  53. This format was developed by Apple for storing high-quality sampled
  54. sound and musical instrument info; it is also used by SGI and several
  55. professional audio packages (sorry, I know no names).  An extension,
  56. called AIFC or AIFF-C, supports compression (see the last item below).
  57.  
  58. I've made a BinHex'ed MacWrite version of the AIFF spec (no idea if
  59. it's the same text as mentioned below) available by anonymous ftp from
  60. ftp.cwi.nl [192.16.184.180]; the file is /pub/audio/AudioIFF1.2.hqx.
  61. But you may be better off with the AIFF-C specs, see below.
  62.  
  63. Mike Brindley (brindley@ece.orst.edu) writes:
  64.  
  65. "The complete AIFF spec by Steve Milne, Matt Deatherage (Apple) is
  66. available in 'AMIGA ROM Kernal Reference Manual: Devices (3rd Edition)'
  67. 1991 by Commodore-Amiga, Inc.; Addison-Wesley Publishing Co.; 
  68. ISBN 0-201-56775-X, starting on page 435 (this edition has a charcoal
  69. grey cover).  It is available in most bookstores, and soon in many
  70. good librairies."
  71.  
  72. According to Mark Callow (msc@sgi.com):
  73.  
  74. A PostScript version of the AIFF-C specification is available via
  75. anonymous ftp on FTP.SGI.COM (192.48.153.1) as /sgi/aiff-c.9.26.91.ps.
  76.  
  77. ------------------------------------------------------------------------
  78. The NeXT/Sun audio file format
  79. ------------------------------
  80.  
  81. Here's the complete story on the file format, from the NeXT
  82. documentation.  (Note that the "magic" number is ((int)0x2e736e64),
  83. which equals ".snd".)  Also, at the end, I've added a litte document
  84. that someone posted to the net a couple of years ago, that describes
  85. the format in a bit-by-bit fashion rather than from C.
  86.  
  87. I received this from Doug Keislar, NeXT Computer.  This is also the
  88. Sun format, except that Sun doesn't recognize as many format codes.  I
  89. added the numeric codes to the table of formats and sorted it.
  90.  
  91.  
  92. SNDSoundStruct:  How a NeXT Computer Represents Sound
  93.  
  94. The NeXT sound software defines the SNDSoundStruct structure to  
  95. represent sound.  This structure defines the soundfile and Mach-O  
  96. sound segment formats and the sound pasteboard type.  It's also used  
  97. to describe sounds in Interface Builder.  In addition, each instance  
  98. of the Sound Kit's Sound class encapsulates a SNDSoundStruct and  
  99. provides methods to access and modify its attributes.
  100.  
  101. Basic sound operations, such as playing, recording, and cut-and-paste  
  102. editing, are most easily performed by a Sound object.  In many cases,  
  103. the Sound Kit obviates the need for in-depth understanding of the  
  104. SNDSoundStruct architecture.  For example, if you simply want to  
  105. incorporate sound effects into an application, or to provide a simple  
  106. graphic sound editor (such as the one in the Mail application), you  
  107. needn't be aware of the details of the SNDSoundStruct.  However, if  
  108. you want to closely examine or manipulate sound data you should be  
  109. familiar with this structure.
  110.  
  111. The SNDSoundStruct contains a header, information that describes the  
  112. attributes of a sound, followed by the data (usually samples) that  
  113. represents the sound.  The structure is defined (in  
  114. sound/soundstruct.h) as:
  115.  
  116. typedef struct {
  117.     int magic;               /* magic number SND_MAGIC */
  118.     int dataLocation;        /* offset or pointer to the data */
  119.     int dataSize;            /* number of bytes of data */
  120.     int dataFormat;          /* the data format code */
  121.     int samplingRate;        /* the sampling rate */
  122.     int channelCount;        /* the number of channels */
  123.     char info[4];            /* optional text information */
  124. } SNDSoundStruct;
  125.  
  126.  
  127.  
  128.  
  129. SNDSoundStruct Fields
  130.  
  131.  
  132.  
  133. magic
  134.  
  135. magic is a magic number that's used to identify the structure as a  
  136. SNDSoundStruct.  Keep in mind that the structure also defines the  
  137. soundfile and Mach-O sound segment formats, so the magic number is  
  138. also used to identify these entities as containing a sound.
  139.  
  140.  
  141.  
  142.  
  143.  
  144. dataLocation
  145.  
  146. It was mentioned above that the SNDSoundStruct contains a header  
  147. followed by sound data.  In reality, the structure only contains the  
  148. header; the data itself is external to, although usually contiguous  
  149. with, the structure.  (Nonetheless, it's often useful to speak of the  
  150. SNDSoundStruct as the header and the data.)  dataLocation is used to  
  151. point to the data.  Usually, this value is an offset (in bytes) from  
  152. the beginning of the SNDSoundStruct to the first byte of sound data.   
  153. The data, in this case, immediately follows the structure, so  
  154. dataLocation can also be thought of as the size of the structure's  
  155. header.  The other use of dataLocation, as an address that locates  
  156. data that isn't contiguous with the structure, is described in  
  157. "Format Codes," below.
  158.  
  159.  
  160.  
  161.  
  162.  
  163. dataSize, dataFormat, samplingRate, and channelCount
  164.  
  165. These fields describe the sound data.
  166.  
  167. dataSize is its size in bytes (not including the size of the  
  168. SNDSoundStruct).
  169.  
  170. dataFormat is a code that identifies the type of sound.  For sampled  
  171. sounds, this is the quantization format.  However, the data can also  
  172. be instructions for synthesizing a sound on the DSP.  The codes are  
  173. listed and explained in "Format Codes," below.
  174.  
  175. samplingRate is the sampling rate (if the data is samples).  Three  
  176. sampling rates, represented as integer constants, are supported by  
  177. the hardware:
  178.  
  179. Constant        Sampling Rate (samples/sec) 
  180.  
  181. SND_RATE_CODEC  8012.821        (CODEC input)
  182. SND_RATE_LOW    22050.0 (low sampling rate output)
  183. SND_RATE_HIGH   44100.0 (high sampling rate output)
  184.  
  185. channelCount is the number of channels of sampled sound.
  186.  
  187.  
  188.  
  189.  
  190.  
  191. info
  192.  
  193. info is a NULL-terminated string that you can supply to provide a  
  194. textual description of the sound.  The size of the info field is set  
  195. when the structure is created and thereafter can't be enlarged.  It's  
  196. at least four bytes long (even if it's unused).
  197.  
  198.  
  199.  
  200.  
  201.  
  202. Format Codes
  203.  
  204. A sound's format is represented as a positive 32-bit integer.  NeXT  
  205. reserves the integers 0 through 255; you can define your own format  
  206. and represent it with an integer greater than 255.  Most of the  
  207. formats defined by NeXT describe the amplitude quantization of  
  208. sampled sound data:
  209.  
  210. Value   Code    Format 
  211.  
  212. 0       SND_FORMAT_UNSPECIFIED  unspecified format 
  213. 1       SND_FORMAT_MULAW_8      8-bit mu-law samples
  214. 2       SND_FORMAT_LINEAR_8     8-bit linear samples
  215. 3       SND_FORMAT_LINEAR_16    16-bit linear samples
  216. 4       SND_FORMAT_LINEAR_24    24-bit linear samples
  217. 5       SND_FORMAT_LINEAR_32    32-bit linear samples
  218. 6       SND_FORMAT_FLOAT        floating-point samples
  219. 7       SND_FORMAT_DOUBLE       double-precision float samples
  220. 8       SND_FORMAT_INDIRECT     fragmented sampled data
  221. 9       SND_FORMAT_NESTED       ?
  222. 10      SND_FORMAT_DSP_CORE     DSP program
  223. 11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
  224. 12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
  225. 13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
  226. 14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
  227. 15      ?
  228. 16      SND_FORMAT_DISPLAY      non-audio display data
  229. 17      SND_FORMAT_MULAW_SQUELCH        ?
  230. 18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
  231. 19      SND_FORMAT_COMPRESSED   16-bit linear with compression
  232. 20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
  233. 21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
  234. 22      SND_FORMAT_DSP_COMMANDS_SAMPLES         ?
  235. [Some new ones supported by Sun.  This is all I currently know. --GvR]
  236. 23      SND_FORMAT_ADPCM_G721
  237. 24      SND_FORMAT_ADPCM_G722
  238. 25      SND_FORMAT_ADPCM_G723_3
  239. 26      SND_FORMAT_ADPCM_G723_5
  240. 27      SND_FORMAT_ALAW_8
  241.  
  242.  
  243. Most formats identify different sizes and types of  
  244. sampled data.  Some deserve special note:  
  245.  
  246.  
  247. --      SND_FORMAT_DSP_CORE format contains data that represents a  
  248. loadable DSP core program.  Sounds in this format are required by the  
  249. SNDBootDSP() and SNDRunDSP() functions.  You create a  
  250. SND_FORMAT_DSP_CORE sound by reading a DSP load file (extension  
  251. ".lod") with the SNDReadDSPfile() function.
  252.  
  253. --      SND_FORMAT_DSP_COMMANDS is used to distinguish sounds that  
  254. contain DSP commands created by the Music Kit.  Sounds in this format  
  255. can only be created through the Music Kit's Orchestra class, but can  
  256. be played back through the SNDStartPlaying() function.
  257.  
  258. --      SND_FORMAT_DISPLAY format is used by the Sound Kit's  
  259. SoundView class.  Such sounds can't be played.  
  260.  
  261.  
  262. --      SND_FORMAT_INDIRECT indicates data that has become  
  263. fragmented, as described in a separate section, below.  
  264.  
  265.  
  266. --      SND_FORMAT_UNSPECIFIED is used for unrecognized formats.
  267.  
  268.  
  269.  
  270.  
  271.  
  272. Fragmented Sound Data
  273.  
  274. Sound data is usually stored in a contiguous block of memory.   
  275. However, when sampled sound data is edited (such that a portion of  
  276. the sound is deleted or a portion inserted), the data may become  
  277. discontiguous, or fragmented.  Each fragment of data is given its own  
  278. SNDSoundStruct header; thus, each fragment becomes a separate  
  279. SNDSoundStruct structure.  The addresses of these new structures are  
  280. collected into a contiguous, NULL-terminated block; the dataLocation  
  281. field of the original SNDSoundStruct is set to the address of this  
  282. block, while the original format, sampling rate, and channel count  
  283. are copied into the new SNDSoundStructs.  
  284.  
  285.  
  286. Fragmentation serves one purpose:  It avoids the high cost of moving  
  287. data when the sound is edited.  Playback of a fragmented sound is  
  288. transparent-you never need to know whether the sound is fragmented  
  289. before playing it.  However, playback of a heavily fragmented sound  
  290. is less efficient than that of a contiguous sound.  The  
  291. SNDCompactSamples() C function can be used to compact fragmented  
  292. sound data.
  293.  
  294. Sampled sound data is naturally unfragmented.  A sound that's freshly  
  295. recorded or retrieved from a soundfile, the Mach-O segment, or the  
  296. pasteboard won't be fragmented.  Keep in mind that only sampled data  
  297. can become fragmented.
  298.  
  299.  
  300.  
  301. _________________________
  302. >From mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps Wed Apr  4  
  303. 23:56:23 EST 1990
  304. Article 5779 of comp.sys.next:
  305. Path: mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps
  306. >From: eps@toaster.SFSU.EDU (Eric P. Scott)
  307. Newsgroups: comp.sys.next
  308. Subject: Re: Format of NeXT sndfile headers?
  309. Message-ID: <445@toaster.SFSU.EDU>
  310. Date: 31 Mar 90 21:36:17 GMT
  311. References: <14978@phoenix.Princeton.EDU>
  312. Reply-To: eps@cs.SFSU.EDU (Eric P. Scott)
  313. Organization: San Francisco State University
  314. Lines: 42
  315.  
  316. In article <14978@phoenix.Princeton.EDU>
  317.         bskendig@phoenix.Princeton.EDU (Brian Kendig) writes:
  318. >I'd like to take a program I have that converts Macintosh sound  
  319. files
  320. >to NeXT sndfiles and polish it up a bit to go the other direction as
  321. >well.
  322.  
  323. Two people have already submitted programs that do this
  324. (Christopher Lane and Robert Hood); check the various
  325. NeXT archive sites.
  326.  
  327. >       Could someone please give me the format of a NeXT sndfile
  328. >header?
  329.  
  330. "big-endian"
  331.         0       1       2       3
  332.         +-------+-------+-------+-------+
  333. 0       | 0x2e  | 0x73  | 0x6e  | 0x64  |       "magic" number
  334.         +-------+-------+-------+-------+
  335. 4       |                               |       data location
  336.         +-------+-------+-------+-------+
  337. 8       |                               |       data size
  338.         +-------+-------+-------+-------+
  339. 12      |                               |       data format (enum)
  340.         +-------+-------+-------+-------+
  341. 16      |                               |       sampling rate (int)
  342.         +-------+-------+-------+-------+
  343. 20      |                               |       channel count
  344.         +-------+-------+-------+-------+
  345. 24      |       |       |       |       |       (optional) info  
  346. string
  347.  
  348. 28 = minimum value for data location
  349.  
  350. data format values can be found in /usr/include/sound/soundstruct.h
  351.  
  352. Most common combinations:
  353.  
  354.          sampling  channel    data
  355.              rate    count  format              
  356. voice file   8012        1       1 =  8-bit mu-law
  357. system beep 22050        2       3 = 16-bit linear
  358. CD-quality  44100        2       3 = 16-bit linear
  359.  
  360. ------------------------------------------------------------------------
  361. IFF/8SVX Format
  362. ---------------
  363.  
  364. Newsgroups: alt.binaries.sounds.d,alt.sex.sounds
  365. Subject: Format of the IFF header (Amiga sounds)
  366. Message-ID: <2509@tardis.Tymnet.COM>
  367. From: jms@tardis.Tymnet.COM (Joe Smith)
  368. Date: 23 Oct 91 23:54:38 GMT
  369. Followup-To: alt.binaries.sounds.d
  370. Organization: BT North America (Tymnet)
  371.  
  372. The first 12 bytes of an IFF file are used to distinguish between an Amiga
  373. picture (FORM-ILBM), an Amiga sound sample (FORM-8SVX), or other file
  374. conforming to the IFF specification.  The middle 4 bytes is the count of
  375. bytes that follow the "FORM" and byte count longwords.  (Numbers are stored
  376. in M68000 form, high order byte first.)
  377.  
  378.                 ------------------------------------------
  379.  
  380. FutureSound audio file, 15000 samples at 10.000KHz, file is 15048 bytes long.
  381.  
  382. 0000: 464F524D 00003AC0 38535658 56484452    FORM..:.8SVXVHDR
  383.       F O R M     15040 8 S V X  V H D R
  384. 0010: 00000014 00003A98 00000000 00000000    ......:.........
  385.             20    15000        0        0
  386. 0020: 27100100 00010000 424F4459 00003A98    '.......BODY..:.
  387.      10000 1 0    1.0   B O D Y     15000
  388.  
  389. 0000000..03 = "FORM", identifies this as an IFF format file.
  390. FORM+00..03 (ULONG) = number of bytes that follow.  (Unsigned long int.)
  391. FORM+03..07 = "8SVX", identifies this as an 8-bit sampled voice.
  392.  
  393. ????+00..03 = "VHDR", Voice8Header, describes the parameters for the BODY.
  394. VHDR+00..03 (ULONG) = number of bytes to follow. 
  395. VHDR+04..07 (ULONG) = samples in the high octave 1-shot part.
  396. VHDR+08..0B (ULONG) = samples in the high octave repeat part.
  397. VHDR+0C..0F (ULONG) = samples per cycle in high octave (if repeating), else 0.
  398. VHDR+10..11 (UWORD) = samples per second.  (Unsigned 16-bit quantity.)
  399. VHDR+12     (UBYTE) = number of octaves of waveforms in sample.
  400. VHDR+13     (UBYTE) = data compression (0=none, 1=Fibonacci-delta encoding).
  401. VHDR+14..17 (FIXED) = volume.  (The number 65536 means 1.0 or full volume.)
  402.  
  403. ????+00..03 = "BODY", identifies the start of the audio data.
  404. BODY+00..03 (ULONG) = number of bytes to follow.
  405. BODY+04..NNNNN      = Data, signed bytes, from -128 to +127.
  406.  
  407. 0030: 04030201 02030303 04050605 05060605
  408. 0040: 06080806 07060505 04020202 01FF0000
  409. 0050: 00000000 FF00FFFF FFFEFDFD FDFEFFFF
  410. 0060: FDFDFF00 00FFFFFF 00000000 00FFFF00
  411. 0070: 00000000 00FF0000 00FFFEFF 00000000
  412. 0080: 00010000 000101FF FF0000FE FEFFFFFE
  413. 0090: FDFDFEFD FDFFFFFC FDFEFDFD FEFFFEFE
  414. 00A0: FFFEFEFE FEFEFEFF FFFFFEFF 00FFFF01
  415.  
  416. This small section of the audio sample shows the number ranging from -5 (0xFD)
  417. to +8 (0x08).  Warning: Do not assume that the BODY starts 48 bytes into the
  418. file.  In addition to "VHDR", chunks labeled "NAME", "AUTH", "ANNO", or 
  419. "(c) " may be present, and may be in any order.  You will have to check the
  420. byte count in each chunk to determine how many bytes to skip.
  421.  
  422. ------------------------------------------------------------------------
  423. Playing sound on a PC
  424. ---------------------
  425.  
  426. From: Eric A Rasmussen
  427.  
  428. Any turbo PC (8088 at 8 Mhz or greater)/286/386/486/etc. can produce a quality
  429. playback of single channel 8 bit sounds on the internal (1 bit, 1 channel)
  430. speaker by utilizing Pulse-Width-Modulation, which toggles the speaker faster
  431. than it can physically move to simulate positions between fully on and fully
  432. off.  There are several PD programs of this nature that I know of:
  433.  
  434. REMAC  - Plays MAC format sound files.  Files on the Macintosh, at least the
  435.          sound files that I've ripped apart, seem to contain 3 parts.  The
  436.          first two are info like what the file icon looks like and other
  437.          header type info.  The third part contains the raw sample data, and
  438.          it is this portion of the file which is saved to a seperate file,
  439.          often named with the .snd extension by PC users.  Personally, I like
  440.          to name the files .s1, .s2, .s3, or .s4 to indicate the sampling rate
  441.          of the file. (-s# is how to specify the playback rate in REMAC.)
  442.          REMAC provides playback rates of 5550hz, 7333hz, 11 khz, & 22 khz.
  443. REMAC2 - Same as REMAC, but sounds better on higher speed machines.
  444. REPLAY - Basically same as REMAC, but for playback of Atari ST sounds. 
  445.          Apparently, the Atari has two sound formats, one of which sounds like
  446.          garbage if played by REMAC or REPLAY in the incorrect mode.  The
  447.          other file format works fine with REMAC and so appears to be 'normal'
  448.          unsigned 8-bit data.  REPLAY provides playback rates of 11.5 khz,
  449.          12.5 khz, 14 khz, 16 khz, 18.5 khz, 22khz, & 27 khz.
  450.  
  451. These three programs are all by the same author, Richard E. Zobell who does
  452. not have an internet mail address to my knowledge, but does have a GEnie email
  453. address of R.ZOBELL. 
  454.  
  455. Additionally, there are various stand-alone demos which use the internal
  456. speaker, of which there is one called mushroom which plays a 30 second
  457. advertising jingle for magic mushroom room deoderizers which is pretty
  458. humerous.  I've used this player to playback samples that I ripped out of the
  459. commercial game program Mean Streets, which uses something they call RealSound
  460. (tm) to playback digital samples on the internal speaker. (Of course, I only do
  461. this on my own system, and since I own the game, I see no problems with it.)
  462.  
  463. For owners of 8 Mhz 286's and above, the option to play 4 channel 8 bit sounds
  464. (with decent quality) on the internal speaker is also a reality.  Quite a
  465. number of PD programs exist to do this, including, but not limited to:
  466.  
  467. ModEdit, ModPlay, ScreamTracker, STM, Star Trekker, Tetra, and probably a few
  468. more.  
  469.  
  470. All these programs basically make use of various sound formats used by the
  471. Amiga line of computers.  These include .stm files, .mod files
  472. [a.k.a. mod. files], and .nst files [really the same hing].  Also,
  473. these programs pretty much all have the option to playback the 
  474. sound to add-on hardware such as the SoundBlaster card, the Covox series of
  475. devices, and also to direct the data to either one or two (for stereo)
  476. parallel ports, which you could attach your own D/A's to.  (From what I have
  477. seen, the Covox is basically an small amplified speaker with a D/A which plugs
  478. into the parallel port.  This sounds very similiar to the Disney Sound System
  479. (DSS) which people have been talking about recently.)  
  480.  
  481. ------------------------------------------------------------------------
  482. The EA-IFF-85 documentation
  483. ---------------------------
  484.  
  485. From: dgc3@midway.uchicago.edu
  486.  
  487. As promised, here's an ftp location for the EA-IFF-85 documentation.  It's
  488. the November 1988 release as revised by Commodore (the last public release),
  489. with specifications for IFF FORMs for graphics, sound, formatted text, and
  490. more.  IFF FORMS now exist for other media, including structured drawing, and
  491. new documentation is now available only from Commodore.
  492.  
  493. The documentation is at grind.isca.uiowa.edu [128.255.19.233], in the
  494. directory /amiga/f1/ff185.  The complete file list is as follows:
  495.  
  496. DOCUMENTS.zoo    
  497. EXAMPLES.zoo     
  498. EXECUTABLE.zoo   
  499. INCLUDE.zoo      
  500. LINKER_INFO.zoo  
  501. OBJECT.zoo       
  502. SOURCE.zoo       
  503. TP_IFF_Specs.zoo 
  504.  
  505. All files except DOCUMENTS.zoo are Amiga-specific, but may be used as a basis
  506. for conversion to other platforms.  Well, I take that tentatively back.  I
  507. don't know what TP_IFF_Specs.zoo contains, so it might be non-Amiga-specific.
  508.  
  509. ------------------------------------------------------------------------
  510. US Federal Standard 1016 availability
  511. -------------------------------------
  512.  
  513. From: Joe Campbell  N3JBC  jpcampb@afterlife.ncsc.mil  74040.305@compuserve.com
  514.  
  515. The U.S. DoD's Federal-Standard-1016 4800 bps code excited linear prediction
  516. voice coder version 3.2 (CELP 3.2) Fortran and C simulation source codes are
  517. now available for worldwide distribution at no charge (on DOS diskettes,
  518. but configured to compile on Sun SPARC stations) from:
  519.  
  520. Bob Fenichel
  521. National Communications System
  522. Washington, D.C.  20305
  523. 1-703-692-2124
  524. 1-703-746-4960 (fax)
  525.  
  526. In addition to the source codes, example input and processed speech files
  527. are included along with a technical information bulletin to assist in
  528. implementation of FS-1016 CELP.  (An anonymous ftp site is being considered
  529. for future releases.)
  530.  
  531. Copies of the FS-1016 document are available for $2.50 each from:
  532.  
  533. GSA Rm 6654
  534. 7th & D St SW
  535. Washington, D.C.  20407
  536. 1-202-708-9205
  537.  
  538. The following articles describe the Federal-Standard-1016 4.8-kbps CELP
  539. coder (it's unnecessary to read more than one):
  540.  
  541. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  542. "The Federal Standard 1016 4800 bps CELP Voice Coder," Digital Signal
  543. Processing, Academic Press, 1991, Vol. 1, No. 3, p. 145-155.
  544.  
  545. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  546. "The DoD 4.8 kbps Standard (Proposed Federal Standard 1016),"
  547. in Advances in Speech Coding, ed. Atal, Cuperman and Gersho,
  548. Kluwer Academic Publishers, 1991, Chapter 12, p. 121-133.
  549.  
  550. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
  551. Proposed Federal Standard 1016 4800 bps Voice Coder:  CELP," Speech
  552. Technology Magazine, April/May 1990, p. 58-64.
  553.  
  554. For U.S. FED-STD-1016 (4800 bps CELP) _realtime_ DSP code
  555. and information about products using this code, contact:
  556.  
  557. John DellaMorte
  558. DSP Software Engineering
  559. 165 Middlesex Tpk, Suite 206
  560. Bedford, MA  01730
  561. 1-617-275-3733
  562. 1-617-275-4323 (fax)
  563. dspse.bedford@channel1.com
  564.  
  565. DSP Software Engineering's code can run on a DSP Research's Tiger 30 board
  566. (a PC board with a TMS320C3x and analog interface suited to development work)
  567. or on Intellibit's AE2000 TMS320C31 based 3" by 2.5" card.
  568.  
  569. DSP Research                Intellibit
  570. 1095 E. Duane Ave.          P.O. Box 9785
  571. Sunnyvale, CA  94086        McLean, VA  22102-0785
  572. (408)773-1042               (703)442-4781
  573. (408)736-3451 (fax)         (703)442-4784 (fax)
  574.  
  575. From: tobiasr@monolith.lrmsc.loral.com (Richard Tobias )
  576.  
  577. For U.S. FED-STD-1016 (4800 bps CELP) _realtime_ DSP code and
  578. information about products using this code using the AT&T DSP32C and
  579. AT&T DSP3210, contact:
  580.  
  581. White Eagle Systems Technology, Inc.
  582. 1123 Queensbridge Way
  583. San Jose, CA 95120
  584. (408) 997-2706
  585. (408) 997-3584 (fax)
  586. rjjt@netcom.com
  587.  
  588. Newsgroups: comp.dsp
  589. From: bae@hplsdrn.col.hp.com (Bruce Erickson)
  590. Subject: Re: FTP site for CELP audio compression source?
  591.  
  592. In comp.dsp (subj: FTP site for CELP audio compression source?), Joe
  593. Campbell writes:
  594. > I would like to mention that a document, that is a vital part of the CELP
  595. > release package, is not available in electronic form.  Therefore, I urge
  596. > anyone who is seriously interested in this coder to obtain this document:
  597. >  Details to Assist in Implementation of Federal Standard 1016 CELP.
  598. >  National Communications System, Office of Technology & Standards, 1992.
  599. >  Technical Information Bulletin 92-1.
  600. [Available for free from Bob Fenichel above --GvR]
  601.  
  602. I would also like to mention that when Bob gave me permission to put the
  603. CELP disks on wsmr-simutel he asked for people who fetch them to let
  604. him know that they have them.  
  605.  
  606. So if you grab the sources -- from whatever source -- please give him
  607. a call or send him USmail.
  608.  
  609. I am still waiting for wsmr-simutel to let me know how to upload the CELP
  610. disks -- I will be sure to post here & elsewhere when I upload them!
  611.  
  612.                      - Bruce Erickson
  613.                      bae@col.hp.com
  614.  
  615. ------------------------------------------------------------------------
  616. Creative Voice (VOC) file format
  617. --------------------------------
  618.  
  619. From: galt@dsd.es.com
  620.  
  621. (byte numbers are hex!)
  622.  
  623.     HEADER (bytes 00-19)
  624.     Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
  625.  
  626. - ---------------------------------------------------------------
  627.  
  628. HEADER:
  629. =======
  630.      byte #     Description
  631.      ------     ------------------------------------------
  632.      00-12      "Creative Voice File"
  633.      13         1A (eof to abort printing of file)
  634.      14-15      Offset of first datablock in .voc file (std 1A 00
  635.                 in Intel Notation)
  636.      16-17      Version number (minor,major) (VOC-HDR puts 0A 01)
  637.      18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  638.  
  639. - ---------------------------------------------------------------
  640.  
  641. DATA BLOCK:
  642. ===========
  643.  
  644.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  645.    NOTE: Terminator Block is an exception -- it has only the TYPE byte.
  646.  
  647.       TYPE   Description     Size (3-byte int)   Info
  648.       ----   -----------     -----------------   -----------------------
  649.       00     Terminator      (NONE)              (NONE)
  650.       01     Sound data      2+length of data    *
  651.       02     Sound continue  length of data      Voice Data
  652.       03     Silence         3                   **
  653.       04     Marker          2                   Marker# (2 bytes)
  654.       05     ASCII           length of string    null terminated string
  655.       06     Repeat          2                   Count# (2 bytes)
  656.       07     End repeat      0                   (NONE)
  657.  
  658.       *Sound Info Format:       **Silence Info Format:
  659.        ---------------------      ----------------------------
  660.        00   Sample Rate           00-01  Length of silence - 1
  661.        01   Compression Type      02     Sample Rate
  662.        02+  Voice Data
  663.  
  664.  
  665.   Marker#           -- Driver keeps the most recent marker in a status byte
  666.   Count#            -- Number of repetitions + 1
  667.                          Count# may be 1 to FFFE for 0 - FFFD repetitions
  668.                          or FFFF for endless repetitions
  669.   Sample Rate       -- SR byte = 256-(1000000/sample_rate)
  670.   Length of silence -- in units of sampling cycle
  671.   Compression Type  -- of voice data
  672.                          8-bits    = 0
  673.                          4-bits    = 1
  674.                          2.6-bits  = 2
  675.                          2-bits    = 3
  676.                          Multi DAC = 3+(# of channels) [interesting--
  677.                                        this isn't in the developer's manual]
  678.  
  679. ------------------------------------------------------------------------
  680. RIFF WAVE (.WAV) file format
  681. ----------------------------
  682.  
  683. RIFF is a format by Microsoft and IBM which is similar in spirit and
  684. functionality as EA-IFF-85, but not compatible (and it's in
  685. little-endian byte order, of course :-).  WAVE is RIFF's equivalent of
  686. AIFF, and its inclusion in Microsoft Windows 3.1 has suddenly made it
  687. important to know about.
  688.  
  689. Rob Ryan was kind enough to send me a description of the RIFF format.
  690. Unfortunately, it is too big to include here (27 k), but I've made it
  691. available for anonymous ftp as ftp.cwi.nl:/pub/audio/RIFF-format.
  692.  
  693. And here's a pointer to the official description from Matt Saettler,
  694. Microsoft Multimedia:
  695.  
  696. "The complete definition of the WAVE file format as defined by
  697. IBM/Microsoft is available for anon. FTP from ftp.uu.net in the
  698. vendor/microsoft/multimedia directory."
  699.  
  700. (Rob Ryan's version may actually be an extract from one of the files
  701. stored there.)
  702.  
  703. ------------------------------------------------------------------------
  704. U-LAW and A-LAW definitions
  705. ---------------------------
  706.  
  707. [Adapted from information provided by duggan@cc.gatech.edu (Rick
  708. Duggan) and davep@zenobia.phys.unsw.EDU.AU (David Perry)]
  709.  
  710. u-LAW (really mu-LAW) is
  711.  
  712.           sgn(m)   (     |m |)       |m |
  713.    y=    ------- ln( 1+ u|--|)       |--| =< 1
  714.          ln(1+u)   (     |mp|)       |mp|         
  715.  
  716. A-LAW is
  717.  
  718.      |     A    (m )                 |m |    1
  719.      |  ------- (--)                 |--| =< - 
  720.      |  1+ln A  (mp)                 |mp|    A     
  721.    y=|
  722.      | sgn(m) (        |m |)    1    |m |
  723.      | ------ ( 1+ ln A|--|)    - =< |--| =< 1
  724.      | 1+ln A (        |mp|)    A    |mp|         
  725.  
  726. Values of u=100 and 255, A=87.6, mp is the Peak message value, m is
  727. the current quantised message value.  (The formulae get simpler if you
  728. substitute x for m/mp and sgn(x) for sgn(m); then -1 <= x <= 1.)
  729.  
  730. Converting from u-LAW to A-LAW is in a sense "lossy" since there are
  731. quantizing errors introduced in the conversion.
  732.  
  733. "..the u-LAW used in North America and Japan, and the
  734. A-LAW used in Europe and the rest of the world and
  735. international routes.."
  736.  
  737. References:
  738.  
  739. Modern Digital and Analog Communication Systems, B.P.Lathi., 2nd ed.
  740. ISBN 0-03-027933-X
  741.  
  742. Transmission Systems for Communications
  743. Fifth Edition
  744. by Members of the Technical Staff at Bell Telephone Laboratories
  745. Bell Telephone Laboratories, Incorporated
  746. Copyright 1959, 1964, 1970, 1982
  747.  
  748. ------------------------------------------------------------------------
  749. AVR File Format
  750. ---------------
  751.  
  752. From: hyc@hanauma.Jpl.Nasa.Gov (Howard Chu)
  753.  
  754. A lot of PD software exists to play Mac .snd files on the ST. One other
  755. format that seems pretty popular (used by a number of commercial packages)
  756. is the AVR format (from Audio Visual Research). This format has a 128 byte
  757. header that looks like this:
  758.  
  759.         char magic[4]="2BIT";
  760.         char name[8];           /* null-padded sample name */
  761.         short mono;             /* 0 = mono, 0xffff = stereo */
  762.         short rez;              /* 8 = 8 bit, 16 = 16 bit */
  763.         short sign;             /* 0 = unsigned, 0xffff = signed */
  764.         short loop;             /* 0 = no loop, 0xffff = looping sample */
  765.         short midi;             /* 0xffff = no MIDI note assigned,
  766.                                    0xffXX = single key note assignment
  767.                                    0xLLHH = key split, low/hi note */
  768.         long rate;              /* sample frequency in hertz */
  769.         long size;              /* sample length in bytes or words (see rez) */
  770.         long lbeg;              /* offset to start of loop in bytes or words.
  771.                                    set to zero if unused. */
  772.         long lend;              /* offset to end of loop in bytes or words.
  773.                                    set to sample length if unused. */
  774.         short res1;             /* Reserved, MIDI keyboard split */
  775.         short res2;             /* Reserved, sample compression */
  776.         short res3;             /* Reserved */
  777.         char ext[20];           /* Additional filename space, used
  778.                                    if (name[7] != 0) */
  779.         char user[64];          /* User defined. Typically ASCII message. */
  780.  
  781. -----------------------------------------------------------------------
  782. The Amiga MOD Format
  783. --------------------
  784.  
  785. From: norlin@mailhost.ecn.uoknor.edu (Norman Lin)
  786.  
  787. MOD files are music files containing 2 parts:
  788.  
  789. (1) a bank of digitized samples
  790. (2) sequencing information describing how and when to play the samples
  791.  
  792. MOD files originated on the Amiga, but because of their flexibility
  793. and the extremely large number of MOD files available, MOD players
  794. are now available for a variety of machines (IBM PC, Mac, Sparc
  795. Station, etc.)
  796.  
  797. The samples in a MOD file are raw, 8 bit, signed, headerless, linear
  798. digital data.  There may be up to 31 distinct samples in a MOD file,
  799. each with a length of up to 128K (though most are much smaller; say,
  800. 10K - 60K).  An older MOD format only allowed for up to 15 samples in
  801. a MOD file; you don't see many of these anymore.  There is no standard
  802. sampling rate for these samples.  [But see below.]
  803.  
  804. The sequencing information in a MOD file contains 4 tracks of
  805. information describing which, when, for how long, and at what frequency
  806. samples should be played.  This means that a MOD file can have up
  807. to 31 distinct (digitized) instrument sounds, with up to 4 playing
  808. simultaneously at any given point.  This allows a wide variety
  809. of orchestrational possibilities, including use of voice samples
  810. or creation of one's own instruments (with appropriate sampling
  811. hardware/software).  The ability to use one's own samples as instruments
  812. is a flexibility that other music files/formats do not share, and
  813. is one of the reasons MOD files are so popular, numerous, and diverse.
  814.  
  815. 15 instrument MODs, as noted above, are somewhat older than 31
  816. instrument MODs and are not (at least not by me) seen very often
  817. anymore.  Their format is identical to that of 31 instrument MODs
  818. except:
  819.  
  820. (1) Since there are only 15 samples, the information for the last (15th)
  821.     sample starts at byte 440 and goes through byte 469.
  822. (2) The songlength is at byte 470 (contrast with byte 950 in 31 instrument
  823.     MOD)
  824. (3) Byte 471 appears to be ignored, but has been observed to be 127.
  825.     (Sorry, this is from observation only)
  826. (4) Byte 472 begins the pattern sequence table (contrast with byte 952
  827.     in a 31 instrument MOD)
  828. (5) Patterns start at byte 600 (contrast with byte 1084 in 31 instrument MOD)
  829.  
  830. "ProTracker," an Amiga MOD file creator/editor, is available for ftp
  831. everywhere as pt??.lzh.
  832.  
  833. From: Apollo Wong <apollo@ee.ualberta.ca>
  834.  
  835. From: M.J.H.Cox@bradford.ac.uk (Mark Cox)
  836. Newsgroups: alt.sb.programmer
  837. Subject: Re: Format for MOD files...
  838. Message-ID: <1992Mar18.103608.4061@bradford.ac.uk>
  839. Date: 18 Mar 92 10:36:08 GMT
  840. Organization: University of Bradford, UK
  841.  
  842. wdc50@DUTS.ccc.amdahl.com (Winthrop D Chan) writes:
  843. >I'd like to know if anyone has a reference document on the format of the
  844. >Amiga Sound/NoiseTracker (MOD) files. The author of Modplay said he was going
  845. >to release such a document sometime last year, but he never did. If anyone
  846.  
  847. I found this one, which covers it better than I can explain it - if you
  848. use this in conjunction with the documentation that comes with Norman
  849. Lin's Modedit program it should pretty much cover it.
  850.  
  851. Mark J Cox
  852.  
  853. /***********************************************************************
  854.  
  855. Protracker 1.1B Song/Module Format:
  856. -----------------------------------
  857.  
  858. Offset  Bytes  Description
  859. ------  -----  -----------
  860.    0     20    Songname. Remember to put trailing null bytes at the end...
  861.  
  862. Information for sample 1-31:
  863.  
  864. Offset  Bytes  Description
  865. ------  -----  -----------
  866.   20     22    Samplename for sample 1. Pad with null bytes.
  867.   42      2    Samplelength for sample 1. Stored as number of words.
  868.                Multiply by two to get real sample length in bytes.
  869.   44      1    Lower four bits are the finetune value, stored as a signed
  870.                four bit number. The upper four bits are not used, and
  871.                should be set to zero.
  872.                Value:  Finetune:
  873.                  0        0
  874.                  1       +1
  875.                  2       +2
  876.                  3       +3
  877.                  4       +4
  878.                  5       +5
  879.                  6       +6
  880.                  7       +7
  881.                  8       -8
  882.                  9       -7
  883.                  A       -6
  884.                  B       -5
  885.                  C       -4
  886.                  D       -3
  887.                  E       -2
  888.                  F       -1
  889.  
  890.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  891.   46      2    Repeat point for sample 1. Stored as number of words offset
  892.                from start of sample. Multiply by two to get offset in bytes.
  893.   48      2    Repeat Length for sample 1. Stored as number of words in
  894.                loop. Multiply by two to get replen in bytes.
  895.  
  896. Information for the next 30 samples starts here. It's just like the info for
  897. sample 1.
  898.  
  899. Offset  Bytes  Description
  900. ------  -----  -----------
  901.   50     30    Sample 2...
  902.   80     30    Sample 3...
  903.    .
  904.    .
  905.    .
  906.  890     30    Sample 30...
  907.  920     30    Sample 31...
  908.  
  909. Offset  Bytes  Description
  910. ------  -----  -----------
  911.  950      1    Songlength. Range is 1-128.
  912.  951      1    Well... this little byte here is set to 127, so that old
  913.                trackers will search through all patterns when loading.
  914.                Noisetracker uses this byte for restart, but we don't.
  915.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  916.                tells the tracker what pattern to play at that position.
  917. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  918.                inserted when they increased the number of samples from
  919.                15 to 31. If it's not there, the module/song uses 15 samples
  920.                or the text has been removed to make the module harder to
  921.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  922.  
  923. Offset  Bytes  Description
  924. ------  -----  -----------
  925. 1084    1024   Data for pattern 00.
  926.    .
  927.    .
  928.    .
  929. xxxx  Number of patterns stored is equal to the highest patternnumber
  930.       in the song position table (at offset 952-1079).
  931.  
  932. Each note is stored as 4 bytes, and all four notes at each position in
  933. the pattern are stored after each other.
  934.  
  935. 00 -  chan1  chan2  chan3  chan4
  936. 01 -  chan1  chan2  chan3  chan4
  937. 02 -  chan1  chan2  chan3  chan4
  938. etc.
  939.  
  940. Info for each note:
  941.  
  942.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  943. /                \ /      \  /                \ /      \
  944. 0000          0000-00000000  0000          0000-00000000
  945.  
  946. Upper four    12 bits for    Lower four    Effect command.
  947. bits of sam-  note period.   bits of sam-
  948. ple number.                  ple number.
  949.  
  950. Periodtable for Tuning 0, Normal
  951.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  952.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  953.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  954.  
  955. To determine what note to show, scan through the table until you find
  956. the same period as the one stored in byte 1-2. Use the index to look
  957. up in a notenames table.
  958.  
  959. This is the data stored in a normal song. A packed song starts with the
  960. four letters "PACK", but i don't know how the song is packed: You can
  961. get the source code for the cruncher/decruncher from us if you need it,
  962. but I don't understand it; I've just ripped it from another tracker...
  963.  
  964. In a module, all the samples are stored right after the patterndata.
  965. To determine where a sample starts and stops, you use the sampleinfo
  966. structures in the beginning of the file (from offset 20). Take a look
  967. at the mt_init routine in the playroutine, and you'll see just how it
  968. is done.
  969.  
  970. Lars "ZAP" Hamre/Amiga Freelancers
  971.  
  972. ***********************************************************************/
  973.  
  974. -- 
  975. Mark J Cox -----
  976. Bradford, UK ---
  977.  
  978.  
  979. PS: A file with even *much* more info on MOD files, compiled by Lars
  980. Hamre, is available from ftp.cwi.nl:/pub/audio/MOD-info.  Enjoy!
  981.  
  982.  
  983. FTP sites for MODs and MOD players
  984. ----------------------------------
  985.  
  986. Subject: MODS AND PLAYERS!! **READ** info/where to get them
  987. From: cjohnson@tartarus.uwa.edu.au (Christopher Johnson)
  988. Newsgroups: alt.binaries.sounds.d
  989. Message-ID: <1h32ivINNglu@uniwa.uwa.edu.au>
  990. Date: 21 Dec 92 00:19:43 GMT
  991. Organization: The University of Western Australia
  992.  
  993. Hello world,
  994.  
  995. For all those asking, here is where to get those mod players and mods.
  996.  
  997. SNAKE.MCS.KENT.EDU is the best site for general stuff.  look in /pub/SB-Adlib
  998.  
  999. Simtel-20 or archie.au(simtel mirror) in <msdos.sound>
  1000.  
  1001. for windows players ftp.cica.indiana.edu in pub/pc/win3/sound
  1002.  
  1003. here is a short list of players
  1004.  
  1005. mp or modplay   BEST OVERALL                    mp219b.zip      
  1006.         simtel and snake
  1007.  
  1008. wowii           best for vga/fast machines      wowii12b.zip    
  1009.         simtel and snake
  1010.  
  1011. trakblaster     best for compatability          trak-something  
  1012.         simtel and snake        two versions, old one for slow
  1013.         machines
  1014.  
  1015. ss              cute display(hifi)              have_sex.arj
  1016.         found on local BBS (western Australia White Ghost)
  1017.  
  1018. superpro player generally good                  ssp.zip or similar
  1019.         found on night owl 7 CD
  1020.  
  1021. player?         cute display(hifi)              player.zip or similar
  1022.         found on night owl 7 CD
  1023.  
  1024. WINDOWS
  1025.  
  1026. Winmod pro      does protracker                 wmp????.zip
  1027.         cica
  1028.  
  1029. winmod          more stable                     winmod12.zip or similar
  1030.         cica
  1031.  
  1032. Hope this helps, e-mail me if you find any more players and I will add them in
  1033. for the next time mod player requests get a
  1034. little out of hand.
  1035.  
  1036. for mods ftp to wuarchive.wustl.edu and go to the amiga music directory
  1037. (pub/amiga/music/ntsb ?????)  that should do you for
  1038. a while
  1039.  
  1040. see you soon
  1041.  
  1042. Chris.
  1043.  
  1044. -----------------------------------------------------------------------
  1045.