home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / SGC.ZIP / SG.DOC < prev    next >
Encoding:
Text File  |  1990-03-12  |  6.0 KB  |  280 lines

  1. ********************************************************************
  2. *                                                                  *
  3. *                  Documentation for "Sounds Good"                 *
  4. *                                                                  *
  5. ********************************************************************
  6.  
  7.  
  8. Sounds Good is a sound editor for the PC speaker. It lets you create,
  9. edit, and play sounds that can be used in your programs. The sounds
  10. that you create can be saved to disk and loaded in you program.
  11.  
  12.  
  13. The Sounds Good archived file should contain the following files:
  14. SG.EXE - the sound editor program
  15. SG_C.H - an include file for C programs
  16. C_EXMPL1.C - a C example program in small memory model
  17. C_EXMPL2.C - a C example program in large memory model
  18. B_EXMPLE.BAS - a QuickBASIC example program
  19. SG_BASIC.LIB - the BASIC library
  20. SG_CPAS.LIB - the C and Pascal library
  21. CRAZY.SRC
  22. CRAZY.SND
  23. RACES.SRC
  24. RACES.SND
  25.  
  26. Along with the Sounds Good editor program is a set of library routines
  27. that let you easily use the sounds you've created in your programs.
  28. They are interrupt driven too, so after the sounds are started, you
  29. can do other things.
  30.  
  31. The editor program is very easy to use. There are four fields--function
  32. selections, editable source code, sound on/off, and disk functions.
  33.  
  34.  
  35.  
  36. Function Selections:
  37.  
  38. To select this field (it's selected when the program first runs), press 'F.'
  39. You'll see the "<F>unction" text highlight and the cursor will move up and
  40. down the selections.
  41.  
  42. To place one of the functions into the edit box, just press return when
  43. the function you want is highlighted. There's a maximum of 100 functions
  44. that can be placed in the edit window.
  45.  
  46. The functions give you a general idea of what each of the arguments for
  47. each function does.
  48.  
  49.  
  50. Edit Window:
  51.  
  52. If you want to edit the arguments in the functions, press 'E' and the
  53. "<E>dit text will highlight. You can then scroll through the sounds that
  54. have been placed in the list. To edit the default arguments for any
  55. function, just highlight it and press return. You'll then be able to
  56. adjust the values and get the sound you want.
  57.  
  58.  
  59. Play:
  60.  
  61. To start a sound press 'P.' You'll see the "<P>lay" text highlight. Then
  62. highlight the appropriate choice.
  63.  
  64.  
  65. Disk:
  66.  
  67. Press 'D' to use the disk functions. When you save to disk, two files
  68. will be written. The one with the .SRC extension is the source code and
  69. the one with the .SND extension is the sound data that you'll load
  70. into your programs.
  71.  
  72.  
  73.  
  74. The Functions:
  75.  
  76. -Editible Sounds:
  77.  
  78. Tone [Frq] [Del]
  79.   Frq - Frequency in Hertz
  80.   Del - Delay in 1/18th seconds
  81.  
  82. Silence [Del]
  83.   Del - Delay in 1/18th seconds
  84.  
  85. Ascend [Frq] [Frq] [Del] [Cnt] [Step]
  86.   Frq - Starting frequency in Hertz
  87.   Frq - Ending frequency in Hertz
  88.   Del - Delay in 1/18th seconds between steps
  89.   Cnt - Number of repeats
  90.   Step - Amount of increase
  91.  
  92. Descend [Frq] [Frq] [Del] [Cnt] [Step]
  93.   Frq - Starting frequency in Hertz
  94.   Frq - Ending frequency in Hertz
  95.   Del - Delay in 1/18th seconds    between steps
  96.   Cnt - Number of repeats
  97.   Step - Amount of decrease
  98.  
  99. Trill [Frq] [Frq] [Del] [Cnt]
  100.   Frq - Starting frequency in Hertz
  101.   Frq - Ending frequency in Hertz
  102.   Del - Delay in 1/18th seconds    between the interval
  103.   Cnt - Number of repeats
  104.  
  105. Interval [Frq] [Frq] [Del] [Cnt] [Step]
  106.   Frq - Starting frequency in Hertz
  107.   Frq - Ending frequency in Hertz
  108.   Del - Delay in 1/18th seconds between interval
  109.   Cnt - Number of repeats
  110.   Step - Amount of increase for each successive interval
  111.  
  112. On/Off [Frq] [Del] [Cnt]
  113.   Frq - Frequency in Hertz
  114.   Del - Delay in 1/18th seconds
  115.   Cnt - Number of repeats
  116.  
  117. -Predefined Sounds
  118.  
  119. Siren
  120. Whistle
  121. Alarm
  122. Gun
  123. Blast
  124.  
  125.  
  126. Sound Frequencies:
  127.  
  128. Here is a partial list of some sound frequencies.
  129.  
  130. Note    Frequency
  131.  
  132. C         131
  133. D         147
  134. E         165
  135. F         175
  136. G         196
  137. A         220
  138. B         247
  139. C         262
  140. D         294
  141. E         330
  142. F         349
  143. G         392
  144. A         440
  145. B         494
  146. C         523
  147. D         587
  148. E         659
  149. F         698
  150. G         784
  151. A         880
  152. B         988
  153. C         1046
  154. D         1175
  155. E         1318
  156. F         1397
  157. G         1568
  158. A         1760
  159. B         1975
  160.  
  161.  
  162. Programming:
  163.  
  164. First, make sure that your linker links in the appropriate library file.
  165.  
  166.  
  167. -Installing the interrupt
  168.  
  169. You have to turn the interupt on before the sounds will play. At the
  170. beginning of your progrgam (or at least before you begin any sounds)
  171. make the following call.
  172.  
  173. BASIC
  174. call installit
  175.  
  176. C
  177. installit();
  178.  
  179. Pascal
  180. call installit;
  181.  
  182. -Removing the interrupt
  183.  
  184. You have to remove the interrupt before exiting the program or the
  185. computer will crash. Make the following call before exiting.
  186.  
  187. BASIC
  188. call removeit
  189.  
  190. C
  191. removeit();
  192.  
  193. Pascal
  194. call removeit;
  195.  
  196.  
  197. -Starting a sound
  198.  
  199. The sound routines update themselves and behave exactly as those in the
  200. sound editor. You'll have to first load the sounds into the buffer.
  201.  
  202. BASIC
  203. REM sound is already loaded
  204. calls dosound( soundbuffer$ )
  205.  
  206. C
  207. dosound( soundbuffer );
  208.  
  209. Pascal
  210. dosound( soundbuffer );
  211.  
  212.  
  213. -Finding out how many events remain
  214.  
  215. Use the following routine to determine how much of the sound remains
  216. in the queue. Returns a value if there are events even if the sound is
  217. paused.
  218.  
  219. BASIC
  220. calls eventsleft( events% )
  221.  
  222. C
  223. events = eventsleft();
  224.  
  225. Pascal
  226. events = eventsleft;
  227.  
  228.  
  229. -Finding out if there's a sound going on
  230.  
  231. This is different than the eventsleft call. It returns a non-zero if a 
  232. sound is being played and a zero if no sound is being played. If a sound
  233. is paused, it will return a zero.
  234.  
  235. BASIC
  236. calls soundsareon( soundflag% )
  237.  
  238. C
  239. soundflag = soundsareon();
  240.  
  241. Pascal
  242. soundflag = soundsareon;
  243.  
  244. -Pause the sound
  245.  
  246. BASIC
  247. call pausesound
  248.  
  249. C
  250. pausesound();
  251.  
  252. Pascal
  253. pausesound;
  254.  
  255. -Unpause the sound
  256.  
  257. BASIC
  258. call unpausesound
  259.  
  260. C
  261. unpausesound();
  262.  
  263. Pascal
  264. unpausesound;
  265.  
  266. You can leave me messages on CompuServe (user number [74676,457])
  267. or GEnie (mail address R.LEINECKER).
  268.  
  269. --Rick Leinecker
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.