home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / RISCOS / APPS / MUSIC / 0-N / COMPRE.ZIP / !Compress / !Help < prev    next >
Text File  |  1996-04-02  |  23KB  |  508 lines

  1. ############################################################################
  2. #                                                                          #
  3. #                          Sample Compressor v. 1.26                       #
  4. #                                                                          #
  5. #==========================================================================#
  6. #                                                                          #
  7. #                              by David Radford                            #
  8. #                                                                          #
  9. #==========================================================================#
  10. #                                                                          #
  11. #                This program is freeware: it may be copied                #
  12. #            freely as long as no profit is made in the process            #
  13. #                                                                          #
  14. ############################################################################
  15.  
  16. Overview
  17. ========
  18.  
  19. This application allows you to compress (and subsequently decompress)
  20. Armadeus-format sample files. A separate program is available from public
  21. domain libraries, etc. to play back compressed samples directly, and even
  22. play back sequences of compressed samples. Also, a library of compression
  23. routines is provided by !CompUtils so you can even add support for
  24. compressed samples to your own programs.
  25.  
  26.  
  27. Related programs
  28. ================
  29.  
  30. The following packages may also be of interest to you. None of them are
  31. necessary to use !Compress, but they are all freely available from my web
  32. page so you can download them from there if you would like a copy.
  33.  
  34.   !Player    - Plays back compressed samples directly from disc.
  35.   !CompUtils - The raw compression/decompression code for your own use.
  36.   !HeapMan   - The memory manager used in !Compress.
  37.  
  38.  
  39. Why compress samples?
  40. =====================
  41.  
  42. Samples take up an enormous amount of room. Good quality samples (from
  43. 20.833KHz upwards) take up at least 20K for each second. Assuming the
  44. maximum capacity of a standard floppy disc is 780K, then the largest sample
  45. to be stored on disc is 39 seconds. If you want longer samples you have to
  46. reduce the quality. On the other hand, if you compress the data, you can
  47. store much longer samples on a disc. Of course, if you only have a 1
  48. Megabyte machine you would have problems trying to take a sample longer than
  49. 780K anyway. Another use of compressed samples is to save space on a hard
  50. disc. Bulletin boards sysops/users may find this particularly useful, as
  51. less disc space is wasted by these files, and download/upload times are
  52. greatly reduced.
  53.  
  54. Games are another area that can benefit from compressed samples, allowing
  55. either more samples or more code to be crammed onto the disc.
  56.  
  57.  
  58. How to use !Compress
  59. ====================
  60.  
  61. !Compress is pretty intuitive, so the best way to learn to use it is to
  62. actually try it out. Play around with it for a while. You'll soon get the
  63. hang of it. Most of your questions can be answered using Acorn's !Help
  64. application. You can skip most of the rest of this section - it sounds far
  65. more complicated than it actually is. Okay...
  66.  
  67. To compress an Armadeus file drag it to the icon on the icon bar, or any
  68. window belonging to !Compress. A save dialogue box will then appear showing
  69. a compressed sample file (type &350 - 'CSample'). This is a 'permanent'
  70. save box - it stays on the screen until you drag the icon to a directory
  71. display or discard the file by clicking on the box's quit icon. Alter the
  72. filename if desired and drag the file icon to a suitable directory display.
  73. The application will then compress the file and save it under the new name.
  74.  
  75. By the way, a file is *not* loaded when you drag it to !Compress - !Compress
  76. just remembers the file's name and reads the data straight from the disc
  77. when it needs it. This allows you to compress/decompress files that are
  78. physically too large to fit in memory, which can be useful if you're in the
  79. habbit of sampling straight to disc (which is becoming more commonplace
  80. these days). !Compress can only cope with samples of less than 256Mb. If you
  81. want to compress a sample larger than this (what *have* you been doing?!)
  82. you'll have to split it up into chunks of slightly under 256Mb and compress
  83. each chunk separately.
  84.  
  85. When you drag the file from the save box to an appropriate directory
  86. !Compress does not necessarily start compressing the file immediately.
  87. Instead the source filenames (along with their respective destination
  88. filenames) are added to a queue of files to be processed. When !Compress is
  89. not busy doing anything important it takes a file from the queue and
  90. processes it. In fact, it behaves a little like !Printers in background
  91. mode, except that !Printers makes a copy of the file to be processed whereas
  92. !Compress works directly on the original. For this reason it is not possible
  93. to overwrite the original file with the output from !Compress.
  94.  
  95. !Compress allows you to decompress a file in exactly the same way as above.
  96. The output at present is always in Armadeus format (8-bit linear signed) but
  97. this will have to change in future versions when 16-bit support is added.
  98. Can anyone suggest a suitable format? One already in use, that is.
  99.  
  100. The compression/decompression is done mainly in the background. During the
  101. operation the icon on the icon bar changes to an hourglass. It stays like
  102. this until all the files on the queue have been processed, so you can always
  103. tell when !Compress is busy. You can still add files to the queue regardless
  104. of how busy it is.
  105.  
  106.  
  107. File selections, directories and libraries
  108. ==========================================
  109.  
  110. If you drag a selection of files from a directory to !Compress, a save box
  111. will pop up allowing you to save them in one directory, compressing or
  112. decompressing them in the process. In fact, whenever !Compress has a save
  113. box open you can drag extra files in to add them to the selection. Every
  114. item will be stored in the same directory, determined by the save box. As
  115. soon as you drag the directory icon out to a suitable disc, !Compress
  116. transfers the names of the selected files to its internal queue and the save
  117. box disappears.
  118.  
  119. !Compress can also handle directories. If you drag a directory to !Compress
  120. then the moment it is added to the queue the whole directory (and any
  121. sub-directories) will be scanned for Armadeus files or compressed samples
  122. which will be added to the queue. The output of a directory is another
  123. directory holding the processed files, maintaining the directory structure
  124. where appropriate.
  125.  
  126. !Compress can decompress sample libraries, though at the moment it can't
  127. produce new ones. These files have to have a filetype of &352 rather than
  128. Data (&FFD) in order to be recognised. This should change in the future. The
  129. output for a sample library is a directory containing Armadeus files, one
  130. for each sample in the library.
  131.  
  132.  
  133. The status window
  134. =================
  135.  
  136. The status window can be displayed by clicking Select over the icon on the
  137. icon bar. (Clicking with Adjust will open the choices window.)
  138.  
  139. The status window is in two parts: the upper part gives information on the
  140. file currently being processed, and the lower part controls the queue. You
  141. can hide the top part by means of the toggle size icon. Having the top half
  142. invisible or hidden by another window can lead to noticable speed increases,
  143. since there is no need for the Wimp to keep updating the screen as
  144. information changes.
  145.  
  146. (Incidentally, the toggle size icon can be used to hide or reveal the upper
  147. part of the window. The 'full-size/half-size' information is saved along
  148. with all the other choices when you choose 'Save choices' from the icon bar
  149. menu.)
  150.  
  151. The queue management section is the most important part of this window. The
  152. 'Current file' box gives the name of the file currently being processed, and
  153. 'Next file' is the name of the file at the head of the queue (ie. the next
  154. to be processed). Three buttons are provided (and duplicated in the menu) to
  155. control the queue. These are:
  156.  
  157. Abort - Abandons the file currently being processed (if there is one), then
  158.         gives you the option of clearing the queue as well.
  159.  
  160. Pause - Pauses all processing. Files can still be added to the queue while
  161.         paused. 'Pause' changes to 'Continue' - clicking again restarts the
  162.         queue.
  163.  
  164. Skip -  Only appears when activity is paused *and* no file is in the middle
  165.         of being processed. It causes the first file in the queue to be
  166.         discarded. Normally only present after an error has occurred.
  167.  
  168. If an error occurs during processing, the current file is abandoned and
  169. returned to the front of the queue. The queue is then paused. The 'Pause'
  170. button is labelled 'Retry'. The functions of the buttons become:
  171.  
  172. Abort - Discards the remainder of the queue.
  173.  
  174. Skip -  Discards the file that caused the error (ie. the one at the head of
  175.         the queue) then restarts processing.
  176.  
  177. Retry - Attempts to process the offending file again.
  178.         
  179.  
  180. The choices window
  181. ==================
  182.  
  183. This window can be opened by clicking Adjust over the icon on the icon bar,
  184. or choosing 'Choices...' from the icon bar menu.
  185.  
  186. Format
  187. ------
  188.  
  189. Specifies the format in which future compressed samples will be stored.
  190. Changing this will have no effect on files already in the queue, but all
  191. files added to the queue from then on will be compressed using the new
  192. format. For a full description of the pros and cons of each Type, see below.
  193.  
  194. Resolution
  195. ----------
  196.  
  197. Specifies the resolution to be used when compressing samples. Changing this
  198. will not affect any files already in the queue. By reducing the resolution,
  199. some detail is thrown away, but this can lead to significant improvements in
  200. compression. For example, a good quality 8-bit sample that is only going to
  201. be played through the internal speaker can be reduced to 7-bits with no
  202. appreciable loss.
  203.  
  204. There is no point in using a resolution greater than that of the source
  205. file, so using 12-bits when the original was only 8-bits is only going to
  206. work against you. Note that when decompressing the resolution gets rounded
  207. up to the nearest multiple of 8, thus 7-bits becomes 8-bits and 12-bits
  208. becomes 16-bits. Documentation therefore uses '16-bit' to refer to all
  209. resolutions from 9 to 16, and '8-bit' for 8 downwards.
  210.  
  211. Not all sample Types support 16-bit samples, so it may be that everything
  212. above 8-bits will be greyed out.
  213.  
  214. Data
  215. ----
  216.  
  217. You can use this option to determine the raw data format used for storing
  218. the compressed sample: Linear or Logarithmic. Linear is the standard format,
  219. but Logarithmic may lead to slight improvements in compression. Logarithmic
  220. causes a minor drop in quality and only works to a maximum of 8-bits. Not
  221. all sample Types support logarithmic data, but they all support linear.
  222.  
  223. Scale to max volume
  224. -------------------
  225.  
  226. Scales samples to full volume before compressing them. It determines the
  227. maximum amplitude of the sample and attempts to scale it up to 127 if it
  228. can. It's only really of use when compressing a large number of samples and
  229. loading each into a sample editor would be very tedious and time consuming.
  230. Normally you would have this option switched off.
  231.  
  232. Fast processing
  233. ---------------
  234.  
  235. Speeds up processing but slows down the rest of the desktop.
  236.  
  237. Thresholds
  238. ----------
  239.  
  240. !Compress can optionally apply thresholds to the start and end of a sample
  241. before compressing it. This can be useful for stripping off any 'silence'
  242. before or after the main sound, thus tidying it up slightly. Of course,
  243. it's always preferable to do this sort of thing by hand in a sample editor
  244. such as Armadeus, DSEdit, SFXED, etc. Thresholding is intended mainly for
  245. people who want to compress a large number of samples and trimming them all
  246. by hand would be both tedious and unacceptably time-consuming.
  247.  
  248. To apply the threshold to the start of the sample, select the 'Start' icon.
  249. To apply the threshold to the end of the sample as well (or instead) then
  250. select the 'End' icon. Now specify a threshold value in the 'Level' box. If
  251. the box is empty or contains 0, thresholding will not be performed. Valid
  252. threshold levels are in the range 1-127.
  253.  
  254. For example, to strip off *absolute* silence use a threshold of 1. However,
  255. even the best of samplers would have been unable to completely eliminate all
  256. noise, so a more realistic threshold would be 2.
  257.  
  258. When thresholding is enabled, the sample is scanned from the start or the
  259. end (or both) until the amplitude of the sample reaches or exceeds the value
  260. in the 'Level' box. This point then becomes the new start or end of the
  261. sample. The function is normally used for removing unwanted quiet patches at
  262. the start and/or end of samples.
  263.  
  264. NB - If scaling is enabled, thresholding is performed BEFORE scaling.
  265.  
  266. Blocks per group
  267. ----------------
  268.  
  269. This is a performance tweak for sample Types 1-3. See the description of
  270. Type 1 below. The smaller the value, the greater the adaptability of the
  271. compression algorithm, but the greater the overheads.
  272.  
  273. Header size
  274. -----------
  275.  
  276. This is a performance tweak for sample Types 1-3. See the description of
  277. Type 1 below. The larger the value, the larger the overheads, but more
  278. compression methods can be brought to bear on the sample.
  279.  
  280.  
  281. Compression Types
  282. =================
  283.  
  284. There now follows a brief description of each compression algorithm, or
  285. Type. It will help you to determine the best Type for your needs. 'Lossless'
  286. means that the data is unmodified by the compression process, whereas
  287. 'lossy' means there may be slight degradation. Both cases only apply to
  288. linear output - logarithmic compression is always lossy.
  289.  
  290. Type 0
  291. ------
  292.  
  293. The very first algorithm. Samples of this Type will hopefully be obsolete,
  294. because it isn't all that good. !Compress only really supports output of
  295. this Type in case you have any programs which can only read this Type, so
  296. its use should be discouraged.
  297.  
  298. This is mainly lossless, but there may be slight adjustments to some bytes.
  299. Both linear and logarithmic data is supported, but only up to 8 bits. 0-15
  300. zero bytes may be added to the end of the sample to pad it out to a multiple
  301. of 16.
  302.  
  303. Type 1
  304. ------
  305.  
  306. The successor to Type 0. This is an adaptive alogithm that periodically
  307. switches between three different compression methods depending on which
  308. would give the best compression. There is room for a fourth method though
  309. none such exists. If one is added at a later date it will be classed as
  310. Type 3.
  311.  
  312. The 'blocks per group' field in the choices window controls how often
  313. !Compress is allowed to switch between methods. A 'group' is the data
  314. between two such switches, so a high value here makes switching less
  315. frequent and makes the algorithm less adaptable. However, each group
  316. requires a header of either one or two bits, so increasing 'blocks per
  317. group' means that fewer of these bits need to be added. The header size can
  318. be set to either 1 or 2 bits, but setting it to 1 causes !Compress to
  319. consider only 2 of the available 3 compression methods. It's all a case of
  320. swings and roundabouts. The default settings are usually adequate.
  321.  
  322. This is mainly lossless, but there may be tiny adjustments to some bytes
  323. (very, very rarely). These will be completely inaudible so shouldn't be a
  324. problem. Both linear and logarithmic data is supported, but only up to 8
  325. bits. 0-15 zero bytes may be added to the end of the sample to pad it out to
  326. a multiple of 16.
  327.  
  328. Type 2
  329. ------
  330.  
  331. Identical to Type 1, but with a compressed table that may shorten a file by
  332. a handful of bytes compared with Type 1. This is therefore the current
  333. standard, but is 8-bit only.
  334.  
  335. Type 3
  336. ------
  337.  
  338. Not yet created. Essentially Type 2 with the fourth compression method added
  339. (see Type 1 for a information).
  340.  
  341. Type 4
  342. ------
  343.  
  344. A 16-bit ADPCM algorithm. It has a fixed compression ratio of 25% for 16-bit
  345. samples, or 50% for 8-bit ones. To be more precise, it stores all samples
  346. at a resolution of 4-bits, but the nature of the algorithm means that the
  347. expected drop in quality does not occur. There is a slight drop of course,
  348. but it is so small as to be unnoticable.
  349.  
  350. Type 4 is lossy (rather like JPEG), linear-only, and can support up to the
  351. full 16-bits. There is absolutely no point in selecting a resolution lower
  352. than this since it reduces quality and has no effect on the compression
  353. ratio.
  354.  
  355. Note that you can usually get better compression by using Type 2 or 6 at a
  356. resolution of 7-bits, but the quality of a Type 4 sample compressed from
  357. a 16-bit source may well be higher. Type 4 is also much simpler (and
  358. therefore probably quicker) and uses smaller coders/decoders.
  359.  
  360. Type 5
  361. ------
  362.  
  363. Not yet available. Basically Type 4 with entropy coding as an output stage.
  364. In other words, it can be considered as Type 4 followed by Type 6 to make it
  365. even smaller. The compression ratio is therefore variable, but lower than
  366. Type 4 for pretty much all of the time.
  367.  
  368. Type 6
  369. ------
  370.  
  371. A more recent alternative to Type 2. For those in the know it is simply a
  372. case of entropy coding the sample deltas. Compression is roughly the same,
  373. but the statistics tend to vary a lot with different resolutions and data
  374. formats. The decompressor is a little slower than the Type 2 version, making
  375. it less desirable if speed is critical, such as for realtime playback on a
  376. lower-end machine from direct from floppy.
  377.  
  378. The advantage of Type 6 is that it is completely lossless. Both linear and
  379. logarithmic data is supported, but only up to 8-bits. 16-bit support may be
  380. added at a later date, in which case the 16-bit format will be assigned
  381. a new Type.
  382.  
  383.  
  384. History
  385. =======
  386.  
  387. No, this isn't the first release of !Compress, but it is the first for a
  388. year or two, and it is the first to have a history list. Unfortunately I
  389. can't remember all the differences between 1.25 and previous versions, so
  390. you'll have to have a play if you're upgrading. Sorry. I'll keep a proper
  391. history from now on.
  392.  
  393. Possible future upgrades
  394. ------------------------
  395.  
  396. - 16-bit input and output from !Compress will be added as soon as I find a
  397.   suitable alternative to Armadeus files.
  398. - Type 5 support will be added when I get the time.
  399. - Type 3 support might get added if I can think of a way of improving Type 2
  400.   significantly.
  401. - App-to-app file transfer might be possible, but I don't have any modern
  402.   sample editors to test this on so I can't guess.
  403. - Dragging a file into !Compress with Ctrl down opens a window displaying
  404.   info on the file (eg. Type, sample period, size, compression ratio, etc).
  405. - Dragging a file in with Shift held down adds the file to the queue, but
  406.   when finished the source file is deleted.
  407. - A complete overhaul of the front end that allows multiple operations at
  408.   once, so that a Filer-style status window could be used, and !Compress
  409.   would then blend into the desktop a lot more. Also no need for a messy
  410.   queue system.
  411. - A 'best format' option will be added, possibly with a separate control
  412.   window. Files compressed in this format will be compressed in each format
  413.   in turn, writing the output to !Scrap. Then the smallest one generated
  414.   gets copied to the output. Thus you can ensure the best possible
  415.   compression ratio.
  416.  
  417. Version 1.26
  418. ------------
  419.  
  420. - Silly window opening problems fixed. There is a flaw in Risc OS when it
  421.   comes to toggling windows to full size.
  422. - Type 4 support added. Program changed internally to support 16-bit sample
  423.   data. However, no raw 16-bit file format has been decided on to replace
  424.   Armadeus files.
  425.  
  426. Version 1.25
  427. ------------
  428.  
  429. - File processing queue added. Previously only single files or single
  430.   directories could be compressed.
  431. - Can decompress an entire library, though extracting single files and
  432.   modifying libraries is not yet possible.
  433. - Compression now makes use of code from !CompUtils rather than the messy
  434.   hack used before.
  435. - Multiple Type support added for both decompression and compression.
  436. - Tentative 16bit support added (though not yet visible) for when I can find
  437.   a suitable 16bit alternate to Armadeus files.
  438. - Interactive help supported (including menu help).
  439. - RISC OS 3.10 and up only (sorry about this, but things must move on)
  440. - The source file is not loaded directly into memory, but read from the disc
  441.   in chunks. This disposes of the need for virtual memory if your
  442.   requirements are excessive.
  443. - !Compress now uses the small version of HeapMan for all memory management.
  444.   (Contact me if you are interested in a copy. It's a freeware sliding heap
  445.   system with the emphasis on memory efficiency for medium-to-large blocks.
  446.   Static blocks are supported as well. I haven't released it yet because I'm
  447.   bored with writing all the documentation for it. So many projects never
  448.   get released because I *hate* writing the docs.)
  449. - 3D templates to replace the naff, stodgy ones used before.
  450. - Should work perfectly with any desktop font that isn't more than about
  451.   20% wider than the system font.
  452. - The 'enhanced' term has disappeared in favour of 'Linear/Logarithmic'. The
  453.   former term had its origins in the very first version of !Compress, which
  454.   was only intended for producing files for !Player. 'Enhanced' no longer
  455.   has any meaning in the current context.
  456. - Performance information for samples of Types 1 and 2 is now adjustable
  457.   (group size and header size).
  458. - The choices can now be saved as the default settings. Delete the 'Choices'
  459.   file to reset them (do this before passing the program on). Don't get
  460.   confused and delete the 'Default' file instead, or you'll be right up the
  461.   gumtree!
  462.  
  463.  
  464. The author
  465. ==========
  466.  
  467. If you want to send me comments, suggestions, bug reports, etc. (or just
  468. want a chat) you can contact me at any of the following addresses:
  469.  
  470.     Email:   radford@argonet.co.uk
  471.  
  472.     Fidonet: David Radford at 2:250/219.6
  473.  
  474.     Snail:   David Radford
  475.              64 Molyneux Road,
  476.              Westhoughton,
  477.              Bolton,
  478.              Lancs.
  479.              BL5 3EU
  480.              
  481.     Web:     http://www.argonet.co.uk/users/radford/
  482.  
  483. Email is preferred. It's the easiest to forward on, and harder for me to
  484. forget to send a reply (I'm very easily distracted!). Updates will be made
  485. available via my web pages, so check there if you're looking for the
  486. latest version.
  487.  
  488. Please mention the version number of !Compress in any correspondance - your
  489. problems may be the result of using an ancient version of the program. I
  490. regularly find people uploading versions 3 years old to bulletin boards,
  491. which really annoys me, especially if I've just uploaded the latest version
  492. there already.
  493.  
  494.  
  495. Copyright notice
  496. ================
  497.  
  498. This application with all its contents is the copyright of David Radford. It
  499. may be freely distributed by individuals, P.D. libraries, magazine discs,
  500. etc. provided it is copied in whole and unaltered. (Please delete the
  501. Choices file if one is present before passing this program on.) Distribution
  502. of this application with any commercial program is prohibited unless
  503. permission is obtained from me beforehand.
  504.  
  505.                      (c) David Radford 1991-1996
  506.  
  507.  
  508.