home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 1 / AU_CD1.iso / demos / s_to_z / symphony / PlayModule / !Help / Help < prev    next >
Text File  |  1995-02-20  |  21KB  |  308 lines

  1. <title>Help : Digital Symphony Play Module</title>
  2.  
  3. <h1>Digital Symphony Play Module</h1><br>
  4. The DSymPlay module provides all the code necessary for programmers of any level
  5. to play Symphonies from within their own code. The module allows control of the 
  6. Symphony track using SWIs or from the command line, via the commands listed below.<br><br>
  7. The module is provided so that including a soundtrack created by Digital Symphony in either
  8. a game, or demo, etc... is a trivial task, which will be performed well, using little 
  9. processor time.
  10. <hr>
  11.  
  12. <h2>More Details</h2><br>
  13. Any registered owner of Digital Symphony may apply (by sending a disc and SAE to Oregan)
  14. for further, more technically specific details about using the module. An additional
  15. new version of the module will be supplied, which is optimised for ARM 3 use.
  16. <hr>
  17.  
  18. <h2>Copyright</h2><br>
  19. Copyright of the Digital Symphony play modules is owned by Oregan Software Developments,
  20. and BASS. However the modules may be used freely in Freeware productions, but a licence
  21. must be applied for when used in commercial, or Shareware products.<br><br>
  22. Licences may be granted free of charge to registered Digital Symphony users, but in the
  23. case of commercial use, a one off licence fee of £100 may be imposed.<br><br>
  24. Please direct all applications to:<br><br>
  25. <i>Oregan Software Developments<br>
  26. 36 Grosvenor Avenue<br>
  27. Streetly<br>
  28. Sutton Coldfield<br>
  29. B74 3PE<p>
  30. Tel: 0121 353 6044<br>
  31. Fax: 0121 353 6472<br>
  32. <hr>
  33. <hr>
  34. <h2>SWI Details</h2>
  35. <r0>
  36. <br>SWI Chunk name: DSym
  37. <br>SWI Chunk base number: &45880 
  38. <br>
  39. <br>-----------------------------------------------------------------------------
  40. <br>SWI name         Nr |Entry                     |Exit/Effect
  41. <br>-----------------------------------------------------------------------------
  42. <br>Load             00 |R0=-1 to free RMA buffers |If an error occured, then
  43. <br>                    |or R0= 0 to load from     |   R0 points to error        
  44. <br>                    |         memory           |   and V is set,
  45. <br>                    |or R0 points to file name |else
  46. <br>                    |R1= source start address  |   R0= length of track
  47. <br>                    |    (if R0=0)             |       in memory.
  48. <br>                    |R2= 0 to load to RMA      |
  49. <br>                    |or R2= destination start  |
  50. <br>                    |       address            |
  51. <br>                    |R3= size of destination   |
  52. <br>                    |    buffer (if R2[]0)     |
  53. <br>                    |R4= 0 to claim buffer     |
  54. <br>                    |    in RMA                |
  55. <br>                    |or R4= start address of   |
  56. <br>                    |   buffer (32K space)     |
  57. <br>                    |A buffer address is needed only if the Symphony file
  58. <br>                    | contains some packed data.
  59. <br>                    |Buffers are word aligned.
  60. <br>                    |In the case of packed data, the source and destination
  61. <br>                    | buffers can't share any part of memory.
  62. <br>                    |In the case of entirely non packed data, the two buffers
  63. <br>                    | can share a part of memory provided
  64. <br>                    | destination address [= source address. After the call
  65. <br>                    | the source data has been altered because the
  66. <br>                    | module needs to build an internal structure different
  67. <br>                    | to the source structure of the tune.
  68. <br>                    |Although the code is quite optimized, loading from
  69. <br>                    | memory may take some time because all the data has to
  70. <br>                    | be moved in memory. So don't expect loading 50 songs
  71. <br>                    | per second with an ARM2|
  72. <br>-----------------------------------------------------------------------------
  73. <br>RestartSong      01 | -                        |Do a ResetParams,
  74. <br>                    |                          |Tune position set to (0,0),
  75. <br>                    |                          |Tune playing again.
  76. <br>-----------------------------------------------------------------------------
  77. <br>Vol              02 |R0= new overall volume    |R0= previous overall volume
  78. <br>                    |    or -1 to read         |    (0-64).
  79. <br>                    |Initial value is 64       |
  80. <br>-----------------------------------------------------------------------------
  81. <br>Stereo           03 |R0= voice number (0-7)    |R1= previous stereo position
  82. <br>                    |R1= new stereo position   |    (-127 to 127) for voice
  83. <br>                    |    or -128 to read       |    number R0.
  84. <br>                    |                          |
  85. <br>                    |Initial values are those of the Amiga.
  86. <br>-----------------------------------------------------------------------------
  87. <br>CutNote          04 |R0= voice number (0-7)    |R1= previous note state on
  88. <br>                    |R1]=0 to read state       |    voice number R0
  89. <br>                    |  [ 0 to stop note        |  [ 0 -] stopped
  90. <br>                    |                          |  ]=0 -] playing, = sample
  91. <br>                    |                          |         start address
  92. <br>                    |                          |If R1]=0 then
  93. <br>                    |                          |  R2= offset in sample
  94. <br>                    |                          |      in 1/(2^12) units
  95. <br>-----------------------------------------------------------------------------
  96. <br>PlayInstrPacked  05 |R0= voice number (0-7)    |The new note is put into a
  97. <br>                    |R1= full note data        |1-entry-per-voice buffer to be
  98. <br>                    |R5= minimum sustain time  |played.
  99. <br>                    |    (in 1/50th sec)       |Setting a sustain time means
  100. <br>                    |R6[]0 to wait for buffer  |that the new note has
  101. <br>                    |      empty               |priority on the tune notes
  102. <br>                    |      else don't wait     |during this time.
  103. <br>-----------------------------------------------------------------------------
  104. <br>PlayInstr        06 |R0= voice number (0-7)    |The new note is put into a
  105. <br>                    |R1= note number (0-36)    |1-entry-per-voice buffer to be
  106. <br>                    |R2= sample number (0-63)  |played.
  107. <br>                    |R3= effect number (0-63)  |Setting a sustain time means
  108. <br>                    |R4= effect value (0-&FFF) |that the new note has
  109. <br>                    |R5= minimum sustain time  |priority on the tune notes
  110. <br>                    |    (in 1/50th sec)       |during this time.
  111. <br>                    |R6[]0 to wait for buffer  |
  112. <br>                    |      empty               |
  113. <br>                    |      else don't wait     |
  114. <br>-----------------------------------------------------------------------------
  115. <br>ResetParams      07 | -                        |All parameters are reset
  116. <br>                    |                          |(stereo,counters,effects,...)
  117. <br>                    |                          |and do a FlushOutput.
  118. <br>-----------------------------------------------------------------------------
  119. <br>FlushOutput      08 | -                        |The current notes on all
  120. <br>                    |                          |channels are cut.
  121. <br>-----------------------------------------------------------------------------
  122. <br>FreezeOutput     09 |R0= -1 to read output     |R0= previous output status
  123. <br>                    |        status            |(  0= off ie. no sound output
  124. <br>                    |   []-1 to set            | []0= on )
  125. <br>-----------------------------------------------------------------------------
  126. <br>UpCallVector     0A |R0= -1 to read upcall     |R0= previous upcall address
  127. <br>                    |       address            |
  128. <br>                    |  = -2 to set default     |
  129. <br>                    |  else new address        |
  130. <br>-----------------------------------------------------------------------------
  131. <br>MaskVoice        0B |R0= voice number (0-7)    |R0= previous voice status
  132. <br>                    |R1= -1 to read voice stat |    (0= off, []0=on)
  133. <br>                    |  []-1 to set voice status|The notes are still played
  134. <br>                    |                          |but not heard for the voice.
  135. <br>-----------------------------------------------------------------------------
  136. <br>SongPos          0C |R0= -1 to read sequence ps|R0= previous sequence pos
  137. <br>                    |  []-1 to set             |R1= previous pattern pos
  138. <br>                    |R1= -1 to read pattern pos|    (0-63)
  139. <br>                    |  []-1 to set             |If pattern pos is changed
  140. <br>                    |                          |then the current counter is
  141. <br>                    |                          |reset to play the tune line
  142. <br>                    |                          |as soon as possible.
  143. <br>-----------------------------------------------------------------------------
  144. <br>TuneControl      0D |R0= -1 to read status     |R0= previous tune status
  145. <br>                    |  []-1 to set (lower byte)|    (0= off, []0= on)
  146. <br>                    |                          |Off means the tune decoder
  147. <br>                    |                          |won't let play notes anymore,
  148. <br>                    |                          |you can still play custom
  149. <br>                    |                          |notes.
  150. <br>                    |                          |Current notes still playing.
  151. <br>-----------------------------------------------------------------------------
  152. <br>Pause            0E | -                        |The tune is stopped and
  153. <br>                    |                          |current notes on tune
  154. <br>                    |                          |channels cut.
  155. <br>-----------------------------------------------------------------------------
  156. <br>Voices           0F |R0= -1 to read hardware   |R0= previous hardware voices
  157. <br>                    |       voices number      |    number (1,2,4 or 8)
  158. <br>                    |  []-1 to set voices      |
  159. <br>                    |The change is taken into account during next configure.
  160. <br>                    |Initial value is 4.
  161. <br>-----------------------------------------------------------------------------
  162. <br>Wait             10 |R0= voice number (0-7)    |C is set if custom note
  163. <br>                    |                          |buffer is not empty,
  164. <br>                    |                          |else clear.
  165. <br>-----------------------------------------------------------------------------
  166. <br>IntState         11 | -                        |C is set if the call has
  167. <br>                    |                          |interrupted the playing or
  168. <br>                    |                          |filling routines.
  169. <br>-----------------------------------------------------------------------------
  170. <br>NoteInfo         12 | -                        |R0= address of current notes
  171. <br>                    |                          |    table (1 word per voice)
  172. <br>                    |                          |    note is 0 to 1023
  173. <br>                    |                          |R1= address of current
  174. <br>                    |                          |    samples table (1 byte per
  175. <br>                    |                          |    voice)
  176. <br>                    |                          |    sample is 0 to 63
  177. <br>                    |                          |R2= address of effects table
  178. <br>                    |                          |    (1 word per voice)
  179. <br>                    |                          |    bits 30-31 meaningless
  180. <br>                    |                          |    bits 16-21 effect nr
  181. <br>                    |                          |    bits  0-11 effect value
  182. <br>                    |                          |R3= address of volumes table
  183. <br>                    |                          |    (1 byte per voice)
  184. <br>                    |                          |    volume is 0 to 64
  185. <br>-----------------------------------------------------------------------------
  186. <br>VuBar            13 |R0= voice number (0-7)    |R1= Vu bar height (0-64)
  187. <br>-----------------------------------------------------------------------------
  188. <br>Loop             14 |R0= -1 to read loop contrl|R0= previous loop control
  189. <br>                    |  []-1 to set             |    (  0= enabled,
  190. <br>                    |R1= -1 to read loop flag  |     []0= disabled )
  191. <br>                    |  []-1 to set             |R1[]0 if the tune has looped
  192. <br>                    |                          |      else not looped
  193. <br>                    |                          |
  194. <br>                    |Loop control is initially enabled.
  195. <br>                    |If a song has looped and the loop is disabled, you can
  196. <br>                    |continue playing using TuneControl.
  197. <br>-----------------------------------------------------------------------------
  198. <br>BufferAddress    15 | -                        |R0= current system hardware
  199. <br>                    |                          |    buffer address (with
  200. <br>                    |                          |    output data interleaved)
  201. <br>                    |                          |    208 bytes per channel
  202. <br>-----------------------------------------------------------------------------
  203. <br>VuGravity        16 |R0= -1 to read Vu gravity |R0= previous gravity of Vu
  204. <br>                    |  []-1 to set (lower byte)|    bars (0-255)
  205. <br>                    |Initial value is 2.       |
  206. <br>                    |The change is taken into account during next configure.
  207. <br>-----------------------------------------------------------------------------
  208. <br>SampleRate       17 |R0= -1 to read sample rate|R0= previous sample rate
  209. <br>                    |  []-1 to set             |    (0-99) - determines
  210. <br>                    |                          |    sample output density.
  211. <br>                    |Original value is 24.     |
  212. <br>                    |The change is taken into account during next configure.
  213. <br>-----------------------------------------------------------------------------
  214. <br>Configure        18 |R0= -1 to reinstall previous
  215. <br>                    |       configuration      
  216. <br>                    |  []-1 to configure the system
  217. <br>                    |       with new voices number,
  218. <br>                    |       sample rate, Vu gravity and hardware speed.
  219. <br>-----------------------------------------------------------------------------
  220. <br>Params           19 |                          |R0= speed (1-&FFF)
  221. <br>                    |                          |R1= tempo (1-&FFF)
  222. <br>                    |                          |R2= counter (0-&FFE)
  223. <br>                    |The counter varies from 1 to speed-1 at a speed
  224. <br>                    |according to tempo (50 times a sec for default tempo)
  225. <br>-----------------------------------------------------------------------------
  226. <br>TuneInfo         1A | -                        |R0= tune length
  227. <br>                    |                          |R1= number of patterns
  228. <br>-----------------------------------------------------------------------------
  229. <br>PlaySingle       1B |   R0= -1                 |   Play pattern R1
  230. <br>                    | or                       | or
  231. <br>                    |   R0[]-1                 |   Play from pos R0 to R1
  232. <br>                    |                          |
  233. <br>                    | and                      |
  234. <br>                    |   R2= -1 for no loop     |
  235. <br>                    |     []-1 to loop         |
  236. <br>                    |                          |
  237. <br>                    | or R0=-1 and R1=-1       | or Normal play.
  238. <br>                    |                          |
  239. <br>                    |                          |The pattern pos is set to 0.
  240. <br>                    |                          |In the case of playing a
  241. <br>                    |                          |part of the sequence, the
  242. <br>                    |                          |current position is set to
  243. <br>                    |                          |the first pos in that part.
  244. <br>-----------------------------------------------------------------------------
  245. <br>DefaultStereo    1C |R0= voice number (0-7)    |R1= previous default stereo
  246. <br>                    |R1= new default stereo    |position (1 to 7) for
  247. <br>                    |    position              |voice number R0
  248. <br>                    |    or 0 to read          |
  249. <br>                    |                          |
  250. <br>                    |Initial values are those of the Amiga.
  251. <br>-----------------------------------------------------------------------------
  252. <br>InstrData        1D |R0= sample number (1-63)  |The specs for sample R0
  253. <br>                    |R1= sample data address   |are changed to those on entry
  254. <br>                    |    or -1 to read         |R1= previous address
  255. <br>                    |R2= sample length         |R2= previous length
  256. <br>                    |    or -1 to read         |R3= previous repeat offset
  257. <br>                    |R3= repeat offset         |R4= previous repeat length
  258. <br>                    |    or -1 to read         |R5= previous volume
  259. <br>                    |R4= repeat length         |R6= previous finetune
  260. <br>                    |    or -1 to read         |    (-8 to 7)
  261. <br>                    |R5= volume (0-64)         |
  262. <br>                    |    or -1 to read         |
  263. <br>                    |R6= finetune (0-&F)       |
  264. <br>                    |    or -1 to read         |
  265. <br>                    |R1 to R4 must be 2-byte aligned.
  266. <br>                    |Put a repeat length of 0 for no repeats.
  267. <br>                    |Repeat length can't be 2.
  268. <br>                    |Set bit 31 of R1 if the sample is signed linear.
  269. <br>                    |The data is not moved i.e. it stays where you put it.
  270. <br>                    |The data is also scaled to the current machine volume if
  271. <br>                    |R1[]-1.
  272. <br>-----------------------------------------------------------------------------
  273. <br>HardSpeed        1E |R0= samples output        |R0= previous parameter
  274. <br>                    |    frequency (in kHz)    |R1= current hardware speed
  275. <br>                    |    or 0 for 'auto speed' |    (in kHz)
  276. <br>                    |    or -1 to read         |The buffer filling routine
  277. <br>                    |                          |output frequency is changed
  278. <br>                    |                          |to the one on entry
  279. <br>                    |Initial mode is 24000     |
  280. <br>                    |The change is taken into account during next configure.
  281. <br>                    |
  282. <br>                    |In 'auto speed' mode, the filling routine will try to
  283. <br>                    |guess the current VIDC frequency for outputting samples
  284. <br>                    |by averaging the number of calls to it and adjust its
  285. <br>                    |tables to always have the same real pitch whatever the
  286. <br>                    |hardware speed is. The 'auto speed' selects one of the
  287. <br>                    |three following speeds currently:
  288. <br>                    |
  289. <br>                    |    24000 kHz (normal modes)
  290. <br>                    |    25175 kHz (VGA modes)
  291. <br>                    |    36000 kHz (multi sync modes)
  292. <br>                    |
  293. <br>                    |Too bad to have the same clock for graphics and sound|
  294. <br>-----------------------------------------------------------------------------
  295. <br>LoopType         1F |R0= loop type             |R0= previous loop type
  296. <br>                    |   or -1 to read          |    (0 or 1)
  297. <br>                    |                          |
  298. <br>                    |Type 0: The loop flag is set if the tune reaches
  299. <br>                    |        position 0.
  300. <br>                    |Type 1: The loop flag is set if the tune jumps to
  301. <br>                    |        a lower position.
  302. <br>-----------------------------------------------------------------------------
  303. <br>FillAddress      20 | -                        |R0= address of buffer filling
  304. <br>                    |                          |    routine
  305. <br>-----------------------------------------------------------------------------
  306. </r0>
  307. <br><br><br><br><br>                                                                             
  308.