30 D$ = CHR$ (4)

40 GOSUB 9000

50 IF PEEK (XA) = 1 THEN 130

100 GOSUB 8500

120 GOTO 165

130 GOSUB 8600: ONERR GOTO 200

165 PRINT D$;"BLOAD SEQU.";AS$;",A";BS

170 GOSUB 8000: GOSUB 8420: POKE XS,1: POKE XA,1: POKE X0,0: POKE 216,0

180 POKE 34,0: HOME : GOTO 1000

200 AS$ = "DEMO1": POKE 216,0: GOTO 165

400 POKE 34,BO

410 POKE KS,0

420 IF PEEK (KB) < 128 THEN 420

430 GET A$:A = VAL (A$)

440 IF A < 1 OR A > SE THEN RETURN

450 VTAB ME - 1 + A: INVERSE : PRINT A$: NORMAL : VTAB BO: RETURN

500 POKE KS,0

510 IF PEEK (KB) < 128 THEN 510

520 GET A$:A = VAL (A$): RETURN

530 INPUT A$:A = VAL (A$): IF A$ = "" THEN POP

532 RETURN

600 IF PEEK (T3) OR PEEK (T4) THEN HTAB M1: PRINT " * EXT SYNC *"

610 RETURN

1000 POKE 34,0: HOME

1010 PRINT "........................................"

1020 PRINT "...........SOUND SEQUENCER ][..........."

1030 PRINT "........................................";

1040 VTAB ME

1050 PRINT "1 ADA'S MAIN MENU"

1060 PRINT "2 PATTERN SELECT"

1070 PRINT "3 EDIT PATTERN"

1080 PRINT "4 PLAY"

1085 PRINT "5 LOOP PLAY"

1090 VTAB ME: HTAB M1: PRINT " (A S D F)"

1100 HTAB M1: PRINT "6 LOAD/SAVE"

1110 HTAB M1: PRINT "7 VOLUME (";O1;")";: CALL - 868: PRINT

1120 HTAB M1: PRINT "8 MODE (";MD;")"

1125 HTAB M1: PRINT "9 TEMPO (";RV;")";: CALL - 868: PRINT

1127 GOSUB 600

1130 SE = 9

1140 GOSUB 510: IF A < 6 THEN GOSUB 440: GOTO 1170

1150 IF A > SE THEN 1140

1160 VTAB A + 1: HTAB M1: INVERSE : PRINT A: NORMAL

1170 IF A$ = "A" OR A$ = "S" OR A$ = "D" OR A$ = "F" THEN 6000

1175 IF PEEK (KB) = 2 THEN GOSUB 6500: GOTO 1040

1180 ON A GOTO 6200,2000,3000,6100,6120,7000,6130,6300,6400

1190 GOTO 1140

2000 VTAB 12: HTAB 10: PRINT "PATTERN ";: IF F1 = 0 THEN GET A$: GOTO 2020

2010 PRINT G2;: GET A$

2020 IF A$ = "Q" AND F1 = 1 THEN VTAB 12: HTAB 16: PRINT G2;" ": GOTO 1040

2030 IF A$ = "Q" AND F1 = 0 THEN VTAB 12: CALL - 958: GOTO 1040

2040 IF A$ = "" THEN A = 1: GOTO 2060

2050 A = VAL (A$): IF A < 1 OR A > 5 THEN PRINT G$: GOTO 2000

2060 G2 = A:F1 = 1

2070 GP = (G2 - 1) * 41: VTAB 12: HTAB 10: PRINT "PATTERN ";G2;: CALL - 958: PRINT

2080 IF G2 = 5 THEN 4000

2090 Z = 1:V1 = BS + GP

2100 VTAB 14: PRINT " SND NTE DUR DIR VOL"

2110 X = 1: PRINT Z;") ";

2120 V2 = PEEK (V1): IF V2 = 255 THEN PRINT "R ";: GOTO 2140

2130 PRINT V2;" ";

2140 HTAB X * 4 + 3:V1 = V1 + 1

2150 X = X + 1: IF X > 5 THEN 2170

2160 PRINT ":";: GOTO 2120

2170 Z = Z + 1: PRINT

2180 IF Z > 8 THEN 1040

2190 GOTO 2110

3000 IF F1 THEN 3040

3010 VTAB BO: PRINT "WHOOPS! SELECT A PATTERN FIRST";G$

3020 IF PEEK (KB) < 128 THEN 3020

3030 VTAB BO: CALL - 958: GOTO 1040

3040 Z = 1: POKE 33,13: POKE 32,27: POKE 34,14: PRINT

3050 IF G2 = 5 THEN 5000

3060 VTAB 15: PRINT " LN# ?";

3070 GET A$: IF A$ = "" THEN GOTO 3110

3080 IF A$ = "Q" THEN 3280

3090 IF VAL (A$) < 1 OR VAL (A$) > 8 THEN PRINT G$: GOTO 3060

3100 Z = VAL (A$)

3110 PRINT : VTAB 15

3120 X = 1: PRINT " LN# ";Z;" ": PRINT

3130 V1 = BS + (Z - 1) * 5 + GP

3140 PRINT M1$(X);" ";: IF PEEK (V1) = 255 THEN PRINT "R";: GOTO 3160

3150 PRINT PEEK (V1);

3160 INPUT A$: IF A$ = "" THEN GOTO 3220

3170 IF A$ = "R" THEN POKE V1,255: POKE X0,255: GOTO 3220

3180 IF A$ = "Q" THEN 3270

3190 IF A$ = "0" THEN 3210

3200 IF VAL (A$) < 1 OR VAL (A$) > 254 THEN PRINT G$;: VTAB PEEK (37): GOTO 3140

3210 POKE V1, VAL (A$): POKE X0,255

3220 V1 = V1 + 1:X = X + 1: IF X > 5 THEN 3240

3230 GOTO 3140

3240 GOSUB 3400

3250 Z = Z + 1: IF Z > 8 THEN POKE V1,255: GOTO 3280

3260 CALL - 936: GOTO 3110

3270 GOSUB 3400

3280 CALL - 936: POKE 33,40: POKE 32,0: GOTO 1040

3400 POKE 33,40: POKE 32,0

3410 VTAB Z + 14:V1 = BS + (Z - 1) * 5 + GP

3420 X = 1: PRINT Z;") ";

3430 V2 = PEEK (V1): IF V2 = 255 THEN PRINT "R ";: GOTO 3450

3440 PRINT V2;" ";

3450 HTAB X * 4 + 3:V1 = V1 + 1

3460 X = X + 1: IF X > 5 THEN 3480

3470 PRINT ":";: GOTO 3430

3480 POKE 33,13: POKE 32,27

3490 RETURN

4000 Z = 1: VTAB 14: PRINT " PAT CNT PAT CNT"

4010 GOSUB 4050

4020 Z = Z + 1

4030 IF Z > 16 THEN 1040

4040 GOTO 4010

4050 POKE 33,40: POKE 32,0

4060 V3 = 0:Y = Z: IF Z > 8 THEN Y = Z - 8:V3 = 15: HTAB V3

4070 IF Z = 9 THEN HTAB V3 + 1

4080 VTAB Y + 14

4090 X = 1: PRINT Z;") ";

4100 V1 = BS + (Z - 1) * 2 + GP + X - 1

4110 V2 = PEEK (V1): IF V2 = 255 THEN PRINT "R ";: GOTO 4140

4130 PRINT V2;" ";

4140 HTAB X * 4 + 3 + V3

4150 X = X + 1: IF X > 2 THEN 4170

4160 PRINT ":";: GOTO 4100

4170 PRINT : RETURN

5000 VTAB 15: PRINT " LN# ";

5010 INPUT A$: IF A$ = "" THEN VTAB 15: HTAB 6: PRINT Z: GOTO 5050

5020 IF A$ = "Q" THEN 5270

5030 IF VAL (A$) < 1 OR VAL (A$) > 16 THEN PRINT G$: GOTO 5000

5040 Z = VAL (A$): VTAB 15: HTAB 6: PRINT Z;" "

5050 VTAB 15

5060 X = 1: PRINT " LN# ";Z: PRINT

5070 V1 = BS + (Z - 1) * 2 + GP

5080 PRINT M2$(X);" ";:V2 = PEEK (V1): IF V2 = 255 THEN PRINT "R";: GOTO 5110

5100 PRINT V2;

5110 INPUT A$: IF A$ = "" THEN GOTO 5190

5120 IF A$ = "R" THEN POKE V1,255: POKE X0,255: GOTO 5190

5130 IF A$ = "Q" THEN 5250

5140 A = VAL (A$)

5150 IF A < 1 OR A > 254 THEN PRINT G$;: VTAB PEEK (37): GOTO 5080

5160 IF A < 1 OR A > 4 AND X = 1 THEN PRINT G$;: VTAB PEEK (37): GOTO 5080

5180 POKE V1,A: POKE X0,255

5190 V1 = V1 + 1:X = X + 1: IF X > 2 THEN 5210

5200 GOTO 5080

5210 GOSUB 4050

5220 POKE 33,13: POKE 32,27

5230 Z = Z + 1: IF Z > 16 THEN POKE V1 + 1,255: GOTO 5270

5240 CALL - 936: GOTO 5050

5250 GOSUB 4050

5260 POKE 33,13: POKE 32,27

5270 CALL - 936: POKE 33,40: POKE 32,0: GOTO 1040

6000 IF A$ = "A" THEN V1 = 1

6010 IF A$ = "S" THEN V1 = 2

6020 IF A$ = "D" THEN V1 = 3

6030 IF A$ = "F" THEN V1 = 4

6040 V2 = BS + 164: FOR V3 = 0 TO 2:V4(V3) = PEEK (V2 + V3): NEXT V3

6050 POKE V2,V1: POKE V2 + 1,1: POKE V2 + 2,255: POKE Q3,255: CALL Q1: POKE Q3,0

6060 FOR V3 = 0 TO 2: POKE V2 + V3,V4(V3): NEXT V3: GOTO 1140

6100 POKE Q3,255: CALL Q1

6110 POKE Q3,0: GOTO 1040

6120 POKE Q3,0: CALL Q1: GOTO 1040

6130 GOSUB 6800: GOSUB 8400: GOSUB 6850: GOTO 1040

6200 GOSUB 6800

6210 PRINT "MAIN MENU": PRINT "(Y/N)?";

6220 GET A$: IF A$ < > "Y" THEN GOSUB 6850: GOTO 1040

6230 PRINT A$: GOSUB 6860: IF PEEK (X2) = 0 THEN O1 = 8

6235 GOSUB 8200

6240 PRINT D$;"RUN ADA.2"

6300 GOSUB 6800

6310 PRINT "SET MODE": PRINT "(2-7) ?";: GOSUB 520

6320 IF A < 2 OR A > 7 THEN GOSUB 6850: GOTO 1040

6330 MD = A: GOSUB 6850: GOSUB 8200: GOTO 1040

6400 GOSUB 6800

6410 PRINT "SET TEMPO": PRINT "(1-15) ";: INPUT A$:A = VAL (A$): IF A$ = "" THEN 6430

6420 IF A < 1 OR A > 15 THEN PRINT G$;: GOTO 6410

6425 RV = A

6430 GOSUB 6850: GOSUB 8200: GOTO 1040

6500 GOSUB 6800

6510 PRINT "LOAD": PRINT "SOUNDBASE 1-3?";: PRINT : PRINT

6520 GOSUB 510: IF A < 1 OR A > 3 THEN 6850: RETURN

6530 PRINT "LOADING": PRINT "SOUNDBASE";A

6540 PRINT D$;"BLOAD SOUNDBASE";A

6545 MD = PEEK (13823): IF MD < 2 OR MD > 7 THEN MD = 2

6550 POKE X9,0:G7 = A: GOSUB 6850: GOSUB 8200: RETURN

6800 POKE 34,BO: VTAB BO: IF NOT F1 THEN RETURN

6810 POKE 33,14: POKE 32,26: POKE 34,14: PRINT : VTAB 15: RETURN

6850 PRINT : IF F1 THEN CALL - 936

6855 VTAB BO: CALL - 958

6860 POKE 33,40: POKE 32,0: RETURN

7000 POKE 34,0: HOME :F1 = 0

7005 VTAB BO - 1: CALL - 958: VTAB 1: HTAB 1

7010 PRINT "........................................"

7020 PRINT "...............LOAD/SAVE................"

7030 PRINT "........................................";

7040 VTAB ME

7050 PRINT "1 SOUND SEQUENCER ][ MENU"

7060 PRINT "2 LOAD SEQUENCE"

7070 PRINT "3 SAVE SEQUENCE"

7080 PRINT "4 LOCK A SEQUENCE"

7082 PRINT "5 UNLOCK A SEQUENCE"

7084 PRINT "6 DISK CATALOG"

7090 PRINT : PRINT : PRINT "SEQUENCE LOADED: ";AS$;: CALL - 958: IF PEEK (X0) THEN PRINT " (MODIFIED)"

7100 PRINT :SE = 6

7110 ONERR GOTO 7900

7120 GOSUB 410: ON A GOTO 7800,7200,7400,7500,7550,7600

7130 GOTO 7120

7200 GOSUB 7700

7210 IF N$ = "" THEN 7005

7220 PRINT D$;"BLOAD SEQU.";N$;",A";BS

7270 AS$ = N$: GOSUB 8500: POKE X0,0

7280 GOTO 7005

7400 GOSUB 7700

7410 IF N$ = "" THEN 7005

7420 PRINT D$;"BSAVE SEQU.";N$;",A";BS;",L196"

7470 AS$ = N$: GOSUB 8500: POKE X0,0

7480 GOTO 7005

7500 GOSUB 7700

7510 IF N$ = "" THEN 7005

7520 PRINT D$;"LOCK SEQU.";N$

7530 GOTO 7005

7550 GOSUB 7700

7560 IF N$ = "" THEN 7005

7570 PRINT D$;"UNLOCK SEQU.";N$

7580 GOTO 7005

7600 PRINT D$;"CATALOG"

7610 PRINT : PRINT "PRESS SPACE TO CONTINUE";: GET A$: PRINT : GOTO 7000

7700 VTAB BO: PRINT "INPUT FILE NAME OR <RETURN> TO CANCEL"

7710 PRINT : PRINT "NAME";: INPUT N$

7715 IF LEN (N$) > 20 THEN PRINT G$: PRINT "FILE NAME TOO LONG, PRESS SPACE ":N$ = "": GET A$

7720 RETURN

7800 POKE 216,0: POKE 34,BO: GOTO 1000

7900 REM

7910 EC = PEEK (222): PRINT G$

7920 IF EC > 11 OR EC < 1 THEN EC = 0

7980 PRINT EC$(EC)

7990 PRINT : PRINT "PUSH SPACE TO CONTINUE";: GET A$

7995 GOTO 7000

8000 SL = PEEK (X1):O1 = PEEK (X2):MD = PEEK (X3):RV = PEEK (X4):G7 = PEEK (XB)

8200 POKE Q5,O2: POKE X3,MD: POKE D1,RV: POKE XB,G7: POKE X2,O1: POKE X4,RV: RETURN

8400 PRINT "SET VOLUME": PRINT "(0-15) ";: GOSUB 530

8410 IF A > 15 OR A < 0 THEN PRINT G$;: GOTO 8400

8415 O1 = A

8420 O2 = O1 + 1: IF O2 = 1 THEN O2 = - 1

8430 O2 = 1.414 ^ O2:O2 = INT (O2)

8440 DS = SL * 16: POKE OL + DS,O2: GOSUB 8200: RETURN

8500 NA = LEN (AS$): IF NA > 20 THEN NA = 20

8510 FOR V1 = 1 TO NA: POKE 11238 + V1, ASC ( MID$ (AS$,V1,1)): NEXT V1

8515 POKE 11238 + V1,0: RETURN

8600 AS$ = "":V1 = 11238:V2 = 1

8610 V3 = PEEK (V1 + V2): IF V3 = 0 THEN RETURN

8620 AS$ = AS$ + CHR$ (V3):V2 = V2 + 1: IF V2 > 20 THEN RETURN

8630 GOTO 8610

9000 CL = 11264:FR = CL + 1:IG = FR + 3:J1 = IG + 3

9010 RT = J1 + 3:PS = RT + 3:Q1 = PS + 3:RD = Q1 + 3

9030 SA = 11292:LE = SA + 1:P1 = LE + 1

9040 PD = P1 + 1:Q2 = PD + 1:S1 = Q2 + 1:P2 = S1 + 1

9050 SB = P2 + 1:G1 = SB + 1:G2 = G1 + 1:PU = G2 + 1

9060 R1 = PU + 1:R2 = R1 + 1:R3 = R2 + 1:R4 = R3 + 1

9070 R5 = R4 + 1:R6 = R5 + 1:MP = R6 + 1

9080 Q3 = MP + 1:S2 = Q3 + 1:S3 = S2 + 1

9090 S4 = S3 + 1:D1 = S4 + 1:Q4 = D1 + 1:Q5 = Q4 + 2

9100 X0 = Q5 + 1:X1 = X0 + 1:X2 = X1 + 1:X3 = X2 + 1:X4 = X3 + 1

9110 X5 = X4 + 1:X6 = X5 + 1:X7 = X6 + 1:X8 = X7 + 1:X9 = X8 + 1:XS = X9 + 1

9120 XB = XS + 1:PM = XB + 1

9130 T3 = PM + 1:T4 = T3 + 1:T5 = T4 + 1:T6 = T5 + 1:T7 = T6 + 1

9140 T1 = T7 + 1:PR = T1 + 2:MR = PR + 1

9150 XM = MR + 1:XA = XM + 1:XE = XA + 1

9200 OL = 49285:MD = 2

9210 ME = 6:SE = 5:BO = 18:MO = 17:M1 = 24

9220 KB = - 16384:KS = - 16368:G$ = ""

9230 BS = PEEK (Q4) + PEEK (Q4 + 1) * 256

9240 M1$(1) = "SND":M1$(2) = "NTE":M1$(3) = "DUR":M1$(4) = "DIR":M1$(5) = "VOL"

9250 M2$(1) = "PAT":M2$(2) = "CNT":AS$ = "DEMO1"

9260 O1 = 8:SL = 2:RV = 6:PL = 5:SS = 1

9270 DIM EC$(12)

9280 EC$(0) = "ERROR"

9290 EC$(4) = "WRITE PROTECTED"

9300 EC$(6) = "FILE NOT FOUND"

9310 EC$(8) = "I/O ERROR"

9320 EC$(9) = "DISK FULL"

9330 EC$(10) = "FILE LOCKED"

9340 EC$(11) = "SYNTAX ERROR"

9999 RETURN