home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / msdos / sndbords / proaudio / mvdoc / tpcm.doc < prev    next >
Text File  |  1993-03-09  |  19KB  |  556 lines

  1. TPCM - Test PCM 
  2.  
  3.  
  4. Syntax
  5.  
  6.     tpcm [-T] [-dqmL] [-iname] [-r#l#s] [-v#p#c#] [-B#D#] [-R#] file ...
  7.  
  8.  
  9.  
  10. Options
  11.  
  12.     -T    output on Thunderboard (requires "set BLASTER="
  13.  
  14.     -d    debug mode, output status
  15.     -q    quiet mode (no sound)
  16.     -m    toggle use Monochrome Screen Buffer for DMA 
  17.     -L    Loop sound continuously
  18.  
  19.     -iname    name= name of input PCM file (use -r#, -l# and -s)
  20.  
  21.     -r#    #= default samplerate (decimal) default: 11025
  22.     -l#    #= size of sample in bits (decimal) default: 8
  23.     -s    treat as stereo (default: mono)
  24.  
  25.     -w#    #= delay in clock ticks before timing-out;  default: 4
  26.  
  27.     -R[X]    record mode, X= compression method;  default: none
  28.     -t#    #= number of clock ticks to specify recording-time 
  29.  
  30.     -v[#]    #= video display image # (1-3, see ref) default: 1
  31.     -p#    #= palette # (1-8) default: 2 (6 if -v2 specified)
  32.     -c#    #= palette cycle delay (default: 1)
  33.  
  34.     -B#    #= DMA Buffer size (KB), default: 8K if video, else 16K
  35.     -D#    #= number of DMA Divisions, default: 4 if video, else 8
  36.  
  37.     wavfiles ...    filenames to play (overrides -R and -s)
  38.  
  39.         Note: -iname and "wavfiles ..." are mutually exclusive
  40.  
  41.     -b###    ###= base port address for PAS (for multiple boards)
  42.  
  43.  
  44. Examples
  45.  
  46.     Playback 
  47.  
  48.     C:> tpcm sound.wav
  49.  
  50.         This simply plays the file "sound.wav".
  51.  
  52.     C:> tpcm -T sound.wav
  53.  
  54.         This plays the file "sound.wav" on the ThunderBoard
  55.         (SoundBlaster) DAC.
  56.  
  57.         The "pcm.com" driver looks for "BLASTER=" in the
  58.         environment to configure for the SB.
  59.  
  60.     C:> tpcm -v sound.wav
  61.  
  62.         This displays and plays the file "sound.wav".  
  63.  
  64.     C:> tpcm -v *.wav
  65.  
  66.         This displays and plays all .wav files.
  67.  
  68.     C:> tpcm -vp7c600 *.wav
  69.  
  70.         This displays and plays all .wav files using palette 7
  71.         with a delay of "600" (computer speed dependent).
  72.  
  73.     C:> tpcm -isound.snd -R22050 -s
  74.  
  75.         This plays the PCM file "sound.snd" at 22050Hz in stereo.
  76.  
  77.     C:> tpcm -vm *.wav
  78.  
  79.         This displays and plays all sound files, but uses
  80.         the monochrome screen memory for the DMA buffer.
  81.  
  82.     Recording
  83.  
  84.     C:> tpcm -R x.wav
  85.  
  86.         This records into the file "x.wav" at 11025Hz, 8-bit mono.
  87.  
  88.     C:> tpcm -v -R -r44100 -s -l16 cdqualty.wav
  89.  
  90.         This records into the file "cdqualty.wav" at 44100Hz, 
  91.         16-bit stereo, while displaying the waveform.
  92.  
  93.     C:> tpcm -RA -r44100sl16 cdqualty.cmp
  94.  
  95.         This records into the file "cdqualty.cmp" at 44100Hz,
  96.         16-bit stereo, but compresses using the ALAW method.
  97.  
  98.  
  99. Playback Control
  100.  
  101. During playback of the waveform, several keys are processed:
  102.  
  103.     w    wait for keypress, loops on DMA buffer 
  104.  
  105.     Not particularly glamorous, but can be irritating to those
  106.     around you.
  107.     
  108.     <>    slow/speed playback rate
  109.  
  110.     Use this key to slowdown/speedup the playback/record rate.
  111.  
  112.     m    display "mark", ticks/bytes/samples 
  113.  
  114.     Use this key to display the current offset into the playback/
  115.     record buffer.
  116.  
  117.     l    turn on/off "looping" at end of file
  118.  
  119.  
  120. Display Control
  121.  
  122. During display of the waveform, several keys are processed:
  123.  
  124.     P    palette select - the program waits for either:
  125.         0= no palette, 1 through 8= palettes 1 through 8
  126.  
  127.     c,C    auto cycle delay (+1/10), increasing delay as you hold key
  128.     r    reverse cycle, c,C now decreases delay as you hold key
  129.     SPACE    stop cycling
  130.     f,F    manually cycle one way (256/16 colors)
  131.     b,B    manually cycle the other (256/16 colors)
  132.     u,d    change RGB up/down 1 
  133.     U,D    change RGB up/down 10
  134.     CR    restore palette
  135.     ESC    exit 
  136.  
  137.  
  138. Operation
  139.  
  140. This program no longer requires the TSR pcm.com to be loaded in memory.
  141. Instead, the program will load "pcm.com" it if it is not already so found.  
  142. This requires only that "pcm.com" be found in the "PATH" (tpcm.exe and 
  143. pcm.com should be in the same directory: "\bin" or "\util").
  144.  
  145. Use this program to play .wav files, and display them in real time.
  146. The program will accept compressed 16-bit .wav files (see "cmpwav.exe").
  147.  
  148.     The program will also record using the compression methods
  149.     in "cmpwav.exe" format, although not all are real-time.
  150.  
  151. Use this program to manually specify many parameters, such as the 
  152. location and size of the DMA buffer, samplerate and datasize, IRQ 
  153. activity, and others during the playback or record.
  154.  
  155.  
  156. Options
  157.  
  158. As you can see, there are many options available to affect the startup
  159. conditions of the program.
  160.  
  161. -T
  162.  
  163. Use the -T option to output the sound on the SB part of the PAS, or
  164. on a ThunderBoard, or on a Sound Blaster.
  165.  
  166. You must set the variable "BLASTER" in the environment before pcm.com
  167. loads and before running tpcm.exe.  The following defines the meaning
  168. of this variable:
  169.  
  170.     C:> set BLASTER=A220 D1 I5 T3
  171.                |       | |  ||    || ||
  172.                |    | |  ||    || `--- Product Number "3"
  173.                |       | |  ||    `------ IRQ Number "5"
  174.                |       | |  `-w-------- DMA Channel "1"
  175.                |       `-------------- Port Address "220h"
  176.                `------------------- Variable Name "BLASTER"
  177.  
  178. -d 
  179.  
  180. Use the -d option to observe the queueing of data and the waiting for
  181. DMA to finish.  When redirecting this output to a file on a ramdrive,
  182. you can see how much time there is available for additional processing.
  183.  
  184. Use this option when attempting to locate valid DMA/IRQ combinations.
  185. Display and Sound Output from the program will help you determine valid
  186. combinations.  This is useful with the "proas.exe" program, which will
  187. reprogram the card to any dma/irq combination.
  188.  
  189. -q
  190.  
  191. Use the -q option to suppress the output of sound and have the program
  192. simply run through the file.  Note that there will be no display (if the 
  193. -v option was specified) as there is no DMA activity and so no User 
  194. Function calls.  Use the -d option to see the progress of loading the
  195. file and the associated simulated DMA transfers.
  196.  
  197. -m
  198.  
  199. Use the -m option to cause the program to use monochrome screen memory
  200. for the DMA buffer.  Note: this memory may be used as DOS UMB (loadhigh),
  201. and overwriting this area with sound data is not suggested!  However, if 
  202. you do have a monochrome monitor, then you can watch the data slam by.  
  203.  
  204.     Why use the monochrome screen buffer for DMA?  Well, nowadays,
  205.     with VGA and multi-megabyte-memory machines, the B segment is
  206.     a nice 32K block of memory commonly unused, and perfect for
  207.     scratch memory (like sound, where overwrites are merely noisy,
  208.     not fatal).
  209.  
  210.     Unfortunately, this memory is too slow for use with 44,100 Hz
  211.     sounds, so this is not a perfect solution.  Also, some machines
  212.     generate a high-frequency pitch when accessing this memory 
  213.     during DMA transfers.
  214.  
  215. -L
  216.  
  217. Use the -L option to loop on the sound file continuously.  Press ESCAPE
  218. to exit the loop and proceed to the next file (if any).
  219.  
  220. Use this option with the 'm' key to display the current timeticks/bytes/
  221. samples of playback or record.  This gives you the ability to jot notes
  222. on paper of where interesting clips occur in a sound file.  
  223.  
  224.     While looping, you can press the "<>" keys (or ",.") to 
  225.     slowdown or speedup the samplerate, and so achieve a 
  226.     higher degree of resolution when specifying "marks".
  227.  
  228. -i
  229.  
  230. Use the -i option to specify a filename (no DOS wildcards allowed).  
  231. Use the -s, -l and -r options to specify stereo, the sample size in bits, 
  232. and the sample rate.
  233.  
  234. -r
  235.  
  236. Use the -r option to specify the samplerate for .wav files specified 
  237. with the -i option, and for non .wav files, and for recording.  This 
  238. value can range from 4000 to 88200 for mono files, and 8000 to 44100 
  239. for stereo files.
  240.  
  241. -l
  242.  
  243. Use the -l option to specify the bit-size of the ram data samples.
  244. Use this option when processing sound files or by using the "-i" option.
  245.  
  246. -s 
  247.  
  248. Use the -s option to cause the program to treat the -i specified file or
  249. raw PCM files as stereo.  This option has no effect on files whose 
  250. formats are known, unless the file is specified using the -i option.
  251.  
  252. -v
  253. Use the -v option to select a picture to display:
  254.  
  255.     1    tpcm.scr    256-color gradient
  256.     2    tpcm2.scr    me
  257.     3    tpcm3.scr    lame-looking "deck" with useless knobs
  258.  
  259.     These must be simple "memory dump" files, 320x200x8bit.
  260.  
  261. -B
  262.  
  263. Use the -B option to specify the size of the DMA buffer in KB.  This
  264. number is expressed in decimal, and should be either 4, 8, 16, 32 or 64.
  265. This number is forced to at least 4, unless the -v option is given, in
  266. which case it is made to be 4 for stereo output, and 2 for mono.
  267.  
  268. This number usually specifies the DMA buffer size in KB, but if the value
  269. given is greater than 64, then it specifies the actual buffer size.
  270.  
  271.     To get a 1-second DMA buffer with a 22050Hz, 16-bit mono 
  272.     sound, use "-B44100".
  273.  
  274. -D
  275.  
  276. Use the -D option to specify the number of parititions for the DMA buffer.
  277. This number is expressed in decimal, and should be a power of 2 greater
  278. than 1.  If the -V option is given, then it is made to be 2 in order to
  279. ensure synchronous sound and display output.
  280.  
  281.     The DMA buffer routines in pcm.com accept buffer sizes that
  282.     are not multiples of 1024, and recognize treat any passed
  283.     size that is greater than 0xFF to be the size in bytes 
  284.     instead of Kbytes).  Thus -B15750 is valid.
  285.  
  286.     Also, pcm.com handles number-of-divisions of the DMA buffer
  287.     that are not powers of 2.  Thus, -D5 is valid.
  288.  
  289.     Note that the size of the DMA buffer should be a multiple 
  290.     of the number of divisions to prevent buffer overruns.
  291.  
  292. Mono/Stereo display is selected automatically according to the channels
  293. for recognized .wav files.
  294.  
  295. You can specify multiple files to process, if the -i option is not also
  296. used, by naming them at the end of the command line.  You can use DOS
  297. wildcards: "tpcm *.wav".  These files are examined to determine their
  298. type, and .wav files have their format information used to specify the
  299. number of channels and samplerate, but the command line parameters or
  300. default values are used for non-.wav files.
  301.  
  302. Record Mode
  303.  
  304. Use the -R to put the program into "record" mode.
  305.  
  306. Most options are valid in this mode, with exception of -l (looping) and
  307. -iname ("input file name"), and that only one filename is processed.
  308.  
  309. The program will attempt to compress in real-time using the format 
  310. specified with the -R option:
  311.  
  312.     -RA    - use ALAW
  313.     -RM    - use MULAW
  314.     -RI    - use IMA
  315.     -RW    - use Microsoft ADPCM (not real-time - but implemented).
  316.     -RP    - no compression
  317.  
  318. This output format is compatible with the input, so you can always use
  319. tpcm to play/record these files, and "cmpwav.exe" (from MediaVision) to
  320. control their format.
  321.  
  322. Return Value
  323.  
  324.     Playback
  325.  
  326.     errorlevel 0 if the file played with no error.
  327.     errorlevel 1 if the file played but not properly (IRQ mismatch)
  328.     errorlevel 255 if it failed to find or load the pcm.com TSR.
  329.     other nonzero errorlevel for syntax error, bad memory, etc.
  330.  
  331.     Record
  332.  
  333.     errorlevel 0 if the file recorded with no error.
  334.     other nonzero errorlevel for syntax error, bad memory, etc.
  335.  
  336.     
  337. Requirements
  338.  
  339. MediaVision Pro Audio Spectrum (any model).
  340.  
  341. This program requires a graphics monitor with the ability to display 
  342. 320x200x256 colors in order to display the waveform.
  343.  
  344.  
  345. Secrets
  346.  
  347. DMA Buffer Location
  348.  
  349. It is possible to specify the location of the DMA buffer manually using
  350. two options not documented above, however, this can be very dangerous.
  351. Use the -S# and -O# options to specify the segment and offset (in hex)
  352. of the DMA buffer (use the -B# and -D# option to specify the size and
  353. divisions).  You can then have the program play or record and direct 
  354. the DMA buffer to A000:0, thus seeing the PCM data appear on the 
  355. screen in graphics mode.  Interesting?  Maybe, but since we can, why not?
  356.  
  357.     If you have the "setdma.exe" and "freedma.exe" programs, 
  358.     you can use them to allocate and deallocate a 16K block of 
  359.     memory from the very top (thereby eliminating any waste).  
  360.     The "setdma.exe" program displays the segment to specify 
  361.     with the tpcm -S option (and to "freedma.exe").
  362.  
  363.     The -S and -O options ask you to confirm that you are manually
  364.     specifying these values to prevent accidental confusion with
  365.     the -s and -o options, unless you insert a "!" between the "S"
  366.     or "O", as in "-S!####" or "-O!####".
  367.  
  368. Using monochrome screen memory as the DMA buffer can be "noisy".
  369.  
  370.  
  371. Multiple PAS Boards
  372.  
  373. Also, you can specify a "Board Address" to gain access to multiple
  374. PAS boards by using "-b###".  Each board requires an instance of 
  375. "pcm.com" or "pcmfun.com" loaded with the same board address.
  376.  
  377. "tpcm.exe" will use the first available pcm.com (pcmfun.com) if no
  378. particular board address is specified.  If an address is given, then
  379. the first pcm.com (pcmfun.com) that controls that board will be used.
  380. If no suitable handler is found, then the program will install "pcm.com"
  381. for that particular board address.  The default address is 388h, but
  382. the TSR will locate at the first found address.
  383.  
  384.     The following sequence will demonstrate the logic implemented:
  385.  
  386.     C:> proas -b388 d:5 q:15 s:1,220,1,5 v:70
  387.     C:> proas -b384 d:6 q:11 s:1,230,3,7 v:70
  388.  
  389.         These two lines initialize two PAS16 boards, 
  390.         one at 384h, one at 388h
  391.  
  392.     C:> tpcm sound.wav        # no handler, load pcm.com at 388h
  393.  
  394.         With no handler installed, the program loads pcm.com,
  395.         and with no board address specified, the default is 388h.
  396.         
  397.     C:> tpcm -b384h    sound.wav    # no handler, load pcm.com at 384h
  398.  
  399.         With no handler installed for the particular address, 
  400.         pcm.com is loaded for that particular board.
  401.  
  402.     C:> pcm -b384 -i        # install handler for board 384h
  403.  
  404.         When a handler is installed, that board is the default
  405.         board when no address is specified.
  406.  
  407.     C:> tpcm sound.wav        # is handler, plays on board 384h
  408.  
  409.         With a handler installed, and no board address specified,
  410.         the sound is played on that handler's board.
  411.  
  412.     C:> tpcm -b388 sound.wav    # no handler, load pcm.com at 388h
  413.  
  414.         A handler is installed, but not for the specified board,
  415.         so pcm.com is loaded and the sound plays on that board.
  416.  
  417.     C:> pcm -b384 -u        # uninstall handler for board 384h
  418.     C:> pcm -b388 -i        # install handler for board 388h
  419.  
  420.         The default board to play on when no address is specified
  421.         was 384h, and is now 388h.
  422.  
  423.     C:> tpcm sound.wav        # is handler, plays on board 388h
  424.  
  425.         No address specified, plays on first handler's board.
  426.  
  427.     C:> tpcm -b384 sound.wav    # no handler, load pcm.com at 384h
  428.  
  429.         No handler for that board installed, so pcm.com is
  430.         loaded and the sound is output on that board.
  431.  
  432.     C:> pcm -b384 -i        # install handler for board 384h
  433.  
  434.         Now there are two handlers installed, one for each board
  435.  
  436.     C:> tpcm sound.wav        # play on first found (384h PAS)
  437.  
  438.         The first handler found (is the last one loaded) is at
  439.         at 384h, so since no address is specified, output comes
  440.         out of the board at 384h.
  441.  
  442.     C:> tpcm -b384 -T sblast.wav    # play sound on board 384h TB
  443.  
  444.         Address specified, and handler exists.
  445.  
  446.     C:> proas -b380 d:7 q:12 s:1,220,0,3
  447.     C:> pcm -b380 -i
  448.  
  449.         Uh, oh, another board is initialized, at 380h, and
  450.         a handler is installed for it. 
  451.  
  452.         Since this is the last handler, it is the first
  453.         found, and so is the default board when no address
  454.         is specified.
  455.  
  456.     C:> tpcm sound.wav
  457.  
  458.         No address specified, output on 380h.
  459.  
  460.     
  461. With "srs.exe", you can use the 'm' Mark valuse to cut sounds clips 
  462. into other files, and then add them together to create a new sound 
  463. track, all from the command line.  
  464.  
  465.     C:> tpcm -L sound.wav
  466.     ... during playback, slow samplerate using "<" ...
  467.     ... during loopback, press the 'm' key to display 
  468.     ... ticks/bytes/samples offset at desired points ...
  469.  
  470.     C:> srs save from sound.wav at 44376 upto 83000 into sound.0
  471.     ... 44376 is the byte offset to start cutting ...
  472.     ... 83000 is the byte offset of the end of the cut ...
  473.     
  474.     C:> tpcm -L sound.0
  475.     ... loop on the cut clip ...
  476.  
  477.     C:> srs add sound.0 into soundtrk.wav at 10 secs save
  478.     ... add the sound clip into the sound track being edited ...
  479.  
  480.  
  481. New Stuff
  482.  
  483. -T, the Thunder Board (Sound Blaster) output. 
  484. "<>" during playback.
  485. pcmfun.com interface.
  486. multiple boards.
  487.  
  488. Programmer Output
  489.  
  490. dasj;l;kare-0423m saldf, 3129;as,.4pdfp
  491.  
  492. I did that!
  493.  
  494. Whew!  If you are reading this, then you are my kind of user!  
  495.  
  496. I feel like I can tell you things... things I haven't told anyone else!
  497. Except for everyone who will listen, that is!
  498.  
  499. Seriously (why do I keep backspacing and undoing, instead of just 
  500. getting on with it!).  (Okay, so I just finished the "copyright" stuff
  501. below... talk about conjuctive phrasing!)
  502.  
  503. Okay, so what I really want to say is, if you have gotten this far, 
  504. don't stop now!  
  505.  
  506. First, a little about the programmer of this stuff.  Me.  SRS.EXE, 
  507. PCM.COM and PCMFUN.COM, TPCM.EXE, proas.exe, WAVCMP.LIB... all I can
  508. say is: "there you go".
  509.  
  510. I use'm all the time.
  511.  
  512. My only regret is that I only use them to build them!  I wish, instead,
  513. I was in your place (maybe), and had cause to use them!  I can imagine
  514. being a recording engineer, or database programmer, and having a real
  515. need for this stuff.  Or, as an independent developer writing a game or
  516. other application.
  517.  
  518. Tell me about some other program that will record at 88,200 Hz, please!
  519. Or will stat all .wav or .voc files, please!  Or (un)compress!  
  520.  
  521. Now that I can play the SB and record it and all other inputs on the 
  522. PAS, in the background(!), well, my head is five feet wide!
  523.  
  524. Here's a little joke I played for awhile: I recorded random FM at 
  525. 88,200, then played it back at 12,000-4,000 (nearly so-to-truly subsonic)
  526. whenever people came into my cube regarding bugs in "-------.exe", in the
  527. background, so no one knew!  (Maybe I make people uncomfortable, anyway.)
  528.  
  529. The following text is merely for informational purposes, and really only
  530. for those that use "tail" on documents to see what is at the end, and I
  531. don't want those of you who read all of the above to be cheated by those
  532. who skip to the last screen!
  533.  
  534. This software is copyrighted, and unauthorized use or application may or 
  535. may not warrant or require remedy or remuneration if unlawful or illegal 
  536. copies or replications are made or distributed, subject to civil or
  537. criminal penalties.
  538.  
  539. If you would like to become a registered user of this and its associated
  540. softwar, please post some mail that includes your first name and your 
  541. age to
  542.  
  543.     Media Vision 
  544.     3185 Laurelview Court
  545.     Fremont, CA  94538
  546.     Attn: Software Engineering, DOS
  547.  
  548. or fax the same to 
  549.  
  550.     (510) 226-2582
  551.  
  552. ----------------------------------------------------------------------------
  553. Copyright (c) 1992-1993.  Media Vision, Inc.  All Rights Reserved.
  554. Programmer: Bart Crane
  555.  
  556.