' ------------------------------------------------------------------
'
'      Loading AND Playing LIST DATA Saved from SoundMachine
'
'      (c) 1988  Tom Beale
'
' ------------------------------------------------------------------
FileName$="List.st"
ON BREAK GOSUB Aus: BREAK ON

DIM V%(255)       ' The number (255) should always be 255

DIM Freq(150)     ' The number (150) may be larger or smaller,
DIM Duration(150) ' depending on your needs and how much memory you
DIM Vol(150)      ' have.

Voice = 0         ' The value can be 0, 1, 2 or 3

PRINT "Loading List..."
GOSUB LoadList
PRINT 
PRINT "Hit any Key to Play List... Press <ESC> to break program."

main: ' ----------------------------------------------------  Main Loop
    a$=INKEY$:IF a$="" THEN GOTO main
    IF a$=CHR$(27) THEN GOTO runout
    GOSUB PlayList
    GOTO main
END


LoadList: ' ------------------- Load List Data and Put it into Arrays
   a=0
   OPEN "I", #1, FileName$
   WHILE NOT EOF(1)
       INPUT #1, Freq(a)
       INPUT #1, Duration(a)
       INPUT #1, Vol(a)
       a=a+1
   WEND
   CLOSE 1
   LastLine=a-1
RETURN

PlayList: ' ----------------------------------------- Play List Back
   FOR a = 0 TO LastLine
      SOUND Freq(a), Duration(a), Vol(a)
   NEXT
RETURN

Aus:  SYSTEM
runout:
