10 REM TUNE.2

30 D$ = CHR$ (4)

40 PRINT D$;"BLOAD ADA.2 BIN.22"

60 GOSUB 9000

80 IF PEEK (XM) = 1 THEN 160

90 GOSUB 8500

140 GOTO 200

160 GOSUB 8600

200 GOSUB 8100: GOSUB 8000: GOSUB 930: POKE XS,1: POKE XM,1: POKE PU,3: POKE MR,0: POKE Q3,0:F2 = 0

210 POKE 34,0: HOME : GOTO 1000

400 POKE KS,0

410 IF PEEK (KB) < 128 THEN 410

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

430 IF A < 1 OR A > SE THEN RETURN

440 VTAB 5 + A: INVERSE : PRINT A$: NORMAL : VTAB BO: RETURN

450 PRINT : VTAB BO: CALL - 958: GOTO 1010

500 B = PEEK (KB): IF B > 128 THEN B = B - 128

502 A$ = CHR$ (B):A = VAL (A$): RETURN

505 IF PEEK (KB) < 128 THEN 505

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

520 PRINT : VTAB BO - 1: CALL - 958: RETURN

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

610 RETURN

900 NS = VAL ( MID$ (NS$,MD,1))

910 IF A > NS THEN PRINT : VTAB BO: PRINT G$;: PRINT NS;" SOUNDS IN THIS MODE ": RETURN

920 NP = A

930 NS = VAL ( MID$ (NS$,MD,1)): IF MD = 2 AND NP = 7 OR MD = 2 AND NP = 8 THEN 950

940 POKE SA,SA(MD,NP): POKE LE,SL(MD): RETURN

950 POKE SA,SA(MD,NP): POKE LE,24: RETURN

1000 POKE 34,0: HOME : GOSUB 1500

1010 VTAB 1: PRINT "........................................"

1020 PRINT ".............TUNE MAIN MENU............."

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

1040 VTAB ME

1050 PRINT "1 ADA'S MAIN MENU"

1060 PRINT "2 ENTER VALUES"

1070 PRINT "3 LOAD/SAVE TUNE"

1080 VTAB ME: HTAB M1: PRINT "4 VOLUME (";O1;") "

1090 HTAB M1: PRINT "5 MODE (";MD;")"

1100 HTAB M1: PRINT "6 SOUND (";NP;")"

1150 GOSUB 600

1170 VTAB ME + 4: HTAB 12: PRINT "O-P CHNGE OCTV: ";MA

1190 SE = 3

1200 CALL MM: GOSUB 500

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

1220 IF A$ = "P" THEN GOSUB 5800: GOTO 1170

1230 IF A$ = "O" THEN GOSUB 5820: GOTO 1170

1240 IF A < 4 OR A > 6 THEN 1260

1250 VTAB A + 2: HTAB M1: INVERSE : PRINT A$: NORMAL : VTAB BO

1260 VTAB BO: POKE 34,BO + 1: ON A GOTO 6200,3000,7000,2000,5000,2500

1270 GOTO 1200

1500 INVERSE :V1 = 12:V2 = 11

1510 FOR V3 = 0 TO 3: VTAB V1 + V3: HTAB V2: PRINT " ": NEXT V3

1520 FOR V3 = 0 TO 2: NORMAL : VTAB V1 + V3: HTAB V2 + 1: PRINT " ";: HTAB V2 + 3: PRINT " ";: HTAB V2 + 7: PRINT " ";: HTAB V2 + 9: PRINT " ";

1530 HTAB V2 + 11: PRINT " ";: HTAB V2 + 15: PRINT " ";: HTAB V2 + 17: PRINT " ": NEXT V3

1540 VTAB V1 + 2: HTAB V2 + 1: PRINT "S";: HTAB V2 + 3: PRINT "D";: HTAB V2 + 7: PRINT "G";: HTAB V2 + 9: PRINT "H";: HTAB V2 + 11: PRINT "J";: HTAB V2 + 15: PRINT "L";: HTAB V2 + 17: PRINT ";"

1550 INVERSE : VTAB V1 + 4: HTAB V2: PRINT "Z X C V B N M , . /": NORMAL : RETURN

2000 GOSUB 8400: GOTO 450

2500 PRINT "ENTER SOUND (1 TO ";NS;") ?";: GOSUB 510

2510 IF A < 1 THEN 450

2520 GOSUB 900

2530 IF A > NS THEN GOTO 2500

2590 GOTO 450

3000 POKE 34,0: HOME :F1 = 0: POKE MR,0

3010 VTAB 1: PRINT "........................................"

3020 PRINT "..............ENTER VALUES.............."

3030 PRINT "........................................";

3040 VTAB ME:SE = 3

3050 PRINT "1 TUNE MAIN MENU"

3060 PRINT "2 SELECT GROUP"

3070 VTAB ME: HTAB M1: PRINT "3 SELECT NOTE"

3080 CALL MM: GOSUB 500

3090 IF A = 3 THEN INVERSE : VTAB ME: HTAB M1: PRINT A: NORMAL : GOTO 3110

3100 GOSUB 430

3110 ON A GOTO 1000,3200,3600

3120 POKE KS,0: GOTO 3080

3200 VTAB 8: PRINT : PRINT " GROUP";: INPUT A$:A = VAL (A$)

3210 IF A$ = "" THEN A = 1: GOTO 3240

3220 IF A < 1 AND F1 = 0 OR A > 9 AND F1 = 0 THEN CALL - 936: GOTO 3010

3230 IF A < 1 OR A > 9 THEN VTAB 8: PRINT : PRINT " GROUP ";GA;" ": GOTO 3040

3240 VTAB 8: CALL - 958:V3 = A - 1:GA = A: PRINT : PRINT " GROUP ";GA: PRINT : PRINT "NTE KEY P1 P2"

3250 V6 = V3 * 24

3260 FOR V1 = 0 TO 11: FOR V2 = 0 TO 1: GOSUB 3280: NEXT V2: NEXT V1:GA = A:F1 = 1

3270 MA = A: POKE PU,MA - 1: GOTO 3040

3280 VTAB V1 + 12: HTAB 1: PRINT 1 + V1 + V3 * 12;: HTAB 6: PRINT MID$ (TT$,V1 + 1,1);

3290 HTAB V2 * 4 + 10: PRINT PEEK (T2 + V6 + V1 * 2 + V2): RETURN

3600 IF F1 THEN 3640

3610 PRINT G$: VTAB BO: PRINT "ERR- GROUP NOT SELECTED"

3620 IF PEEK (KB) < 128 THEN 3620

3630 CALL - 936: GOTO 3010

3640 GOSUB 3900: VTAB 10: PRINT : PRINT "SELECT NOTE ";: INPUT A$:V4 = VAL (A$): IF A$ = "Q" THEN 3800

3650 IF A$ = "" THEN V4 = (GA - 1) * 12 + 1: GOTO 3670

3660 IF V4 < (GA * 12) - 11 OR V4 > GA * 12 THEN PRINT G$: GOTO 3640

3670 VTAB 10: PRINT : CALL - 868: PRINT " NOTE ";V4

3680 PRINT : CALL - 958

3690 FOR V1 = 0 TO 1

3700 PRINT "POS ";V1 + 1;": "; PEEK ((V4 - 1) * 2 + T2 + V1);

3710 INPUT A$:V5 = VAL (A$)

3720 IF A$ = "" AND V1 = 0 THEN NEXT V1

3730 IF A$ = "" THEN 3770

3740 IF A$ = "Q" THEN GOSUB 3810: GOTO 3800

3750 IF V5 < 0 OR V5 > 255 THEN PRINT G$;: GOTO 3700

3760 POKE (V4 - 1) * 2 + T2 + V1,V5:F2 = 1: NEXT V1

3770 GOSUB 3810

3780 V4 = V4 + 1: IF V4 > GA * 12 THEN 3800

3790 GOTO 3670

3800 CALL - 936: GOSUB 3910: GOTO 3010

3810 CALL - 936: GOSUB 3910: VTAB V4 - (GA - 1) * 12 + 11: HTAB 10: PRINT PEEK ((V4 - 1) * 2 + T2);" ";: HTAB 14: PRINT PEEK ((V4 - 1) * 2 + T2 + 1);" ": GOSUB 3900: RETURN

3900 POKE 33,18: POKE 32,22: POKE 34,10: RETURN

3910 POKE 33,40: POKE 32,0: POKE 34,8: RETURN

5000 PRINT "ENTER NEW MODE (2-7) ?";: GOSUB 510

5010 IF A < 2 OR A > 7 THEN GOTO 450

5020 MD = A:NP = 1: GOSUB 520: GOSUB 930: GOSUB 8000: GOTO 450

5800 MA = MA + 1: IF MA > 8 THEN MA = 1

5810 POKE PU,MA - 1: RETURN

5820 MA = MA - 1: IF MA < 1 THEN MA = 8

5830 GOTO 5810

6200 PRINT "MAIN MENU (Y/N)? ";

6220 GET A$: IF A$ < > "Y" THEN 450

6230 PRINT A$

6240 POKE X2,O1: PRINT D$;"RUN ADA.2"

6500 PRINT : GOSUB 520: PRINT "LOAD SOUNDBASE (1, 2, OR 3) ";

6510 GOSUB 510: IF A < 1 OR A > 3 THEN GOSUB 520: RETURN

6520 PRINT A: PRINT "LOADING SOUNDBASE";A

6530 PRINT D$;"BLOAD SOUNDBASE";A

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

6540 POKE X9,0:G7 = A:NP = 1: GOSUB 930: GOSUB 8000: GOSUB 520: RETURN

7000 BO = 19: POKE 34,0: HOME : POKE MR,0

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

7020 PRINT "........................................"

7030 PRINT "...............LOAD/SAVE................"

7040 PRINT "........................................";

7050 VTAB ME

7060 PRINT "1 TUNE MAIN MENU"

7070 PRINT "2 LOAD TUNING"

7080 PRINT "3 SAVE TUNING"

7090 PRINT "4 LOCK TUNING"

7100 PRINT "5 UNLOCK TUNING"

7110 PRINT "6 DISK CATALOG"

7120 PRINT : PRINT : PRINT "NOW LOADED: ";TN$;: CALL - 958: IF F2 THEN PRINT " (MODIFIED)"

7130 PRINT :SE = 6

7140 ONERR GOTO 7900

7150 GOSUB 400: ON A GOTO 7800,7200,7400,7500,7550,7600

7160 GOTO 7150

7200 GOSUB 7700

7210 IF N$ = "" THEN 7010

7220 PRINT D$;"BLOAD TUNE.";N$;",A";T2

7230 TN$ = N$: GOSUB 8500

7270 F2 = 0: GOTO 7010

7400 GOSUB 7700

7410 IF N$ = "" THEN 7010

7420 PRINT D$;"BSAVE TUNE.";N$;",A";T2;",L216"

7430 TN$ = N$: GOSUB 8500

7470 F2 = 0: GOTO 7010

7500 GOSUB 7700

7510 IF N$ = "" THEN 7010

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

7530 GOTO 7000

7550 GOSUB 7700

7560 IF N$ = "" THEN 7010

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

7580 GOTO 7000

7600 PRINT D$;"CATALOG"

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

7700 VTAB BO - 1: 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$: RETURN

7720 RETURN

7800 BO = 20: 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 POKE X2,O1: POKE X3,MD: POKE XB,G7: RETURN

8100 SL = PEEK (X1):O1 = PEEK (X2):MD = PEEK (X3):G7 = PEEK (XB): RETURN

8400 PRINT "SET VOLUME (0-15) ";: INPUT A$:A = VAL (A$): IF A$ = "" THEN RETURN

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: RETURN

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

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

8515 POKE 11213 + V1,0

8520 RETURN

8600 TN$ = "":V1 = 11213:V2 = 1

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

8620 TN$ = TN$ + 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:MM = 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

9120 XS = X9 + 1: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:NP = 1:MA = 4

9210 ME = 6:SE = 5:BO = 20:MO = 17:M1 = 23

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

9230 BS = PEEK (Q4) + PEEK (Q4 + 1) * 256:T2 = PEEK (T1) + PEEK (T1 + 1) * 256

9240 DIM TT$(15):TT$ = "ZSXDCVGBHNJM,L"

9250 DIM TN$(20):TN$ = "EVENTEMP":K2$ = "QWERTYUI":NS$ = "1886421"

9260 DIM EC$(12)

9270 EC$(0) = "ERROR":EC$(4) = "WRITE PROTECTED"

9280 EC$(6) = "FILE NOT FOUND":EC$(8) = "I/O ERROR"

9290 EC$(9) = "DISK FULL":EC$(10) = "FILE LOCKED":EC$(11) = "SYNTAX ERROR"

9300 SA(2,1) = 54:SA(2,2) = 62:SA(2,3) = 70:SA(2,4) = 78:SA(2,5) = 86:SA(2,6) = 94:SA(2,7) = 102:SA(2,8) = 126

9310 SA(3,1) = 54:SA(3,2) = 66:SA(3,3) = 78:SA(3,4) = 90:SA(3,5) = 102:SA(3,6) = 114:SA(3,7) = 126:SA(3,8) = 138

9320 SA(4,1) = 54:SA(4,2) = 70:SA(4,3) = 86:SA(4,4) = 102:SA(4,5) = 118:SA(4,6) = 134:SA(5,1) = 54:SA(5,2) = 78:SA(5,3) = 102:SA(5,4) = 126

9330 SA(6,1) = 54:SA(6,2) = 102:SA(7,1) = 54:SL(2) = 8:SL(3) = 12:SL(4) = 16:SL(5) = 24:SL(6) = 48:SL(7) = 96

10099 RETURN