30 HIMEM: 11213

40 D$ = CHR$ (4): GOSUB 9000

50 IF PEEK (11264) = 5 THEN 70

60 PRINT D$;"BLOAD ADA.2 BIN.20"

65 A = G7: GOSUB 6530

70 PRINT D$;"BLOAD ADA.2 BIN.21"

80 IF PEEK (XS) = 0 THEN 90

85 GOSUB 2200

90 GOSUB 8820

110 POKE 34,0: HOME

120 VTAB 1: HTAB 1

130 PRINT "........................................"

140 PRINT "............ADA'S MAIN MENU............."

150 PRINT "........................................";

160 POKE 32,9: PRINT : VTAB ME: ONERR GOTO 300

170 PRINT "1 SOUND DEMOS"

180 PRINT "2 PRESET DRUM PATTERNS"

190 PRINT "3 REAL TIME REC/PLAY"

200 PRINT "4 SOUND SEQUENCER ]["

205 PRINT "5 MUSICAL KEYBOARD"

210 PRINT "6 LOAD/SAVE BASE"

215 PRINT "7 ADA'S SLOT (";SL;")"

220 PRINT "8 SCALE TUNING"

230 PRINT "9 EXTERNAL TRIGGER"

260 SE = 9: GOSUB 410: POKE 216,0

262 POKE 32,0: VTAB BO - 2: PRINT

265 IF PEEK (KB) = 2 THEN GOSUB 6505: GOTO 490

270 ON A GOTO 1000,5000,3000,2000,2500,6000,7000,2600,4000

280 GOTO 160

300 POKE 32,0: POKE 34,0: POKE 216,0: END

410 POKE 34,BO + 1

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

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

490 VTAB BO - 2: CALL - 958: GOTO 120

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

510 RETURN

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

532 RETURN

1000 VTAB 3: PRINT "...............SOUND DEMOS..............": VTAB ME: CALL - 958

1010 VTAB ME: POKE LE,ML(MD)

1020 PRINT "1 ADA'S MAIN MENU"

1030 PRINT "2 RUN THROUGH SOUNDS"

1040 PRINT "3 RANDOM SLOW"

1050 PRINT "4 RANDOM FAST"

1060 PRINT "5 LAST SOUND SLOW"

1070 PRINT "6 LAST SOUND FAST"

1080 PRINT "7 ROLLER COASTER"

1090 PRINT "8 FALLING OBJECT"

1095 PRINT "9 UP THE SCALE"

1100 HTAB M1: VTAB ME: PRINT "A VOLUME (";O1;") "

1110 HTAB M1: PRINT "B MODE (";MD;") "

1120 GOSUB 500

1130 SE = 9: GOSUB 420: IF A > 0 AND A < 10 THEN 1180

1140 IF A$ = "A" THEN A = 10

1150 IF A$ = "B" THEN A = 11

1155 IF PEEK (KB) = 2 THEN GOSUB 6900: GOTO 1100

1160 IF A < 1 THEN 1130

1170 VTAB A - 4: HTAB M1: INVERSE : PRINT A$: NORMAL : VTAB BO

1180 ON A GOTO 110,1500,1400,1900,1600,1300,1700,1800,1950,1200,1210

1190 GOTO 1130

1200 GOSUB 8800: GOTO 1220

1210 GOSUB 8500

1220 PRINT : VTAB BO: CALL - 958: POKE SA,54: GOTO 1010

1300 V1 = INT ( RND (1) * 30) + 30: POKE PD,V1 + 1: CALL J1

1310 IF PEEK (KB) > 128 THEN 1010

1320 GOTO 1300

1400 V1 = INT ( RND (1) * MN(MD)) * ML(MD) + 54:V2 = INT ( RND (1) * 20) + 1

1410 IF V1 = 110 THEN V1 = 126

1420 POKE SA,V1: POKE PD,V2: CALL J1

1430 IF PEEK (KB) > 128 THEN 1010

1440 GOTO 1400

1500 FOR V1 = 54 TO MS(MD) STEP ML(MD)

1510 IF V1 = 110 THEN V1 = 126

1520 FOR V3 = 1 TO 5:V4 = V3 * 12

1530 POKE SA,V1: POKE PD,V4: CALL J1

1540 IF PEEK (KB) > 128 THEN 1010

1550 NEXT V3: NEXT V1: GOTO 1500

1600 V1 = INT ( RND (1) * 20) + 1: POKE PD,V1: CALL J1

1610 IF PEEK (KB) > 128 THEN 1010

1620 GOTO 1600

1700 FOR V1 = ML(MD) TO 1 STEP - 1: POKE LE,V1: CALL J1: IF PEEK (KB) > 128 THEN 1010

1710 NEXT V1

1720 FOR V1 = 1 TO ML(MD): POKE LE,V1: CALL J1: IF PEEK (KB) > 128 THEN 1010

1730 NEXT V1: GOTO 1700

1800 V1 = PEEK (SA) - 1

1810 FOR V2 = 1 TO ML(MD): POKE SA,V1 + V2

1820 POKE LE,ML(MD) + 1 - V2: CALL J1: IF PEEK (KB) > 128 THEN 1840

1830 NEXT V2: GOTO 1810

1840 POKE SA,V1 + 1: GOTO 1010

1900 V1 = INT ( RND (1) * MN(MD)) * ML(MD) + 54:V2 = INT ( RND (1) * 30) + 30

1910 IF V1 = 110 THEN V1 = 126

1920 POKE SA,V1: POKE PD,V2: CALL J1

1930 IF PEEK (KB) > 128 THEN 1010

1940 GOTO 1900

1950 FOR V1 = 30 TO 100: POKE PD,V1: CALL J1: IF PEEK (KB) > 128 THEN 1010

1960 NEXT V1: FOR V1 = 99 TO 31 STEP - 1: POKE PD,V1: CALL J1: IF PEEK (KB) > 128 THEN 1010

1970 NEXT V1: GOTO 1950

2000 PRINT "SOUND SEQUENCER (Y/N)?";

2010 GET A$: IF A$ < > "Y" THEN 490

2020 PRINT A$: GOSUB 8000

2050 PRINT D$;"RUN SEQUENCER.2"

2200 SJ = PEEK (X0):SL = PEEK (X1):O1 = PEEK (X2):MD = PEEK (X3):RV = PEEK (X4)

2210 PL = PEEK (X5):G3 = PEEK (X6):G6 = PEEK (X7):G5 = PEEK (X8):G7 = PEEK (XB)

2220 RETURN

2500 PRINT "MUSICAL KEYBOARD (Y/N)? ";

2510 GET A$: IF A$ < > "Y" THEN 490

2520 PRINT A$: GOSUB 8000

2550 PRINT D$;"RUN MUSKEY.2"

2600 PRINT "SCALE TUNING (Y/N)? ";

2610 GET A$: IF A$ < > "Y" THEN 490

2620 PRINT A$: GOSUB 8000

2650 PRINT D$;"RUN TUNE.2"

3000 RF = 0

3010 GOSUB 8000: VTAB 3: PRINT "...........REAL TIME REC/PLAY...........": VTAB ME: CALL - 958: POKE R1,(MD - 2) * 8

3020 PRINT "1 ADA'S MAIN MENU"

3030 PRINT "2 AS DF GH JK (P)": PRINT " ZX CV BN M,"

3040 PRINT "3 AS DF GH JK": PRINT " ZX CV BN M,"

3050 PRINT "4 AS DF GH": PRINT " ZX CV BN"

3060 PRINT "5 AS DF": PRINT " ZX CV"

3070 PRINT "6 AS": PRINT " ZX"

3080 PRINT "7 AS"

3090 VTAB ME: HTAB M1: PRINT " <- ->"

3095 VTAB BO: CALL - 958

3100 VTAB ME + 1: HTAB M2: PRINT "8 VOLUME (";O1;") "

3110 HTAB M2: PRINT "9 REC RATE (";G3;")";: CALL - 868: PRINT

3120 HTAB M2: PRINT "Q PITCH (";PL;")";: CALL - 868: PRINT

3130 HTAB M2: PRINT "W TRIG LEV (";G6;")";: CALL - 868: PRINT

3140 HTAB M2: PRINT "E FREERUN"

3150 HTAB M2: PRINT "- ";: IF RF = 0 THEN PRINT "REC/";: INVERSE : PRINT "PLAY": NORMAL : GOTO 3170

3160 INVERSE : PRINT "REC";: NORMAL : PRINT "/PLAY"

3170 GOSUB 500

3180 SE = 9: CALL RT

3185 IF PEEK (KB) = 2 THEN GOSUB 6900: GOTO 3010

3190 A = PEEK (R4): VTAB A - 1: HTAB M2: INVERSE

3200 IF A < 10 THEN PRINT A: GOTO 3220

3210 PRINT MID$ (RT$,A - 9,1)

3220 NORMAL :A = A - 6: VTAB BO + 1

3230 ON A GOTO 110,3400,3410,3420,3430,3440,3450,3480: GOTO 3010

3400 GOSUB 8800: GOTO 3095

3410 GOSUB 8100: GOTO 3095

3420 GOSUB 8600: GOTO 3095

3430 GOSUB 8400: GOTO 3095

3440 CALL FR: GOTO 3100

3450 IF RF = 0 THEN 3470

3460 RF = 0: POKE R5,RF: GOTO 3100

3470 RF = 255: POKE R5,RF: GOTO 3100

4000 GOSUB 8000: VTAB 3: PRINT "............EXTERNAL TRIGGER............": VTAB ME: CALL - 958

4010 VTAB ME

4020 PRINT "1 ADA'S MAIN MENU"

4030 PRINT "2 INPUT SYNC PULSE:";: IF PEEK (T3) THEN PRINT " ENABLED ": GOTO 4035

4032 PRINT " DISABLED"

4035 PRINT "3 INPUT PULSE DIR :";: IF PEEK (T7) THEN PRINT " HIGH (V-TRIG)": GOTO 4040

4037 PRINT " LOW (S-TRIG) "

4040 PRINT "4 OUTPUT SYNC PULSE:";: IF PEEK (T4) THEN PRINT " ENABLED ": GOTO 4050

4045 PRINT " DISABLED"

4050 PRINT "5 OUTPUT PULSE DIR :";: IF PEEK (T5) THEN PRINT " HIGH (V-TRIG) ": GOTO 4060

4055 PRINT " LOW (S-TRIG) "

4060 PRINT "6 OUTPUT PULSE DURA: ";T( PEEK (T6) / 127);" mS "

4140 SE = 6: GOSUB 420

4190 ON A GOTO 110,4200,4250,4210,4220,4230

4193 IF PEEK (KB) = 2 THEN GOSUB 6900: GOTO 4010

4195 GOTO 4140

4200 IF PEEK (T3) THEN POKE T3,0: GOTO 4010

4205 POKE T3,255: GOTO 4010

4210 IF PEEK (T4) THEN POKE T4,0: GOTO 4010

4215 POKE T4,255: GOTO 4010

4220 IF PEEK (T5) THEN POKE T5,0: POKE 49241,0: GOTO 4010

4225 POKE T5,255: POKE 49240,0: GOTO 4010

4230 IF PEEK (T6) > 127 THEN POKE T6,0: GOTO 4010

4240 POKE T6, PEEK (T6) + 127: GOTO 4010

4250 IF PEEK (T7) THEN POKE T7,0: GOTO 4010

4255 POKE T7,255: GOTO 4010

5000 VTAB 3: PRINT "..........PRESET DRUM PATTERNS..........": VTAB ME: CALL - 958

5010 PRINT "A ROCK1"

5020 PRINT "B ROCK2"

5030 PRINT "C COUNTRY"

5040 PRINT "D BALLAD"

5050 PRINT "E SHUFFLE"

5060 PRINT "F WALTZ"

5070 PRINT "G SWING"

5080 PRINT "H RHUMBA"

5090 PRINT "I SAMBA"

5100 PRINT "J REGGAE"

5110 PRINT "K DISCO"

5120 PRINT "L FUNK"

5130 VTAB ME: HTAB M1: PRINT " <- ->"

5135 VTAB BO: CALL - 958: VTAB ME + 1

5140 HTAB M1: PRINT "1 ADA'S MAIN MENU";

5150 HTAB M1: PRINT "2 VOLUME (";O1;")"

5155 HTAB M1: PRINT "3 MODE (";MD;")"

5160 HTAB M1: PRINT "4 TEMPO (";RV;")"

5170 HTAB M1: PRINT "5 PITCH (";PL;")";: CALL - 868: PRINT

5175 GOSUB 500

5180 CALL PS

5185 IF PEEK (KB) = 2 THEN GOSUB 6900: GOTO 5135

5190 A = PEEK (S3): VTAB A + 6: HTAB M1: INVERSE : PRINT A: NORMAL : VTAB BO + 1

5200 ON A GOTO 110,5240,5250,5220,5230

5210 GOTO 5200

5220 GOSUB 8700: GOTO 5135

5230 GOSUB 8600: GOTO 5135

5240 GOSUB 8800: GOTO 5135

5250 GOSUB 8500: GOTO 5135

6000 POKE 34,0: HOME

6010 PRINT "........................................"

6020 PRINT "...........LOAD/SAVE SOUNDBASE.........."

6030 PRINT "........................................";

6050 PRINT : VTAB ME: PRINT "1 ADA'S MAIN MENU"

6060 PRINT "2 LOAD NEW ";S$

6070 PRINT "3 SAVE NEW ";S$

6080 PRINT "4 LOCK A ";S$

6084 PRINT "5 UNLOCK A ";S$

6086 PRINT "6 DISK CATALOG"

6090 PRINT : PRINT : PRINT "BASE NOW LOADED: ";S$;G7;: CALL - 958: IF PEEK (X9) THEN PRINT " (MODIFIED)"

6110 PRINT : ONERR GOTO 6300

6120 SE = 6: GOSUB 420: ON A GOTO 6400,6500,6600,6800,6850,6700

6125 IF PEEK (KB) = 2 THEN GOSUB 6900: GOTO 6050

6130 GOTO 6120

6300 GOSUB 6310: GOTO 6000

6310 PRINT G$: PRINT "FILE LOCKED OR I/O ERROR": PRINT "PRESS SPACE TO CONTINUE ";: GET A$: PRINT : RETURN

6400 POKE 216,0: GOTO 110

6500 GOSUB 6505: GOTO 6050

6505 PRINT "LOAD ";S$;" (1, 2, OR 3) ";

6510 GOSUB 460: IF A < 1 OR A > 3 THEN PRINT : RETURN

6515 GOSUB 6520: RETURN

6520 PRINT A: PRINT "LOADING ";S$;A

6530 PRINT D$;"BLOAD SOUNDBASE";A

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

6540 POKE X9,0: RETURN

6600 PRINT "SAVE ";S$;" (1, 2, OR 3) ";

6610 GOSUB 460: IF A < 1 OR A > 3 THEN 6050

6612 B = A: PRINT ;B

6614 PRINT "ENTER ";S$;" MODE (2-7) ";: GOSUB 460: IF A < 2 OR A > 7 THEN 6050

6616 POKE 13823,A:MD = A: POKE R1,(MD - 2) * 8: PRINT A

6620 PRINT : PRINT "SAVING ";S$;B;" MODE";MD

6630 PRINT D$;"BSAVE SOUNDBASE";B;",A$35FF,L$6001"

6640 G7 = B: POKE X9,0: GOTO 6050

6700 POKE 34,0: PRINT D$"CATALOG"

6710 PRINT : PRINT "PRESS SPACE TO CONTINUE ";: GET A$: GOTO 6000

6800 PRINT "LOCK A ";S$;" (1, 2, OR 3) ";

6810 GOSUB 460: IF A < 1 OR A > 3 THEN 6050

6820 PRINT A: PRINT "LOCKING ";S$;A

6825 PRINT D$;"LOCK SOUNDBASE";A

6830 GOTO 6050

6850 PRINT "UNLOCK A ";S$;" (1, 2, OR 3) ";

6860 GOSUB 460: IF A < 1 OR A > 3 THEN 6050

6870 PRINT A: PRINT "UNLOCKING ";S$;A

6875 PRINT D$;"UNLOCK SOUNDBASE";A

6880 GOTO 6050

6900 PRINT : VTAB BO + 1: GOSUB 6505: GOSUB 8000: VTAB BO: CALL - 958: RETURN

7000 PRINT "SELECT NEW SLOT (0-7) ?";: GOSUB 460: IF A$ = "0" THEN SL = 0: GOTO 7030

7010 IF A < 1 OR A > 7 THEN 490

7020 SL = A

7030 GOSUB 8000: GOTO 490

8000 DS = SL * 16: POKE OL + DS,O2: POKE Q5,O2: POKE PD,PL: POKE R3,PL

8020 POKE S4,PL: POKE D1,RV: POKE SB,DS

8040 POKE G2,G3: POKE G1,G6: POKE R5,RF

8060 POKE X0,SJ: POKE X1,SL: POKE X2,O1: POKE X3,MD: POKE X4,RV

8070 POKE X5,PL: POKE X6,G3: POKE X7,G6: POKE X8,G5: POKE XB,G7

8080 RETURN

8100 PRINT "REC RATE (1-255) ";: GOSUB 530

8110 IF A > 255 OR A < 1 THEN PRINT G$;: GOTO 8100

8120 G3 = A: GOSUB 8000: RETURN

8400 PRINT "TRIG LEV (0-128) ";: GOSUB 530

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

8420 G6 = A: GOSUB 8000: RETURN

8500 PRINT "ENTER NEW MODE (2-7) ?";: GOSUB 460

8510 IF A < 2 OR A > 7 THEN RETURN

8520 MD = A: GOSUB 8000: RETURN

8600 PRINT "SET PITCH (1-100) ";: GOSUB 530

8610 IF A > 100 OR A < 1 THEN PRINT G$;: GOTO 8600

8620 PL = A: GOSUB 8000: RETURN

8700 PRINT "SET TEMPO (0-15) ";: GOSUB 530

8710 IF A > 15 OR A < 0 THEN PRINT G$;: GOTO 8700

8720 RV = A: GOSUB 8000: RETURN

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

8810 IF A > 15 OR A < 0 THEN PRINT G$;: GOTO 8800

8815 O1 = A

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

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

8840 GOSUB 8000: RETURN

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:XS = X9 + 1:XB = XS + 1:PM = XB + 1

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

9120 OL = 49285:MD = 2

9130 ME = 6:SE = 8:BO = 18:MO = 17:M1 = 24:M2 = 22

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

9150 RT$ = "QWE-":RA$ = "PLAY":RF = 0:S$ = "SOUNDBASE":T(0) = .1:T(1) = 1:T(2) = 5

9160 ML(2) = 8:ML(3) = 12:ML(4) = 16:ML(5) = 24:ML(6) = 48:ML(7) = 96

9170 MN(2) = 8:MN(3) = 8:MN(4) = 6:MN(5) = 4:MN(6) = 2:MN(7) = 1

9180 MS(2) = 126:MS(3) = 138:MS(4) = 134:MS(5) = 126:MS(6) = 102:MS(7) = 54

10000 SL = 3:O1 = 8:G7 = 1

10010 PL = 47:RV = 5:G3 = 10:G6 = 20:G5 = 7

10099 RETURN