L

LambdaSpeak Speech Synthesizer, Sample Player, RTC, MP3, Serial Interface, MIDI

Started by LambdaMikel, 08:56, 01 May 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LambdaMikel

#300
Quote from: LambdaMikel on 19:13, 26 February 19
For DecTalk, there are a lot of songs:

http://theflameofhope.co/device/

You can just alter the "demo01.bas" to make it sing any of these.

PS Rather than writing the ASCII characters to the &FBEE port like in demo01.bas, it is of course much better to simply pass the string to TFM's RSX command,


|SP,@text$   
   

or



|LAMBDASPEAK,@text$


(I think they are equivalent, right @GUNHED ?)

So, text$ can just be the DecTalk song (or simply plain ASCII for English or Spanish).

The $text$ buffer has a maximum size of 400 characters if I remember correctly; in case of a long phoneme / DecTalk string sequence (i.e., for the DecTalk songs), you might have to "split" into portions.



GUNHED

Yes they are. However in firmware a string can only be 255 bytes long.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

LambdaMikel

#302
Talking about DecTalk songs as found on the internet - because of the long strings, it is a bit tedious to play them; usually, it requires breaking them down into portions. For some songs that is easy, for others not so much. And, then there is also a slight delay between segments, especially if BASIC is used for transmission. With machine code, the delay should be almost not noticeable.

I am working on a "DecTalk Song Player" which makes this process easier, i.e., play a song TXT file from the archive

http://theflameofhope.co/device/SONGS.zip
directly from disk. First in BASIC, then in MC - @GUNHED   ;) ? The |ls,@string command is not so great for this, because of the 256 byte string limit. And if you cut the DecTalk phoneme string in bad places, it won't play. I was thinking of a |playsong,"filename.txt" command  ;)


Ideally, the speak text file function should work for this, but I think the TXT songs from that archive contain some problematic characters. For example, the "." seems to cause a hick up. So it is likely that some "on the fly" massaging of the file content has to happen. Maybe that was for a different version of DecTalk. However, most of these should work with little modifications.


@GUNHED , have you ever tried to put these into two TXT files and play them via speak file function? That should work with little to no modification, in case LS is in DecTalk mode of course (and probably blocking too):



Singing "Happy Birthday"


[:phone arpa speak on][:rate 200][:n0][hxae<300,10>piy<300,10> brrrx<600,12>th<100>dey<600,10>tuw<600,15> yu<1200,14>_<300> hxae<300,10>piy<300,10> brrrx<600,12>th<100>dey<600,10> tuw<600,17>yu<1200,15>_<300> hxae<300,10>piy<300,10> brrrx<600,22>th<100>dey<600,19> dih<600,15>r eh<600,14>m<100,12>ih<350,12>k_<120>_<300> hxae<300,20>piy<300,20> brrrx<600,19>th<100>dey<600,15> tuw<600,17> yu<1200,15>][:n0]


Singing "The Star-Spangled Banner" (The  text  exceeds  the  maximum  allowable  1023  characters  per  message,  so  it  must  be  split  into  two  messages)


[:phone arpa speak on][:rate 100][:n0][ow<200,18>ow<200,15> sey<400,11> kae<400,15>n yu<400,18>w siy<600,23> _<300> bay<350,27> dhah<50,25> dao<400,23>nz rr<400,15>ll iy<400,17> llay<600,18>t _<300> wah<200>t sow<200> praw<600,27>dlliy<200,25> wiy<400,23> hxey<400,22>eld _<300> ae<300,20>t dhah<100,22> tway<400,23> llay<400>ts llae<400,18>st glliy<400,15>m iy<200,11>nx _<300> hxuw<300,18>z brao<100,15>d stray<400,11>ps ae<400,15>nd bray<400,18>t stah<600,23>rz _<300> thruw<300,27> dhah<100,25> peh<400,23> rrel<400,15> ah<400,17>s fay<600,18>t _<300> ow<200,18>r dhah<200,18> rrae<600,27>mpah<200,25>rts wiy<400,23> waa<600,22>cht wrr<300,20> sow<100,22> gae<400,23>llah<400>ent lliy<400,18> striy<400,15>miy<200,11>nx _<300>][:n0][:phone arpa speak on][:rate 100][:n0][ae<300,27>nd dhah<100> raa<400> keh<400,28>ts r eh<400,30>d glley<700>r _<300> dhah<100,28> baa<400,27>mz brr<400,25>stih<400,27>nx ih<400,28>n ey<600>r _<300> gey<400>v pruw<600,27>f thruw<200,25> dhah<400,23> nay<900,22>t dhae<300,20>d aw<100,22>rr fllae<400,23>g wah<400,15> stih<400,17>ll dheh<600,18>r _<300> ow<400> sey<400,23> dah<400>z dhae<200,23>ae<200,22>t stah<400,20>r spae<400>ngel<400>d bae<400,25>nrr<200,28>rr<200,27> yxeh<200,25>eh<200,23>t wey<800,23>ey<150,25>ey<150,23>ey<1200,22>v _<900> fow<300,18>rdhah<300> llae<900,23>ae<400,25>nd ah<300,27>v dhah<300,28> friy<1000,30>iy<1000,35> _<900> ae<300,23>nd dhah<300,25> hxow<1000,27>m _<600> ah<300,28>v dhah<1000,25> brrey<1500,23>v _<900>][:n0]



Also notice, for the Star Sprangeled Banner, since the string is too long, it was cut into 2, and each segment needs to start with the preamble



[:n0][:phone arpa speak on][:rate 100][:n0][ ..... phonem content here .... ] [:n0]





XeNoMoRPH

Waiting for that "DecTalk Song Player"  :o
your amstrad news source in spanish language : https://auamstrad.es

LambdaMikel

#304
And, one more comment - looking through the LambdaSpeak 1.95 source code, the max LambdaSpeak buffer size is actually 382 characters. So, RETURN (13) must be send before the buffer is full; otherwise it will be sent to DecTalk, and if the string is malformed, i.e., does not have the proper format


[:n0][:phone arpa speak on][:rate 100][:n0][ ..... phonem content here .... ] [:n0]


then you won't hear anything.

Hence, it is best to create string of this form


[:n0][:phone arpa speak on][:rate 100][:n0][ ..... phonem content here .... ] [:n0] RETURN


(CR 13 at the end), such that this string is of length AT MOST 382 characters. Otherwise, buffer overflow happens, string sent to DecTalk is malformed, and you won't hear anything.


@GUNHED , that is actually something that would also happen for speak file function if you overflow the buffer; you want to make sure that words are not "cut in the middle" i.e. long words such as

   antidisestablishmentarianism 

should not be cut in the middle  ;)


Is speak file already making sure that this does not happen?



GUNHED

Guess you're right. The secret is to divide into the right strings. Anything else it (IIRC) done by the blocking-mode of the LS.  :)  Have to look at the downloaded files...
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

LambdaMikel

Quote from: GUNHED on 20:13, 27 February 19
Guess you're right. The secret is to divide into the right strings. Anything else it (IIRC) done by the blocking-mode of the LS.  :)  Have to look at the downloaded files...


Right, and blocking / non-blocking mode doesn't make a big difference anyway. Since there is only one thread in LS, if DecTalk / Epson IC is speaking, nothing else can be buffered by LS in parallel unfortunately (it would be nice if one could already send the next string portion while it is singing / speaking, but that is not possible).


The only thing that non-blocking mode allows you to do is - you can stop the speech at any time. But nothing else will have the desired effect until DecTalk finished speaking, because I don't have threads, as just mentioned.


So, blocking or not, blocking is nice because then your program is halted automatically until DecTalk has finished. But you can't stop / interrupt the speech. Otherwise, use non-blocking, then the Z80 is not halted, but you need to poll &FBEE if it is <> 32. Only when it get 32 again (= IDLE) DecTalk is ready to receive more content.

GUNHED

Sorry, for a stupid question. I should know by now...but... :P


Is there a way to "ask" the LS if the current sentence was sung completely? In this case the application can just use polling to wait until it will send the next sentence. Else the application can wait a number of interrupts until it will send the next string. Between two strings a number can be placed indicating how long (1/50 seconds) to wait.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

LambdaMikel

#308
Quote from: GUNHED on 20:24, 27 February 19
Sorry, for a stupid question. I should know by now...but... :P


Is there a way to "ask" the LS if the current sentence was sung completely? In this case the application can just use polling to wait until it will send the next sentence. Else the application can wait a number of interrupts until it will send the next string. Between two strings a number can be placed indicating how long (1/50 seconds) to wait.  :)


Right, like in demo01.bas 

When LS is ready to accept data in DecTalk mode (is idle again), in non-blocking mode, it puts 32 on the bus
(actually, it always does that in DecTalk or Epson mode, no matter if blocking or not, but of course you will only need it in non-blocking mode):


WAIT &FBEE,32




LambdaMikel

#309
The attached ZIP contains a first attempt at a BASIC program which can play DECTalk songs in ARPABET format from disk.
There are only 2 such songs currently, "BANNER.TXT" and "BDAY.TXT".

Unfortunately, with BASIC involved, there is a pause between segments when the program has to break up the strings. Maybe this program is an inspiration though for a fast MC program that doesn't have that problem  ;)

Also, the DECTalk songs from the archive

http://theflameofhope.co/dectalk%20speak%20window/
are for an older version of DECTalk, and will require conversion. And that is not so straightforward... first of, one needs to use the ARPABET poneme set. The allowed phonemes are documented

http://www.grandideastudio.com/wp-content/uploads/EpsonDECtalk501.pdf

from page 44 (48 in PDF viewer). I tried to convert "like a virgin", and it is on the DSK in the attached archieve, but there are still bad phonemes which I haven't translated right, so this gives "Command Error in Phoneme". Some more work required there.

I am wondering if there is an automatic translator that converts into ARPABET.

I also found the following "conversion hints" on a website somewhere:

QuoteNote that the Emic 2 uses DECtalk version 5.0.E1. The Flame of Hope web site has a heap of DECtalk songs but they are for earlier versions of the DECtalk parser and require tweaking to work with the EMIC 2. Thanks to Ron on the Parallax forum for these tips on converting the text files:

    you often have to change an "L" to "LL"
    sometimes you need a space between any character preceding the "ey" phonetic symbol.
That's only part of the story though.
Anyhow, 2 songs are working fine (BDAY and BANNER), and VIRGIN is work in progress. Enjoy.

PS @GUNHED  another thing I found is that apprently, eventhough LS has a buffer of 382 bytes, the Epson chip can probably only buffer 256 max. It seems that whenever I go above > 200 characters or so before sending CR, there are problems. Also, that's not caused by BASIC, because I am sending characters one by one.

XeNoMoRPH

My amstrad singing the American hinmo, what a laugh  :laugh: :laugh: :laugh: :laugh:
your amstrad news source in spanish language : https://auamstrad.es

LambdaMikel

Quote from: XeNoMoRPH on 20:11, 28 February 19
My amstrad singing the American hinmo, what a laugh  :laugh: :laugh: :laugh: :laugh:


Surely you don't object to a little bit of US propaganda from good old cowboy LambdaMikel, right?  :laugh: 
Next version will have picture of Donald Trump, watch out!  :laugh:

LambdaMikel

I have added one more demo, "test1.bas". Demonstrates EPSON mode (easier than DECTalk mode, and also supports pitch change, different voices, different speak rates). 

LambdaMikel

I had only tried this on LS3... timing on LS195 is a bit different.Hence, one more version  ;D

LambdaMikel

#314
Here is a video of the Spanish speaking mode and DecTalk singing (would be good if somebody tried Spanish singing on DecTalk  :D )


https://youtu.be/1TDAy5C5mJA

Since I don't speak Spanish I don't if this is accurate or not. What do you think?

PS Btw, I had a firmware bug in LS 195 which results in test2.bas (Spanish demo) not working on the devices out there. It had to do with non-ASCII characters required, such as ~ etc. There is a firmware update in the Github. People interested in updating the ATMega but can't do it on their own can send in their device if they care for Spanish. @XeNoMoRPH  if you care for the update I will send you an ATMega with the new firmware, since you just bought it 2 weeks ago.  Please let me know.

XeNoMoRPH

yeah , very nice work LambdaMikel !!! , yes .. please send me ATMega chip :)  :D
your amstrad news source in spanish language : https://auamstrad.es

LambdaMikel

Will do. Is the quality of the Spanish understandable?

XeNoMoRPH

your amstrad news source in spanish language : https://auamstrad.es

LambdaMikel

Three more shipping tomorrow - thanks guys!
Seems the now fully working Spanish speaking mode is a sales argument  ;)

GUNHED

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

LambdaMikel

Quote from: XeNoMoRPH on 18:58, 02 March 19
yeah , very nice work LambdaMikel !!! , yes .. please send me ATMega chip :) :D


It is in the mail since yesterday. Please let me know when it arrived.

LambdaMikel

PS If anybody else wants the LS 195 firmware update (-> Github) and cannot flash it her/himself, feel free to send in the chip to me. The update is mostly for Spanish mode. Just ignore if you don't care for Spanish. However, I'll have to charge 15 $ for returning the updated chip to Europe (USPS postage).

XeNoMoRPH

Quote from: LambdaMikel on 19:15, 05 March 19

It is in the mail since yesterday. Please let me know when it arrived.
Ok, big thx  :)
your amstrad news source in spanish language : https://auamstrad.es

GUNHED

Quote from: LambdaMikel on 19:22, 05 March 19
PS If anybody else wants the LS 195 firmware update (-> Github) and cannot flash it her/himself, feel free to send in the chip to me. The update is mostly for Spanish mode. Just ignore if you don't care for Spanish. However, I'll have to charge 15 $ for returning the updated chip to Europe (USPS postage).

A new firmware update for the 1.95? Can you please give a direct link, I don't find it in your git-hub (it's interface is not intuitive at all).

What's the changelog?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

LambdaMikel

https://github.com/lambdamikel/LambdaSpeak/tree/master/firmware/atmega644

Changelog:

       
  • internal version change from 8 to 12
  • support for LS 1.5, LS 1.8, LS 1.9, LS 2.0 and LS 2.1 dropped
  • support for LS 3.0 added
  • internal optimizations (removed an unnecessary char buffer for speech)
  • reset button works for PCM test
  • LS 3.0 added support for new EEPROM functions:
  •   - EEPROM clear all
  •   - EEPROM PCM Sample Play Test
  •   - EEPROM upload
  •   - EEPROM play (1, 2, and 3 channels)
  •   - EEPROM test
  • significantly reduced number of HAL9000 quotes 
  • PCM sample for LS 3.0 changed from other versions, because of PROGMEM shortage
  • fixes to Spanish speaking mode - language change command was ignored, missing Epson re-initialization (fixed)
  • fixes to EPSON parser for Spanish speaking mode: now supports accents and ~ etc.
    Since LS 3.0 only support 7 bit ASCII for content (everthing with 8th bit set is control byte!),
    ASCII characters > 127 have to be specified using \xHH (where H is Hex nibble). See test2.bas
    for some Spanish accents using this method.

Powered by SMFPacks Menu Editor Mod