home *** CD-ROM | disk | FTP | other *** search
/ Da Capo / da_capo_vol1.bin / programs / amiga / midi / smusmidi / smusmidi.doc < prev    next >
Text File  |  1992-07-10  |  11KB  |  281 lines

  1.  
  2. SMUSMIDI User Manual
  3.  
  4. SMUSMIDI 1.0
  5.  
  6. SMUS to MIDI File Conversion Software by Thomas E. Janzen
  7.  
  8. SMUSMIDI 1.0 software Copyright (c) 1991 Thomas E. Janzen  All Rights Reserved
  9.  
  10. Thomas E. Janzen makes no warranties, either expressed or
  11. implied, with respect to the software program recorded on the
  12. diskette or the instructions, their quality, performance,
  13. merchantability or fitness for any particular purpose. The
  14. program and instructions are distributed free "as is". The entire
  15. risk as to their quality and performance is with the user. In no
  16. event will Thomas E. Janzen be liable for direct, indirect,
  17. incidental or consequential damages resulting from any defect
  18. in the program or instructions, even if Thomas E. Janzen has
  19. been advised of the possibility of such damages.
  20.  
  21. This software is intended for use within any and all applicable laws.
  22. Thomas E. Janzen is not responsible for the use of this software to
  23. convert music files claimed to be protected by copyright or other laws.
  24.  
  25. This software may be redistributed only intact with no change and
  26. only at no charge.
  27.  
  28. Your comments about SMUSMIDI are very welcome as soon as you
  29. have tried the program.  Your comments and questions about
  30. SMUSMIDI may be directed to:
  31.  
  32. Thomas E. Janzen
  33. 58A School Street Apt. 2-L
  34. Hudson, MA  01749-2518
  35. 1 (508) 562-1295
  36.  
  37. Commodore (TM), Amiga (TM), and AmigaDOS are trademarks of Commodore Business 
  38. Machines, Inc.
  39. SAS/C is a trademark of SAS Institute, Inc.
  40. MIDI file format is specified by the International MIDI Association (IMA).
  41.  
  42. No part of this software may be used in whole or in part in
  43. another public domain or commercial software.
  44.  
  45. INTRODUCTION
  46.  
  47. The standard MIDI file format, defined in "Standard MIDI Files 1.0"
  48. published by the International MIDI Association, is an international
  49. format for the exchange of MIDI event recordings, and may be so for
  50. many years to come.  SMUS (Simple Music) format, defined by Electronic
  51. Arts and Commodore Business Machines, Inc., is still being used by
  52. multi-media programs; I can't estimate it's life.  It is one of two
  53. file formats produced by DMCS from Electronic Arts (TM).  The other is
  54. a proprietary IFF form with private chunks.  The proprietary DMCS file
  55. holds more information than SMUS format, but it is not publicly defined.
  56. SMUS format is publicly defined, as is Standard MIDI File format.
  57.  
  58. Although some multi-media programs for the Amiga use SMUS format,
  59. MIDI sequencing programs almost universally use Standard MIDI File format,
  60. in addition to private formats that hold more information, just as DMCS's
  61. proprietary format does.  The current commercial SMUS-MIDI converter is 
  62. available as an add-on to another program for a total of hundreds of dollars.  
  63. Many people have written music in DMCS, only to later buy inexpensive modern 
  64. MIDI sequencing software, and find that they cannot transfer the old files to 
  65. the new program.
  66.  
  67. This program, SMUSMIDI, makes it possible to transfer DMCS SMUS output files
  68. to a modern MIDI sequencing program by converting the DMCS SMUS file to
  69. Standard MIDI File format.
  70.  
  71. SMUSMIDI does not:
  72.  
  73.     1.  Convert SMUS forms that are embedded in other IFF files.
  74.     2.  Convert all SMUS files, for example, those output by software other
  75.         than DMCS.
  76.     3.  Support file icons
  77.     4.  Require a MIDI hardware interface or use internal Amiga voices.
  78.  
  79. SMUSMIDI was compiled with SAS/C 5.1a.
  80.  
  81. HARDWARE REQUIREMENTS
  82.  
  83. SMUSMIDI probably would run on an Amiga with 512K bytes of
  84. memory.  To estimate the amount of memory needed for a conversion,
  85. multiply the length of the SMUS file in bytes times five.  To find its
  86. length, use the AmigaDOS list command.
  87.  
  88. RUNNING SMUSMIDI
  89.  
  90. SMUSMIDI is run from a CLI (command line interface).  Set a path (using the
  91. AmigaDOS path command) to the location of SMUSMIDI, or changed directory
  92. (with the AmigaDOS cd command) to the directory in which SMUSMIDI resides.
  93.  
  94. The command format for SMUSMIDI is:
  95.  
  96. SMUSMIDI  inputfile.SMUS outputfile
  97.  
  98. The input file should be an SMUS file output by Deluxe Music Construction
  99. Set.  The output file may be any name; .MID will be appended to it.
  100.  
  101. For example:
  102.  
  103. 1>SMUSMIDI goldbergaria.SMUS goldbergaria
  104. FORM is: 1360 bytes.
  105. HEADER:
  106.   Tempo: MM 63; 4 Tracks
  107. SCORE: goldbergaria.SMUS
  108.   Instrument: First Voice
  109.   Instrument: First Voice
  110. No more instruments.
  111. Length of track: 608 bytes
  112.  
  113. This will read goldbergaria.SMUS, close it, convert it to Standard MIDI
  114. File format, and write it to goldbergaria.MID.  The repeats marked by Bach
  115. are lost.
  116.  
  117. To preserve the list of instruments in a note, use indirection:
  118.  
  119. 1>SMUSMIDI >goldbergaria.notes goldbergaria.SMUS goldbergaria
  120.  
  121. Limitations and known problems:
  122.  
  123. DMCS SMUS files apparently lose some information (relative to the proprietary
  124. format) from the file, although I may be wrong about this.  Some of the 
  125. apparently lost information is:
  126.  
  127. 1.  Slurs (phrasing marks)
  128. 2.  Playing styles (staccato, etc.)
  129. 3.  MIDI channel assignments
  130.  
  131. Therefore, the MIDI output file from SMUSMIDI cannot represent this information.
  132.  
  133. In addition, SMUSMIDI does not preserve instruments.  Repeat signs are lost.
  134. Crescendos are lost.  I don't know if these items are in the SMUS file to
  135. start with, but they aren't documented in the standard.  
  136.  
  137. Preserved and copied into the MIDI file are: key signatures, time signatures,
  138. and control changes.
  139.  
  140. SMUSMIDI inserts "NULL" text events in the MIDI file to separate two
  141. consecutive delays.  I am too sick of working on the program to fix this.
  142. The music is converted quite well, so I don't care any more.  A commercial
  143. sequencer I use strips out everything it doesn't want, so this is a non-
  144. problem anyway.
  145.  
  146. SMUSMIDI CODE
  147.  
  148. SMUSMIDI is the most complicated spaghetti code I have ever written.
  149. It is about 1231 lines.  I didn't plan it that way, and that's why it
  150. happened.  I could have spent more time designing; OK, SOME time designing.
  151. It probably took under 100 hours.
  152.  
  153. The source files for SMUSMIDI are:
  154. SMUSMIDI.c
  155. IFF/smus.h
  156. IFF/iff.h
  157. IFF/compiler.h
  158.  
  159. The IFF headers can't be included in the kit.  They are printed in the
  160. ROM Kernel Reference Manual: Exec, and are available to developers.  
  161. I got them from Freely Redistributable Software Library disk number 185.
  162. SMUSMIDI.c contains my code.
  163.  
  164. SMUSMIDI begins by reading the command-line arguments.  If anything
  165. goes wrong, it prints an error message, releases its memory, closes all files,
  166. and exits.  The input file is opened and tested to see if it is an SMUS file.
  167. If not, SMUSMIDI exits.  When it finds the SMUS form, it reads the entire
  168. form into a dynamically allocated section of memory (called SMUS_Score)
  169. and closes the input file.
  170.  
  171. It then opens the output file; if this fails, it exits as before.  Memory is 
  172. allocated for the MIDI file ("MIDI_Score") that is four times larger than the 
  173. SMUS file.  The size of the MIDI files is typically 2.4 to 2.6 times the size 
  174. of the SMUS file.  The reason they are so big is that 240 clocks/quarter is 
  175. used, and this produces larger delay values, which are a variable-length 
  176. quantity in Standard MIDI File format.  This value can be changed for 
  177. recompilation, if you have a C compiler, at the top of the code in a macro 
  178. called TICKS_PER_QUARTER.
  179.  
  180. To continue, SMUSMIDI lists the score information, including any instruments.
  181. It does not use this information in the MIDI file.
  182. It then begins converting the tracks.  The tempo track is made first, by
  183. reading only time-signatures and tempi (tempos) into the first track of the
  184. MIDI file buffer (MIDI_Score).  When this is done, it returns to the beginning
  185. of the first SMUS track and starts converting musical events in SMUS_Score
  186. into MIDI events in MIDI_Score.  It loops through a section of code that
  187. converts one track, until all tracks are converted.  
  188.  
  189. The loop is a nightmare.  If I had done an intermediate conversion first,
  190. say into an array of structures that had the following representation for
  191. an event:
  192. 1. pitch
  193. 2. dynamic
  194. 3. true duration, including all ties
  195. 4. time to start from beginning of track,
  196.  
  197. than it might be much easier to convert this to Standard MIDI File format.
  198. By doing a direct conversion, I made it necessary to track all kinds of
  199. annoying things, such as an array of old chord notes, because th