home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: S5 Stereo Sound Sampler / Lowe_S5StereoSoundSampler.adf / Progs / Forth / s5.calls < prev    next >
Encoding:
Text File  |  1987-04-29  |  3.8 KB  |  175 lines

  1. \   S5 Multi-Forth Support Routines 1.
  2.  
  3. \   Library Interface Definitions for the Sophus s5 Sound Digitiser
  4. \   functions.
  5. \
  6. \             Jim Hawkins    August 1987   Rev 1.0
  7. \
  8. \   ******************************************************************
  9.  
  10. \   For more details of usage, see the manual notes.
  11.  
  12. \   The s5.library has been assigned Forth access number 20 here.
  13. \   If this conflicts with any other user libraries change all
  14. \   references by altering the following constant:
  15.  
  16. 20 constant S5Number
  17.  
  18. \   Next the library access words:
  19.  
  20. S5Number calls.lib S5
  21. S5Number calls.lib@ S5@
  22.  
  23. \   And finally the actual Forth definitions for the S5 Library. You
  24. \   probably  wont need all of these at any one time, but they can
  25. \   be copied as and when needed.  Note that Frag is defined in
  26. \   S5.symbols.
  27.  
  28. :  S5StartWave  ( Frequency type -- success )
  29. !A1 !A0 S5@ 5 ;
  30.  
  31. : S5StopWave  ( -- success )
  32. S5@ 6 ;
  33. : S5StereoStart ( LeftFrag RightFrag Deviate -- success )
  34. !D0 !A1 !A0 S5@ 7 ;
  35.  
  36. : S5StereoStop  ( LeftFrag RightFrag -- success )
  37. !A1 !A0 S5@ 8 ;
  38.  
  39. : S5CheckPlaying  ( Select -- true|false )
  40. !A0 S5@ 9 ;
  41.  
  42. : S5WaitForEnd   ( Select -- ) 
  43. !A0 S5 10 ;
  44.  
  45. : S5SoundStartUp ( Size LeftFrag RightFrag -- success )
  46. !D0 !A1 !A0 S5@ 11 ;
  47.  
  48. : S5AllocateSampleBuffer  ( Size Frag -- success )
  49. !A1 !A0 S5@ 12 ;
  50.  
  51. : S5SoundShutDown  ( LeftFrag RightFrag -- success )
  52. !A1 !A0 S5@ 13 ;
  53.  
  54. : S5ConfigureHardware  ( -- success )
  55. S5@ 14 ;
  56.  
  57. : S5DeconfigureHardware ( -- success )
  58. S5@ 15 ;
  59.  
  60. : S5RecordSamples  ( LeftFrag  RightFrag -- success )
  61. !A1 !A0 S5@ 16 ;
  62.  
  63. : S5ADC   ( Select -- value )
  64. !A0 S5@ 17 ;
  65.  
  66. : S5Read1LR ( LeftPtr RightPtr -- )
  67. !A1 !A0 S5 18 ;
  68.  
  69. : S5ClearTracks  ( LeftFrag RightFrag -- )
  70. !A1 !A0 S5@ 19 ;
  71.  
  72. : S5ValidRange  ( Frag -- True|False )
  73. !A0 S5@ 20 ;
  74.  
  75. : S5BuildEnvelopeTable ( Frag Select -- success )
  76. !A1 !A0 S5@ 21 ;
  77.  
  78. : S5FreqToPlayRate  (  Frequency -- Ticks )
  79. !A0 S5@ 22 ;
  80.  
  81. : S5FreqToSamRateStereo ( Frequency -- loops )
  82. !A0 S5@ 23 ;
  83.  
  84. : S5FreqToSamRateMono  ( Frequency -- loops )
  85. !A0  S5@ 24 ;
  86.  
  87. : S5SetTiming  ( Con1 Con2 Con3 -- )  \ These are values
  88. !D0 !A1 !A0 S5 25 ;
  89.  
  90. : S5GetTiming ( Con1Addr Con2Addr  Con3Addr -- ) \ These are addresses
  91.                                                  \ of variables.
  92. !D0 !A1 !A0 S5 26 ;
  93.  
  94. : S5LoadIFF  ( Frag FileNamePtr Options -- success )
  95. !D0 !A1 !A0 S5@ 27 ;
  96.  
  97. : S5SaveIFF  ( Frag FileNamePtr Option1 Option2 -- success )
  98. !D1 !D0 !A1 !A0 S5@ 28 ;
  99.  
  100. : S5LoadSOP2 ( Left Right FileNamePtr Option -- success )
  101. !D1 !D0 !A1 !A0 S5@ 29 ;
  102.  
  103. : S5SaveSOP2 ( Left Right FileNamePtr Option -- success )
  104. !D1 !D0 !A1 !A0 S5@ 30 ;
  105.  
  106. : S5LoadSOP3  ( Frag FileNamePtr Option -- success )
  107. !D0 !A1 !A0 S5@ 31 ;
  108.  
  109. : S5SaveSOP3  ( Frag FileNamePtr Option -- success )
  110. !D0 !A1 !A0 S5@ 32 ;
  111.  
  112. : S5AllocateFrag ( Size Type -- Frag )
  113. !A1 !A0 S5@ 33 ;
  114.  
  115. : S5DeallocateFrag ( Frag -- )
  116. !A0 S5 34 ;
  117.  
  118. : S5LoadEnvelope  ( EnvelopeAddress FileNamePtr -- success )
  119. !A1 !A0 S5@ 35 ;
  120.  
  121. : S5SaveEnvelope  ( EnvelopeAddress FileNamePtr -- success )
  122. !A1 !A0 S5@ 36 ;
  123.  
  124. : S5KillEnvelope  ( Env )
  125. !A0 S5@ 37 ;
  126.  
  127. : S5FastMemRecord ( Frag -- success )
  128. !A0 S5@ 38 ;
  129.  
  130. : S5FastMemPlay  ( Frag -- success )
  131. !A0 S5@ 39 ;
  132.  
  133. : S5Seize  ( -- success )
  134. S5@ 40 ;
  135.  
  136. : S5Release ( -- success )
  137. S5@ 41 ;
  138.  
  139. : S5SetPlay  ( Frag Option Value --  )
  140. !D0 !A1 !A0 S5 42 ;
  141.  
  142. : S5SetRecord ( Frag rate -- )
  143. !A1 !A0 S5 43 ;
  144.  
  145. : S5FragSize  ( --  size )
  146. S5@ 44 ;
  147.  
  148. : S5StereoSample  ( LeftBuf RightBuf Length Delay -- )
  149. !D1 !D0 !A1 !A0 S5 45 ;
  150.  
  151. : S5LeftSample   ( LeftBuf Length Delay -- )
  152. !D0 !A1 !A0 S5 46 ;
  153.  
  154. : S5RightSample  ( RightBuf length Delay -- )
  155. !D0 !A1 !A0  S5 47 ;
  156.  
  157. : S5DummyRead  ( length -- )
  158. !D0 S5 48 ;
  159.  
  160. : S5Fill  ( Buffer length Fillbyte -- )
  161. !D0 !A1 !A0 S5 49 ;
  162.  
  163. : S5Move  ( Source Destination Length -- )
  164. !D0 !A1 !A0 S5 50 ;
  165.  
  166. : S5GetStatus ( Addr -- )   \ Not much use except in Basic
  167. !A0 S5 51 ;
  168.  
  169. : S5Player  ( FileNameAdr -- success  )
  170. !A0 S5@ 52 ;
  171.  
  172. \  *******************************************************************
  173.  
  174.  
  175.