Text To Speech for #pico8 and the #pico1k  jam in less than 1024 bytes

Features

Two formants speech synthesis with the phonemes abde๐˜ฆfghijklmnoprs๐˜ดt๐˜ตuvwz๐˜ป

How to use ?

Type some text to hear it badly spoken

Additionally, you can rip apart the code and use it in your own game or demos

Can you beatbox ?

No really, can you ? Can you make Sp1ko8 beat box ?

Share you best beats in the comments ;)

Source code

poke(24365,1)
d="diz is a spich synthesizer for pico-ejt"
text=d
t0=0
function _draw()
 cls()
 rectfill(8,103,12,109,8)
 ?"โถwโถtแถœ7s๐˜ฑ1๐˜ฌ๐˜ฐ-8"
 ?"แถœ5๐˜ต๐˜ฆ๐˜น๐˜ต ๐˜ต๐˜ฐ ๐˜ด๐˜ฑ๐˜ช๐˜ค๐˜ฉ ๐˜ฃ๐˜บ @p01 ๐˜ง๐˜ฐ๐˜ณ ๐˜ฑ๐˜ช๐˜ค๐˜ฐ1k"
 s="  ๐˜ต๐˜บ๐˜ฑ๐˜ฆ ๐˜ด๐˜ฐ๐˜ฎ๐˜ฆ๐˜ต๐˜ฉ๐˜ช๐˜ฏ๐˜จ j๐˜ช๐˜ฎ!"
 if(t0%8>4)s="  ๐˜ค๐˜ข๐˜ฏ ๐˜บ๐˜ฐ๐˜ถ ๐˜ฃ๐˜ฆ๐˜ข๐˜ต๐˜ฃ๐˜ฐ๐˜น?"
 ?s
 circfill(64,64,32,12)
 circfill(64-28,64+4,8)
 circfill(64+28,64+4,8)
 circfill(64,64+64,40)
 ?"โ—      โ—",48-t0*8%6,56,0
 if stat(108)<256 then
  local i,f,g,h,k,l,q,p=0,0,0,0,0,0,{o={52,55,10,10,6},i={45,96,10,10,3},j={45,96,10,10,3},u={45,54,10,10,3},a={58,70,10,10,15},e={54,90,10,10,15},๐˜ฆ={60,80,10,10,12},w={43,54,10,10,1},v={42,60,20,10,3},๐˜ต={42,60,40,1,5},z={45,68,10,5,3},๐˜ป={44,70,50,1,5},b={44,44,10,10,2},d={44,99,10,10,2},m={44,60,10,10,2},n={44,99,10,10,2},r={43,50,30,8,3},l={48,60,10,10,5},g={42,50,15,5,1},f={48,60,10,10,4,1},h={62,66,30,10,10,1},s={120,150,80,40,5,1},๐˜ด={20,70,99,99,10,1},p={44,50,5,10,2,1},t={44,60,10,20,3,1},k={60,99,10,10,6,1}}
  for a=0,255do
   v=t0*8%#text+1
   p=q[text[v]]
   if(p!=nil)then
    i=1-p[3]/256
    m=1-p[4]/256
    f,g=g,h
    j,k=k,l
    w=(p[6]!=1and(t0*96%1)-.5or rnd(.5)-.25)/4
    h=i*(g*2*sin(p[1]/25)-i*f)+w
    l=m*(k*2*sin(p[2]/25)-m*j)+w
    r=min(1,4*sin(t0*3))*((h+l)*p[5]+(g+k)/2+(f+j)/8)
   end
   y=r-128
   poke(17152+a,y)
   pset(48+a/8,84+y/24-4*sin(a/512))
   t0+=1/5520
  end
  serial(2056,17152,256)
 end
 if(stat(30))then
  if(text==d)text=""
  c=stat(31)
  text..=c
  c=ord(c)
  if(c==112)poke(24368,1)
  if(c==8)text=sub(text,1,#text-2)
 end
 ?text,16-4*v,104,7
end
StatusReleased
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorMahtieu 'p01' Henri
Made withPICO-8
TagsAudio, PICO-8

Comments

Log in with itch.io to leave a comment.

if you butcher the word enough you can almost here it "heellao" to you too, blue man :-)

This program is amazing! Well done on building it within the memory constraints and having a super creepy blue guy.

I found a beat:

waldwaldwaldwaldwaladad

Itโ€™s kind of hypnotic after a while. I found that DL makes a soft pop sound, and A can be used as a kind of snare drum sound.

I have some beats.

Train that is very far away: TTTTTTTTTTTTTT

Train that is far away:
FFFFFFFFFFFFFF

Train that is medium distance away:
KKKKKKKKKKK

Train that is close by:
HHHHHHHHHHH