Skip to content

Instantly share code, notes, and snippets.

@scruss
Created June 15, 2022 03:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scruss/446c42f14e03e7e8075445ada57f76ff to your computer and use it in GitHub Desktop.
Save scruss/446c42f14e03e7e8075445ada57f76ff to your computer and use it in GitHub Desktop.
Speaks a limerick from SPO256-AL2 text phonemes: SPO256-AL2 emu on RC2040, CP/M MBasic
10 REM St Bees - scruss, 2022-06 - SPO256-AL2 emu on RC2040, CP/M MBasic
20 KAL$="PA1PA2PA3PA4PA5/OY/AY/EH/KK3/PP/JH/NN1/IH/TT2/RR1/AX/MM/TT1/DH1/IY/EY/DD1/UW1/AO/AA/YY2/AE/HH1/BB1/TH/UH/UW2/AW/DD2/GG3/VV/GG1/SH/ZH/RR2/FF/KK2/KK1/ZZ/NG/LL/WW/XR/WH/YY1/CH/ER1/ER2/OW/DH2/SS/NN2/HH2/OR/AR/YR/GG2/EL/BB2/"
30 ALV$="00*01*02*03*04*05*06*07*08**09*10*11**12*13**14**15*16*17**18**19*20*21**22**23*24*25**26*27**28**29*30*31**32*33**34**35*36**37*38*39**40*41**42**43*44*45*46*47*48*49**50*51**52**53*54**55*56**57**58*59*60*61**62*63***"
40 DEF FNLOOKUP$(N$)=LEFT$(RIGHT$(ALV$,LEN(KAL$)-INSTR(KAL$,N$)+1),2)
50 READ PHON$,TEXT$
60 IF PHON$="end" THEN GOTO 175
70 PRINT "(";TEXT$;")"
80 WHILE (LEN(PHON$)>0)
90 SPCPOS%=INSTR(PHON$," ")
100 IF SPCPOS%=0 THEN P$=PHON$:PHON$="" ELSE P$=LEFT$(PHON$,SPCPOS%-1):PHON$=RIGHT$(PHON$,LEN(PHON$)-SPCPOS%)
110 PRINT P$+" ";
120 OUT 48,VAL(FNLOOKUP$(P$))
130 IF INP(48)>0 GOTO 130
140 WEND
150 PRINT
160 PRINT
170 GOTO 50
175 PRINT:END
180 DATA "/DH1/ /EH/ /RR1/ PA4 /WW/ /AA/ /ZZ/ PA4 /AX/ PA4 /YY1/ /AX/ /NG/ PA4 /MM/ /AE/ /NN1/ PA4 /AX/ /VV/ PA4 /SS/ /EY/ /NN1/ /TT1/ PA4 /BB1/ /IY/ /ZZ/ PA5 PA4"
190 DATA "There was a young man of St. Bees"
200 DATA "/HH1/ /UW1/ PA4 /WW/ /AA/ /ZZ/ PA4 /SS/ /TT1/ /AX/ /NG/ PA4 /AO/ /NN1/ PA4 /DH1/ /AX/ PA4 /NN1/ /EH/ /KK3/ PA4 /BB1/ /AY/ PA4 /AX/ PA4 /WW/ /AA/ /SS/ /PP/ PA5 PA4"
210 DATA "Who was stung on the neck by a wasp."
220 DATA "/WW/ /IH/ /NN1/ PA4 /DH1/ /EY/ /IH/ PA4 /AE/ /SS/ /TT1/ PA4 /DD1/ /IH/ /DD1/ PA4 /IH/ /TT1/ PA4 /HH1/ /AX/ /RR1/ /TT1/ PA5 PA4"
230 DATA "When they asked did it hurt?"
240 DATA "/HH1/ /IY/ PA4 /RR1/ /IH/ PA1 /PP/ /LL/ /AY/ /DD1/ PA4 /NN1/ /AA/ /TT1/ PA4 /AX/ PA4 /BB1/ /IH/ /TT1/ PA5 PA4"
250 DATA "He replied not a bit!"
260 DATA "/IH/ /TT1/ PA4 /KK3/ /AX/ /NN1/ PA4 /DD1/ /UW1/ PA4 /IH/ /TT1/ PA4 /AX/ PA1 /GG1/ /EH/ /NN1/ PA4 /IH/ /FF/ PA4 /IH/ /TT1/ PA4 /LL/ /AY/ /KK3/ /SS/ PA5 PA1"
270 DATA "It can do it again if it likes."
280 DATA "end","fin"
@scruss
Copy link
Author

scruss commented Jun 16, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment