[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can GS be used as a metronome?



Of course it can!

The easiest way is to just write a BASIC routine with a timing loop to
provide a click at intervals.  Something like...

REM works on ANY Apple ][!
60000 S=PEEK(-16336)+PEEK(-16336):TM=DL
60001 K%=PEEK(016384):ON K%>128 GOTO 60002:TM=TM-1:ON TM=0 
      GOTO 60000:GOTO 60001
60002 POKE -16368,0:RETURN

Where DL is the time delay between clicks.  The delay will generally be
consistent, but you'll have to experiment with values.  In English, the
routine looks more like this...

60000 CLICK SPEAKER:LET COUNTER=CONSTANT
60001 READ KEYBOARD:IF KEY PRESSED GOTO 60002:DECREMENT COUNTER:IF COUNTER 
      HAS RUN OUT, GOTO 60000.  OTHERWISE, GOTO 60001
60002 SINCE KEY WAS PRESSED, CLEAR KEYBOARD AND RETURN.

There's your start.  Now have at it!

--Dave Althoff, Jr.
-- 
    /-\        _       _               __ ***  .SIG NOW OPEN!!!!  ***
   /XXX\      /X\     /X\_      _     /XX\_      _     _        _____  
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX