Classic Computer Magazine Archive PROGRAM LISTING: 85-04/SPEECHED.LST


10 REM S.A.M. SPEECH EDITOR
20 REM BY MARK GIAMBRUNO
30 REM ANTIC MAGAZINE
40 REM WARNING! THIS PROGRAM REQUIRES    S.A.M. AND WILL LOCK UP YOUR COM-     PUTER WITHOUT IT.
50 REM PLEASE READ THE SPEECH EDITOR     ARTICLE BEFORE USING THIS PROGRAM.
70 GRAPHICS 0:SETCOLOR 1,0,8:SETCOLOR 2,6,0:POKE 752,1:IF PEEK(8192)<>104 THEN GOTO 1760
80 DIM SAM$(255),NSAM$(255),NREC$(255),TEMPFN$(12),FN$(14),CHOICE$(1),DIR$(17)
90 SAM=8192:LIGHTS=8210:SPEED=72:PITCH=64:THROAT=128:MOUTH=128:CONSOLE=53279:CHOICE=1:COUNT=0:SAMFLAG=1
100 SPEEDREG=8208:PITCHREG=8209:THROATREG=18050:MOUTHREG=18051
110 REM MENU
120 ? CHR$(125):POSITION 11,1:? "�������Ƞ�����Ҡ�"
130 POSITION 12,3:? "












"
140 POSITION 12,4:? " ����Ժ  SAM "
150 POSITION 12,5:? " LIGHTS: OFF "
160 POSITION 12,6:? " SPEED:  72  "
170 POSITION 12,7:? " PITCH:  64  "
180 POSITION 12,8:? " KNOBS:  ON  "
190 POSITION 12,9:? " THROAT: 128 "
200 POSITION 12,10:? " MOUTH:  128 "
210 POSITION 12,11:? ""
220 POSITION 6,13:? "USE ������Ԡ TO CHOOSE ITEM":POSITION 6,14:? "USE ������Π/� TO ALTER ITEM"
230 POSITION 6,15:? "USE ����Ԡ TO ENTER PHRASE":POSITION 6,16:? "USE ����̭Ҡ TO RESET EDITOR"
240 POSITION 6,17:? "USE ����̭Ѡ TO QUIT EDITING":POSITION 6,18:? "USE ���à TO LOAD/SAVE PHRASE"
250 POSITION 2,19:? ""
260 REM CHECK FOR KNOBS
270 IF PEEK(17800)=104 AND PEEK(23789)=104 THEN GOTO 310
280 IF PEEK(17800)=104 AND PEEK(18187)=32 THEN POKE 18187,0:GOTO 310
290 IF PEEK(17800)=104 THEN KNOBS=17800:KNOBSIN=1:KNOBSFLAG=1:GOTO 330
300 IF PEEK(23789)=104 THEN KNOBS=23789:KNOBSIN=1:KNOBSFLAG=1:THROATREG=24039:MOUTHREG=24040:GOTO 330
310 KNOBSIN=0:KNOBSFLAG=0:POSITION 22,8:? "N/A":POSITION 22,9:? "---":POSITION 22,10:? "---"
320 REM MAIN LOOP
330 POKE 754,255
340 IF PEEK(CONSOLE)=6 THEN GOSUB 440
350 IF PEEK(CONSOLE)=5 THEN GOSUB 560
360 IF PEEK(CONSOLE)=3 THEN GOSUB 650
370 IF PEEK(754)=168 THEN POKE 754,255:POKE LIGHTS,0:RUN 
380 IF PEEK(754)=175 THEN POKE 752,0:POKE 754,255:POKE 764,255:GRAPHICS 0:NEW 
390 IF PEEK(754)=28 THEN POKE 754,255:GOSUB 1160
400 GOTO 340
410 REM DELAY SUBROUTINE
420 FOR DELAY=0 TO 30:NEXT DELAY:RETURN 
430 REM START SUBROUTINE
440 POKE 754,255:POKE 764,255:POKE SPEEDREG,SPEED:POKE PITCHREG,PITCH
450 IF KNOBSFLAG<>0 THEN POKE THROATREG,THROAT:POKE MOUTHREG,MOUTH:A=USR(KNOBS)
460 IF SAMFLAG=1 THEN SAM$=NSAM$
470 IF SAMFLAG=0 THEN SAM$=NREC$
480 POKE 703,4:POKE 752,0:ROW=0:IF LEN(SAM$)<76 THEN ROW=1
490 POKE 656,ROW:? SAM$:POKE 656,ROW:POKE 657,1:INPUT SAM$:IF LEN(SAM$)>=114 THEN SAM$(114)=""
500 POKE 752,1:? CHR$(125):POKE 703,24
510 A=USR(SAM)
520 IF SAMFLAG=1 THEN NSAM$=SAM$
530 IF SAMFLAG=0 THEN NREC$=SAM$
540 RETURN 
550 REM SELECT SUBROUTINE
560 GOSUB 420
570 IF CHOICE=1 THEN CHOICE=2:POSITION 14,4:? "INPUT:":POSITION 14,5:? "�����Ӻ":RETURN 
580 IF CHOICE=2 THEN CHOICE=3:POSITION 14,5:? "LIGHTS:":POSITION 14,6:? "����ĺ":RETURN 
590 IF CHOICE=3 THEN CHOICE=4:POSITION 14,6:? "SPEED:":POSITION 14,7:? "����Ⱥ":RETURN 
600 IF CHOICE=4 THEN CHOICE=5:POSITION 14,7:? "PITCH:":POSITION 14,8:? "����Ӻ":RETURN 
610 IF CHOICE=5 THEN CHOICE=6:POSITION 14,8:? "KNOBS:":POSITION 14,9:? "����Ժ":RETURN 
620 IF CHOICE=6 THEN CHOICE=7:POSITION 14,9:? "THROAT:":POSITION 14,10:? "����Ⱥ":RETURN 
630 IF CHOICE=7 THEN CHOICE=1:POSITION 14,10:? "MOUTH:":POSITION 14,4:? "����Ժ":RETURN 
640 REM OPTION SUBROUTINE
650 IF CHOICE=1 THEN GOTO 730
660 IF CHOICE=2 THEN GOTO 780
670 IF CHOICE=3 THEN GOTO 890
680 IF CHOICE=4 THEN GOTO 1030
690 IF CHOICE=5 THEN GOTO 820
700 IF CHOICE=6 THEN GOTO 1060
710 IF CHOICE=7 THEN GOTO 1110
720 REM SAM OR REC OPTION
730 GOSUB 420
740 IF SAMFLAG=0 THEN SAM=8192:SAMFLAG=1:POSITION 22,4:? "SAM":RETURN 
750 IF SAMFLAG=1 AND PEEK(18187)<>32 THEN GOTO 1700
760 SAM=8199:SAMFLAG=0:POSITION 22,4:? "REC":RETURN 
770 REM LIGHTS ON/OFF OPTION
780 GOSUB 420
790 IF SPEEDREG=8208 THEN SPEEDREG=8206:PITCHREG=8207:POKE LIGHTS,1:POSITION 22,5:? "ON ":RETURN 
800 SPEEDREG=8208:PITCHREG=8209:POKE LIGHTS,0:POSITION 22,5:? "OFF":RETURN 
810 REM KNOBS SUBROUTINE
820 IF KNOBSIN=0 THEN GOTO 1710
830 GOSUB 420
840 IF KNOBSFLAG=0 THEN KNOBSFLAG=1:POSITION 22,8:? "ON ":POSITION 22,9:? "   ":POSITION 22,10:? "   ":GOTO 870
850 KNOBSFLAG=0:POKE THROATREG,128:POKE MOUTHREG,128:A=USR(KNOBS):POSITION 22,8:? "OFF"
860 POSITION 22,9:? "---":POSITION 22,10:? "---":RETURN 
870 POSITION 22,9:? THROAT:POSITION 22,10:? MOUTH:RETURN 
880 REM SPEED SUBROUTINE
890 VALUE=SPEED:X=22:Y=6:GOSUB 920
900 SPEED=VALUE:RETURN 
910 REM PRINT VALUE SUBROUTINE
920 IF PEEK(764)=15 THEN VALUE=VALUE-1:GOTO 940
930 VALUE=VALUE+1
940 IF VALUE<0 THEN VALUE=255:GOTO 980
950 IF VALUE>255 THEN VALUE=0
960 IF VALUE<10 THEN POSITION X+1,Y:? "  ":GOTO 980
970 IF VALUE<100 THEN POSITION X+2,Y:? " "
980 POSITION X,Y:? VALUE
990 IF COUNT<5 THEN COUNT=COUNT+1:FOR DLAY=0 TO 30:NEXT DLAY
1000 IF PEEK(CONSOLE)=3 THEN GOTO 920
1010 POKE 764,255:COUNT=0:RETURN 
1020 REM PITCH SUBROUTINE
1030 VALUE=PITCH:X=22:Y=7:GOSUB 920
1040 PITCH=VALUE:RETURN 
1050 REM THROAT SUBROUTINE
1060 IF KNOBSIN=0 THEN GOTO 1710
1070 IF KNOBSFLAG=0 THEN GOTO 1690
1080 VALUE=THROAT:X=22:Y=9:GOSUB 920
1090 THROAT=VALUE:RETURN 
1100 REM MOUTH SUBROUTINE
1110 IF KNOBSIN=0 THEN GOTO 1710
1120 IF KNOBSFLAG=0 THEN GOTO 1690
1130 VALUE=MOUTH:X=22:Y=10:GOSUB 920
1140 MOUTH=VALUE:RETURN 
1150 REM LOAD/SAVE MENU
1160 TRAP 1650
1170 OPEN #1,4,0,"K:":POKE 764,255:POSITION 4,20:? "�IRECTORY, �OAD OR �AVE PHRASE?";
1180 POKE 694,0:POKE 702,64:GET #1,KEY:IF KEY=68 OR KEY=76 OR KEY=83 THEN ? CHR$(KEY):GOTO 1200
1190 ? "�";:GOTO 1180
1200 IF KEY<>68 THEN GOTO 1340
1210 REM SHOW DIRECTORY
1220 CLOSE #1:TRAP 1270:POKE 703,4:POKE 754,255:OPEN #1,6,0,"D:*.*"
1230 ? CHR$(125):INPUT #1,DIR$:POKE 656,0:? DIR$;"  ";:INPUT #1,DIR$:? DIR$
1235 INPUT #1,DIR$:? DIR$;"  ";:INPUT #1,DIR$:? DIR$
1240 IF DIR$(5)="FREE SECTORS" THEN GOTO 1280
1250 GOSUB 1300
1260 POKE 754,255:GOTO 1230
1270 ? 
1280 GOSUB 1300
1290 CLOSE #1:? CHR$(125):POKE 703,24:POKE 754,255:RETURN 
1300 ? "      ���Ԡ��٠��٠�Ϡ��������"
1310 IF PEEK(754)<>255 OR PEEK(CONSOLE)<>7 THEN POKE 754,255:POKE 764,255:RETURN 
1320 GOTO 1310
1330 REM ENTER FILENAME
1340 FN$="D:":POKE 752,0:? " �����Ҡ������Ů��Ԡ ";
1350 POKE 694,0:POKE 702,64:GET #1,FN
1360 IF (FN>47 AND FN<58) OR (FN>64 AND FN<91) THEN ? CHR$(FN);:FN$(LEN(FN$)+1)=CHR$(FN):GOTO 1350
1370 IF FN=126 THEN FN$(LEN(FN$))="":? CHR$(FN);:GOTO 1350
1380 IF FN<>155 THEN ? "�";:GOTO 1350
1390 POKE 752,1:? 
1400 IF KEY=76 THEN ? " ������Š�������Ǡ����ӿ��ٯΩ�":POKE 694,0:POKE 702,64:GET #1,KEY
1410 CLOSE #1:POSITION 0,20:? "����"
1420 IF KEY=83 THEN GOTO 1590
1430 REM LOAD PHRASE
1440 OPEN #1,4,0,FN$
1450 TRAP 1550:SAM$=""
1460 IF KEY<>89 THEN GET #1,NSAMFLAG:FOR L=1 TO 6:GET #1,Z:NEXT L:IF NSAMFLAG<>SAMFLAG THEN GOSUB 740
1470 IF KEY<>89 THEN GOTO 1540
1480 GET #1,NSAMFLAG:GET #1,NLIGHTS:GET #1,SPEED:GET #1,PITCH:GET #1,NKNOBSFLAG:GET #1,THROAT:GET #1,MOUTH
1485 IF NSAMFLAG=0 AND PEEK(18187)<>32 THEN GOTO 1500
1490 IF NSAMFLAG<>SAMFLAG THEN GOSUB 740
1500 IF NLIGHTS<>PEEK(LIGHTS) THEN GOSUB 780
1510 SPEED=SPEED-1:GOSUB 890:PITCH=PITCH-1:GOSUB 1030:IF KNOBSIN=0 THEN GOTO 1540
1520 THROAT=THROAT-1:GOSUB 1080:MOUTH=MOUTH-1:GOSUB 1130
1530 IF NKNOBSFLAG<>KNOBSFLAG THEN GOSUB 820
1540 IF NSAMFLAG=0 AND PEEK(18187)<>32 THEN SAM$=NSAM$:GOTO 1570
1545 FOR L=1 TO 113:GET #1,CHAR:SAM$(L,L)=CHR$(CHAR):NEXT L
1550 IF SAMFLAG=1 AND SAM$<>"" THEN NSAM$=SAM$:GOTO 1570
1560 IF SAM$<>"" THEN NREC$=SAM$
1570 CLOSE #1:GOSUB 440:RETURN 
1580 REM SAVE PHRASE
1590 OPEN #1,8,0,FN$
1600 PUT #1,SAMFLAG:PUT #1,PEEK(LIGHTS):PUT #1,SPEED:PUT #1,PITCH:PUT #1,KNOBSFLAG:PUT #1,THROAT:PUT #1,MOUTH
1610 IF SAM$="" THEN GOTO 1630
1620 FOR L=1 TO LEN(SAM$):CHAR=ASC(SAM$(L,L)):PUT #1,CHAR:NEXT L
1630 CLOSE #1:POKE 754,255:GOTO 1720
1640 REM ERROR HANDLING
1650 CLOSE #1:POKE 754,255:POKE 764,255:ERROR=PEEK(195):POSITION 2,20:? "�����":POSITION 11,20
1660 IF ERROR=170 THEN ? "����Š��Ԡ����Ġ":GOTO 1740
1670 IF ERROR=165 THEN ? "���Ԡ��������Š":GOTO 1740
1680 ? "  �����Ҡ��";:? ERROR:GOTO 1740
1690 POSITION 12,20:? "������Ӡ��Ԡ�Π":GOTO 1740
1700 POSITION 8,20:? "��������Ҡ��Ԡ������Š":GOTO 1740
1710 POSITION 9,20:? "������Ӡ��Ԡ������Š":GOTO 1740
1720 POSITION 13,20:? "�����Š���Ġ":GOTO 1740
1730 POSITION 2,20:? "���":POSITION 12,20:? "��������Ҡ����٠"
1740 IF PEEK(764)<>255 OR PEEK(CONSOLE)<>7 THEN POSITION 2,20:? "����":RETURN 
1750 GOTO 1740
1760 ? CHR$(125):POSITION 10,2:? "��Ӯ��ͮ���Ԡ����Ġ":POSITION 9,4:? "����Π��Ơ�������Ҡ��"
1770 POSITION 9,5:? "��ŭ���Ԡ���ȠӮ��ͮ�":POSITION 11,8:? "THE S.A.M. EDITOR":POSITION 11,9
1780 ? "CAN BE USED WITH:":POSITION 11,11:? "1-S.A.M. ALONE":POSITION 11,12:? "2-SAM & RECITER":POSITION 11,13
1790 ? "3-SAM & KNOBS.SAM":POSITION 11,14:? "4-SAM & KNOBS.REC":POSITION 11,15:? "5-SAM, RECITER"
1800 POSITION 13,16:? "& KNOBS.REC"
1810 POSITION 10,18:? "NOTE: DON'T USE SAM,":POSITION 10,19:? "RECITER & KNOBS.SAM"
1820 POSITION 10,20:? "-OR A COMBINATION OF":POSITION 10,21:? "KNOBS.SAM & KNOBS.REC"
1830 GOTO 1830

Back to previous page