home *** CD-ROM | disk | FTP | other *** search
/ Science & Nature: Materials / Acorn_YITM_ScienceAndNature2_Materials.iso / _sci2 / _armovie / documents / join < prev    next >
Text File  |  1994-01-19  |  21KB  |  392 lines

  1.  
  2.                               HOW TO RUN JOIN
  3.                               +++++++++++++++
  4.   
  5.   
  6.                         Related Documents: ToRunDiff
  7.                                            AE7doc
  8.                                            Extract (Version 2.02, 16 Dec. 1993).
  9.  
  10. Author:    CRose
  11. Date:      19 January, 1994.
  12. Version:   2.04
  13. File Name: join
  14.  
  15.  
  16.                    
  17.  
  18. WHAT DOES JOIN DO? - takes the components of an ARMovie and joins them together
  19. -----------------    to produce ARMovie files with or without video images 
  20.                      and with or without sound.  It can also produce ARMovie
  21.                      files with multiple sound tracks if video images are
  22.                      required.
  23.   
  24.  
  25. THE SOURCE DATA - you need a directory containing the following:
  26. ---------------
  27.   
  28. *  a file called "Header"  (more info. further down).
  29. *  a sprite.
  30. *  Images: [optional - without this data the ARMovie file generated will 
  31.                        be sound only and will contain only one sound track]
  32.                
  33.    an Images0 directory containing image files called 00, 01, 02, 03,
  34.    and so on up to a maximum of 74. After this you need to create 
  35.    another Images directory called Images1 and then carry on with 
  36.    00,01,02, etc. again.
  37.  
  38. *  Keys data:  Same naming convention as above.  i.e. e.g. Keys0.00,
  39.    Keys0.01, etc.
  40.  
  41. *  Sound data: sound can be read from an already existing ARMovie file
  42.    or by default from data format files. 
  43.    
  44.       DATA FORMAT FILES:  the following files must exist in the source
  45.                           directory:
  46.                           
  47.         For 8 bits per sample (exponential) - (line 13 in the header file):
  48.         Need at least one sound track (obviously).
  49.         
  50.                           Sound       /* 1st soundtrack */
  51.                           Sound2      /* 2nd soundtrack */
  52.                           Sound3      /* and so on ...  */
  53.                           Sound4      
  54.                            etc.
  55.                    
  56.         For 16 bits per sample - (line 13 in header file):
  57.         As above: 
  58.                           Samples
  59.                           Samples2
  60.                           Samples3
  61.                            etc.
  62.                            
  63.         For 4 bits per sample - (line 13 in header file):
  64.         As above:                               
  65.                           Adpcm
  66.                           Adpcm2
  67.                            etc.
  68.                        
  69.       ARMOVIE FILE: join must be supplied with the full path name
  70.                     of this file on the command line.
  71.       
  72.       
  73. THE HEADER FILE:
  74. ---------------
  75.     
  76.       The Header file used by Join must comply with the following format (examples
  77.       further below), and it must be kept in the same directory as the sprite, 
  78.       image, keys, and sound data (see section above - "The Source Data").  If
  79.       more than one sound track is required then lines 10 to 13 will be slightly
  80.       different.  This is explained under the heading "Multiple Sound Tracks" 
  81.       further down. 
  82.             
  83.     String          ARMovie
  84.     String          Movie name
  85.     String          date and copyright details
  86.     String          author and other details
  87.     String          video compression format identifier     [1][0 -> no video]
  88.     Decimal number  x size in pixels
  89.     Decimal number  y size in pixels
  90.     Decimal number  z pixel depth in bits [16 or 8]
  91.     Decimal number  number of frames per second to project at
  92.     String          sound compression format identifier     [0 -> no sound]
  93.     Decimal number  sound replay rate in Hz (or fractions of)
  94.     Decimal number  number of sound channels recorded ("reversed" if l<->r)
  95.     Decimal number  sound precision ("linear" if linear, "unsigned" if unsigned)
  96.     Decimal number  number of frames in a chunk 
  97.                     
  98.         HEADER EXAMPLE (one sound track only):
  99.  
  100.     ARMovie
  101.     The Concert
  102.     (c) Notts University 1991
  103.     Created by Notts University, digitised by Acorn Computers
  104.     1
  105.     160 pixels
  106.     128 pixels
  107.     16 bits per pixel 
  108.     25 frames per second
  109.     1
  110.     12000 Hz samples
  111.     1 channel
  112.     8 bits per sample (exponential)
  113.     50 frames per chunk            
  114.         
  115.         Multiple Sound Tracks
  116.     ---------------------
  117.  
  118.     The single video track can have an arbitary number of sound tracks associated
  119.     with it. Extra sound track data for each sound parameter follows the sound
  120.     track marker "|" plus the sound track number. Different sound tracks can have
  121.     completely different parameters - compression format, sample rate, number of
  122.     channels, number of bits per sample. The first sound track is played by 
  123.     default    and does not follow a |1 marker - thus the first additional sound 
  124.     track has parameters following a |2 marker.
  125.  
  126.     HEADER EXAMPLE (multiple sound tracks):
  127.     
  128.     ARMovie
  129.     The Concert
  130.     (c) Notts University 1991
  131.     Created by Notts University, digitised by Acorn Computers
  132.     1
  133.     160 pixels
  134.     128 pixels
  135.     16 bits per pixel 
  136.     25 frames per second
  137.     1                               |2   1                     |3  1
  138.     12000 Hz samples                |2   16000                 |3  20000
  139.     1 channel                       |2   2 channels            |3  2 channels
  140.     8 bits per sample (exponential) |2   16 bits per sample    |3  4 bits (adpcm)
  141.     50 frames per chunk            
  142.                         
  143.  
  144.                         
  145. THE COMMAND LINE   
  146. ----------------
  147.  
  148.         Join must be run on the command line.  Parameters for running the 
  149.         program are shown below, followed by specific examples.
  150.         
  151.         -help               : on-line help (limited in comparison with this text).
  152.         
  153.         -dest f             : set destination file name (default 'JoinOp').
  154.         
  155.         -index N            : select different Header, Images, Keys combination.
  156.                               
  157.         -nokeys             : prevent the key frames being written to the new
  158.                               ARMovie generated by join.  (You can see whether 
  159.                               or not an ARMovie has keys by looking at the end 
  160.                               of the header section in the ARMovie).
  161.         
  162.         -size N             : set chunk alignment size to N.  Default is 2047 bytes.
  163.                               (The smaller the value of N, the smaller the size of
  164.                               the output file generated by join).  This is an
  165.                               optimization parameter, the value of which depends
  166.                               upon the media being used.   
  167.         
  168.         -source f           : set name of source file directory.
  169.         
  170.         -armovie n file/s   : name of ARMovie sound source file/s.  'n' is the 
  171.                               number of files specified, for example, -armovie 3 
  172.                               $.dir1.file1 $.dir1.file2 $.dir2.file3 (all on the 
  173.                               same line). "file1" will provide the first sound 
  174.                               track, "file2" will provide the second sound track, 
  175.                               and "file3" will provide the third sound track. If
  176.                               e.g. file1 provided both sound tracks 1 and 2 and 
  177.                               file2 provided the third sound track, then
  178.                               the -armovie parameter list would be -armovie 2
  179.                               $.dir1.file1 $.dir1.file2 . n simply tells join how
  180.                               many ARMovie sound source files you are about to
  181.                               specify.  It is nothing to do with the number of 
  182.                               sound tracks. Examples are included below.
  183.   
  184.         -adpcm              : compress Samples sound data to Adpcm (i.e. 16 bits
  185.                               per sample to 4 bits per sample).  This applies
  186.                               if the sound exists in a sound file as opposed to
  187.                               being read in from another ARMovie.  Line 13 in 
  188.                               your header should read as 16 bits per sample, not
  189.                               4 bits per sample.  If you specify 16 bits per
  190.                               sample in your header, join will look for a Samples
  191.                               file in the source directory,  convert the data
  192.                               to adpcm and will adjust line 13.  If you change
  193.                               line 13 yourself, join will look for an Adpcm
  194.                               file instead of a Samples file, i.e. the wrong
  195.                               source data will be read in, if it exists in the
  196.                               first place.  To convert sound from an ARMovie
  197.                               file, use extract to extract the sound data and
  198.                               then use join with the -adpcm parameter.  At 
  199.                               present join will probably bomb out if it runs
  200.                               out of source data in converting to adpcm and
  201.                               conversions can only be done in mono.  Stereo
  202.                               conversion will be possible soon.
  203.                               
  204.                               
  205. EXAMPLES OF HOW TO RUN JOIN:
  206. ---------------------------
  207.  
  208.    Example 1:  join -help
  209.    ---------    
  210.                This will provide on-line help.  It will also tell you the version
  211.                number and date of the program.  Obviously, this document provides
  212.                more information than join -help does.
  213.                
  214.    Example 2:  join -source $.DataToJoin 
  215.    ---------
  216.                This will generate an ARMovie file using source data held in the
  217.                directory $.DataToJoin (source data being the header, sprite,
  218.                and so on as explained at the beginning of this document).  By
  219.                default, the name of the new ARMovie file will be "JoinOp".  The
  220.                information which you supply in the header determines whether or
  221.                not the ARMovie file will have sound, whether or not it will have 
  222.                image data, what the sound replay rate will be, and so on (see 
  223.                Header sections above).  If line ten of your header is 0 then 
  224.                join will not look for any sound data but if it is 1 then join 
  225.                will expect to see one or more sound files in $.DataToJoin or it
  226.                will expect you to specify one or more ARMovie sound source files
  227.                (examples 4,5, and 7 below).
  228.                (If you want more than one sound track do not forget to indicate
  229.                this in your header - see sub heading "Multiple Sound Tracks"
  230.                above).
  231.                
  232.    Example 3:  join -source $.DataToJoin -dest $.Movies.Elephants
  233.    ---------   
  234.                This will generate an ARMovie file called "Elephants" in the 
  235.                directory called $.Movies, using source data held in the 
  236.                directory $.DataToJoin.  Explanation is identical to example 2
  237.                above with the exception that the name of the generated ARMovie
  238.                file no longer defaults to "JoinOp".
  239.                
  240.    Example 4:  join -source $.DataToJoin -armovie 3 cdfs::replay_demo.$.movies.
  241.    ---------   shuttle $.DataToJoin.Planes $.Movies.Elephants (all on one line).
  242.    
  243.                This will generate an ARMovie file called "JoinOp" using the source
  244.                data held in $.DataToJoin.  The -armovie parameter instructs join to
  245.                use sound from other ARMovie files rather than use sound from ordinary
  246.                sound files.  ARMovie file/s acting as the sound source do not 
  247.                necessarily have to live in the same directory as all the other source
  248.                data, which is why you must specify full path names as shown in this
  249.                example.  So this example will generate an ARMovie file with three
  250.                sound tracks.  The first sound track will be extracted from cdfs::
  251.                replay_demo.$.movies.shuttle, the second sound track will be 
  252.                extracted from $.DataToJoin.Planes, and the third sound track will 
  253.                be extracted from $.Movies.Elephants.  Your header file in $.DataTo
  254.                Join must also indicate that there is to be three sound tracks (refer
  255.                to the sub heading - "Multiple Sound Tracks" above).  You should look 
  256.                at the header sections in your ARMovie sound source files to see 
  257.                what the sound replay rates are and what the sound precision should 
  258.                be for a particular sound track in your own header.  The number 3 
  259.                after -armovie simply tells join that there are three sound file 
  260.                parameters to read next.  It does not tell join anything about the 
  261.                number of sound tracks.  Example 7 is useful at this point.
  262.                
  263.    Example 5:  join -source $.DataToJoin -armovie 2 cdfs::replay_demo.$.movies.horses
  264.    ---------   cdfs::replay_demo.$.movies.shuttle
  265.                
  266.                This example is identical to example 4 above with the exception that
  267.                it will generate an ARMovie file called "JoinOp" with two sound 
  268.                tracks instead of three.  Hence 2 follows -armovie instead of the 
  269.                previous number 3. You must also ensure that your header file in 
  270.                $.DataToJoin complies with what you have specified on the command 
  271.                line ie. in this example you are telling join to look for two sound 
  272.                tracks so lines ten to thirteen of your header must indicate this 
  273.                (refer to the sub heading - "Multiple Sound Tracks" above). You 
  274.                should look at the header sections in your ARMovie sound source files 
  275.                to see what the sound replay rates are and what the sound precision 
  276.                should be for a particular sound track in your own header).
  277.                
  278.    Example 6:  join -source $.JoinData -index 3 -dest $.Movies.horses
  279.    ---------
  280.                This will generate an ARMovie file called $.Movies.horses using 
  281.                source data found in the directory $.JoinData but the -index
  282.                parameter tells join to select a different set of images and
  283.                keys and a different header.  In this case, join will look for
  284.                the directories $.JoinData.3Images0 and $.JoinData.3Keys0, and
  285.                it will read from the header called $.JoinData.3Header .
  286.                
  287.    Example 7:  join -source $.JoinData -armovie 2 $.oldmovie $.Movies.horses
  288.    ---------   
  289.                You could do this if your header indicated that two sound tracks
  290.                were required and one sound track was in $.oldmovie, the other in
  291.                $.Movies.horses .  You would also use this join command if your
  292.                header indicated that three sound tracks were required, two of
  293.                the sound tracks being in $.oldmovie and the third one being in
  294.                $.Movies.horses (or one track being in oldmovie, the other two
  295.                being in horses).  The number 2 tells join how many ARMovie sound
  296.                source files it must use.  It does not tell join anything about
  297.                the number of sound tracks.  Similarly, if your header indicated
  298.                that five sound tracks were required and $.oldmovie had five
  299.                sound tracks, you would say join -source $.JoinData -armovie 1
  300.                $.oldmovie .
  301.                
  302.    
  303.    
  304.         
  305. OTHER POINTS WORTH MENTIONING / TROUBLESHOOTING:              
  306. -----------------------------------------------                                
  307.  
  308.  Join will not read image data from anywhere but the image files in the source
  309.  directory.  It cannot read image data from another ARMovie file.  If you do 
  310.  want to use image files from another ARMovie file this can be done via use of the
  311.  Extract program mentioned at the end of this document.                             
  312.  
  313.  If there are no image files, only one sound track will be generated so the header 
  314.  information should only ask for 1 sound track and line 5 of the header should be 
  315.  zero.
  316.                                 
  317.  If ARMovie files are the sound source, lines 11 to 13 inclusive in header sections
  318.  of these source files should correspond to the relevent track numbers in your own
  319.  header (see sub-heading "Multiple Sound Tracks" above).
  320.  
  321.  If you use the -armovie parameter and the ARMovie file generated by join is 
  322.  obviously garbage, play back the original ARMovie source file/s and check that 
  323.  none of these are corrupt (e.g. if join was stopped by the user before completion 
  324.  then the  generated ARMovie file will be corrupt and will therefore give problems 
  325.  if it is later used by join again as a source for the sound data in  generating 
  326.  another ARMovie file). 
  327.  
  328.  If you play back the newly generated ARMovie file and it freezes unexpectedly, make
  329.  sure that you haven't attempted to run the movie with an invalid sound track number.
  330.  e.g. if you played the ARMovie by typing $.JoinOp -tracks 3 on the command line and 
  331.  JoinOp did not have a third sound track this would cause the movie to freeze at the 
  332.  start.
  333.                                                        
  334.  If join warns that it has run out of sound data for a particular sound track and 
  335.  you think it shouldn't have, check that the replay rate (line 11) in your header 
  336.  is identical to the replay rate given in the ARMovie sound source file for that 
  337.  particular track (this of course does not apply if you are not using the -armovie 
  338.  parameter with join).  e.g. if you use an ARMovie file with a sound track created 
  339.  at 12000 Hz and in your own header you indicate that this track is now to be 
  340.  created at 13000 Hz, you will obviously run out of sound data if the files were 
  341.  previously identical in size.  This does not matter as join will adjust the
  342.  catalogue information resulting in a period of silence at the end.
  343.                       
  344.  You cannot output to the same ARMovie file that you are reading sound data from
  345.  (this applies to use of the -armovie parameter). e.g. join -source $.DataToJoin 
  346.  -dest $.runfile -armovie $.runfile is illegal.  Join will tell you that it is 
  347.  unable to open $.runfile.
  348.  
  349.  If -armovie is given on the command line, join will not look for local Sound,
  350.  Samples, or Adpcm files.  If you want to generate an Armovie using sound from
  351.  an already existing Armovie AND from a Sound, Samples, or Adpcm file, you should
  352.  first convert the Sound, Samples, or Adpcm file into an Armovie (using join)
  353.  and then simply join the two together.
  354.  
  355.  If the files given after -armovie have multiple sound tracks, join will try to
  356.  use all the tracks in accordance with your header (see example 7 above). For
  357.  example, if your header indicates that the new Armovie will have six sound
  358.  tracks, you could use three Armovie files as the sound source.  The first 
  359.  Armovie might have three sound tracks, the second might have two, and the
  360.  third would have only one, adding up to give a total of six tracks as specified
  361.  in your header.  The total number of sound tracks in the source files must
  362.  add up to the number of sound tracks you specify in your header.  Alternatively,
  363.  for a six track header, you could use one Armovie with five sound tracks and
  364.  another Armovie with only one sound track, or you could use two Armovies each
  365.  with three sound tracks, and so on.
  366.                                 
  367.  If join is terminated prematurely (e.g. user presses escape), an exception
  368.  handler will ensure that any open files are closed.  For obvious reasons this
  369.  only applies to files opened by join.                               
  370.  
  371.  There are two classes of error message.  Warning errors may be ignored 
  372.  depending on context and whether or not a fatal error follows.  Fatal errors
  373.  will actually stop the program at that point.  As mentioned above, any files
  374.  left open by join will be closed by the exception handler.
  375.  
  376.  As well as taking in parameters from the command line, join will also look for
  377.  parameters held in the environment variable join$ExtraArgs.  The split can 
  378.  occur anywhere.  e.g. join -source $.DataToJoin -de may be entered on the command
  379.  line, while st $.runit may be held in join$ExtraArgs.  join will simply join the
  380.  two together to produce join -source $.DataTojoin -dest $.runit.
  381.                                 
  382.  A separate program exists called "extract", which does the reverse of what "Join" 
  383.  does.  "Extract" can take an ARMovie file and extract its header, sprite, keys (if 
  384.  there are any), sound track/s, and images.  It is perfectly acceptable for this
  385.  extracted data to be used by Join. (Extract is accompanied by written documentation
  386.  which you should read if you have never used it before). If you want join to use 
  387.  sound tracks from other ARMovie files join can do this directly (as mentioned many 
  388.  times above) using the -armovie parameter.  But if you want join to use image data 
  389.  from other ARMovie files you must use Extract to generate the image data which can
  390.  then be used by join.                        
  391.                               
  392.   ===================================================================================