PLAYING WITH SOUND
As all you QLers know, the sound on the QL is kind of limited. The BEEP command does not seem to have any set order to it. By order, I mean that you cannot get, for example, a C# note unless you tirelessly experiment with a trial and error method. Unless some new developments come up in the sound department, that’s what we’re all stuck with.
To make the job a little easier, I found this program in QL SuperBASIC, THE DEFINITIVE HANDBOOK by Jan Jones. She was the designer and writer of Sinclair QL SuperBASIC along with help form Tony Tebby (a familiar name in the QL league). It’s a beep excerciser. Yup. Just type it in and call it by typing ‘beep_menu’, you’ll see what I mean.
About the program: It is generally a menu driven way to experiment with sound interactively. I modified it so that a joystick may be used to control the selection process.
100 DEFine PROCedure beep_menu
105 MODE 4
110 REMark BEEP EXCERCISER
115 FOR i=0 TO 2: CLS #i
120 PAPER 2: INK 7: WINDOW 448,200,32,16
130 CLS
140 PRINT 'Duration (0-4)''Pitch (0-255)''Pitch 2 (0-255)''Time step (0-235)''Pitch step (0-15)''Repeats (0-15)''Fuzz (8-15)''Random (8-15)'
150 AT 10,0: PRINT "Cursor up, cursor down to change menu item ""Cursor left to decrease the current value""Cursor right to increase the value""ENTER to stop the noise""SPACE to stop noise and exit program"
155 PRINT
157 PRINT "For Joystick, the obvious direction control & fire button""to terminate."
160 DIM param(7)
170 FOR iparam=0 TO 7: print_param
180 STRIP 0: iparam=0: print_param
190 REPeat in
200 inc = CODE(INKEY(-1)): REMark read keyboard
210 SELect ON inc
220 ON inc=208: IF iparam>0: change_param -1: REMark up
230 ON inc=216: IF iparam<7: change_param 1: REMark down
240 ON inc=192: param(iparam)=param(iparam)-1: rebeep: REMark left
250 ON inc=200: param(iparam)=param(iparam)+1: rebeep: REMark right
260 ON inc=10: BEEP: REMark enter
270 ON inc=32: BEEP: EXIT in: REMark space
280 END SElect
290 END REPeat in
300 END DEFine
310 REMark ----------------------------------------------------------------------
320 DEFine PROCedure rebeep
330 print_param
340 BEEP param(0)*500000/72,param(1),param(2),param(3)*10000/72,param(4),param(5),param(6),pars(7)
350 END DEFine
360 REMark ----------------------------------------------------------------------
370 DEFine PROCedure change_param(change)
380 STRIP 2: print_param: REMark print old selection on red
390 iparam = iparam + change
400 STRIP 0: print_param: REMark print new selection on black
410 END DEFine
420 REMark ----------------------------------------------------------------------
430 DEFine PROCedure print_param
440 AT iparam,11: PRINT param(iparam) TO 14
450 END DEFine
SENEN RACKI
[phone number omitted]
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.