Beep Excerciser

Developer(s): Senen Racki
Date: 1989
Type: Program
Platform(s): QL
Tags: Sound

A menu for experimenting with the QL’s BEEP command. The eight parameters (duration, pitch, second pitch, time step, pitch step, repeats, fuzz and random) are listed on the screen; cursor up and down choose one, cursor left and right lower or raise it and play the new sound, ENTER stops the noise and SPACE stops it and leaves. Type beep_menu to start it.

Senen Racki found it in Jan Jones’s book QL SuperBASIC, The Definitive Handbook and changed it so that a joystick can drive the menu. As printed, line 200 has INKEY(-1) for INKEY$(-1) and line 340 ends with pars(7) for param(7), so the program stops with an error.

Published in Sinc-Link May-June 1989 (Playing With Sound).

Related Articles

As all you QLers know, the sound on the QL is kind of limited.

Source Code

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

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Tags