Jump to content
IGNORED

Software Based Speech


snicklin

Recommended Posts

I'm pondering on whether I could add speech to the game I am writing. I could dedicate some banks on an Atarimax cartridge to it.

 

Does anyone know if there are any software based routines (which are free to use for all / non copyrighted) which I could use?

 

If it could also play the speech while the screen is on, that would be extremely beneficial.

 

If there isn't anything available like this, I just won't use it. I'm not capable of programming such a system!

  • Like 1
Link to comment
Share on other sites

So, there are plenty of games with speech and they didn't have to turn off the screen, unlike SAM. To me, using a external device would be optimum. I mean, we have devices that could output MIDI so we could haves some high quality music and have the game just output the bleeps and bloops...but that's not what you're asking for. I found this conversation 

 

I didn't read it all but it looks like this might be a good place to start.

 

Hope it helps and good luck.

Link to comment
Share on other sites

9 minutes ago, Justin Payne said:

So, there are plenty of games with speech and they didn't have to turn off the screen, unlike SAM. To me, using a external device would be optimum. I mean, we have devices that could output MIDI so we could haves some high quality music and have the game just output the bleeps and bloops...but that's not what you're asking for. I found this conversation 

 

I didn't read it all but it looks like this might be a good place to start.

 

Hope it helps and good luck.

Hi @Justin Payne,

 

Yeah, I'm looking for something software based, so that everybody who has a copy of the game when complete will be able to get the same program. I don't have any external devices either.

 

I'd rather not go down the line of digitised speech (preferring something algorithmically created) as I will have a lot of things that need to be said:

128 team names

100 city names

The numbers 0 to 9, each spoke in any one of 3 intonations.

256 first names

256 surnames

A few connecting words also.

 

I reckon that'll use way more than the 1MB I have on cartridge.

 

Thanks for your reply however!

Link to comment
Share on other sites

That is where I think you'll find the 6502, and POKEY, limited. You're asking it to do a lot more than it's capable of doing. While digitized voice seems to be possible, dynamic seems to take more processing power. That's why I always thought it would be a good idea to have an external device that could store words that could be said in the prefered order.
The only way I could see this working, without external hardware, would be to take text in, convert it to speech, and then store it to memory. Speech takes up a lot of memory, a lot more than a stock Atari has. So, you either ask people to add more ram OR an external device. I think an external device might be a better option. Again, not what you asked but I'm just giving you options since I think what you are asking is pretty significant to this hardware.

I really hope that you prove me wrong because I think your idea would be pretty sweet.

Edited by Justin Payne
Link to comment
Share on other sites

I suspect that SAM is all we have that could meet your requirements.

It has a couple of problems that I'd have like to have tackled but likely it'd be a fairly major project:

- only sits in low RAM.  A partial reverse-engineering to allow it to live under the OS or in 130XE extended memory would be good.

- it uses delay loops between samples.  That's a big part of the reason that many digi playback routines sound bad when the screen's active.  The much better way is to use Pokey Timers either directly or polled delay, the jitter reduces a lot there.

 

State of the art for plain samples is probably still the system used in Ghostbusters and C64 Impossible Mission.  Last time I looked there's practically no information about implementing the compression, likely because it's still a very commercially viable system.

But regardless, the requirements you have mean you'd have to use a software voice system, unless you made your program for IDE class devices only with a multi-megabyte image.

Link to comment
Share on other sites

There is also the AtariVox device, if a hardware solution is desired.  There's a PC based text to speech generator.  All the words you would need would be a few hundred bytes of phonemes, and you can stream to the device over SIO or joystick port even at 600 baud for instance.

  • Like 2
Link to comment
Share on other sites

1 minute ago, Stephen said:

There is also the AtariVox device, if a hardware solution is desired.  There's a PC based text to speech generator.  All the words you would need would be a few hundred bytes of phonemes, and you can stream to the device over SIO or joystick port even at 600 baud for instance.

I'd like to see an updated version of the AtariVox. I bet an Arduino would be able to store and process more than enough.

Link to comment
Share on other sites

I'm actually working on brand new speech synth. It uses slightly different approach than Sam, and it can run with screen on - that's one of the reasons I'm doing it.

It's quite in the beginning though. And it's not aimed primarily at English, even though some kind of English would be possible for sure.

I have some first Atari code working, and while it's really hard to understand so far, I think it looks promising. I plan to release something with it in March. By then I should know lot more, and I will not demonstrate anything before that.

Edited by R0ger
  • Like 5
Link to comment
Share on other sites

Thanks all for your suggestions.

 

Essentially if it means me having to program anything, I won't be doing that. The reason is that my main project is a game and I don't want to take on a project bigger than my own project to get my game done, I'd rather leave out that functionality. If there was something that I could drop into place and use, that'd be fine, but that isn't the case it seems.

 

As for @R0ger, I take it that you are programming this for the Czech language? I did some research and found that English has way more phonemes than Czech, so I don't think your code (unless extended to cover English) would work in this case.

 

Any solution that I have, I'd want to run it almost completely from cartridge as RAM is limited.

Link to comment
Share on other sites

I've not looked at the SAM code at all.  From memory there was a delay constant you just poked in and I think maybe a voice pitch value?

If it's that simple then chances are it just uses a simple JSR to it's delay routine which would be easily modified.

 

For the purpose stated here I don't think anything else "software only" in current existence on the Atari would work better than SAM.

Link to comment
Share on other sites

4 hours ago, snicklin said:

As for @R0ger, I take it that you are programming this for the Czech language? I did some research and found that English has way more phonemes than Czech, so I don't think your code (unless extended to cover English) would work in this case.

There are some phonemes which are not in Czech. I wouldn't say 'way more'. But the system I should be flexible enough to add them. And I plan to support English, it's just not very high on the list.

Automatic intonation and accents are much more complex issues, compared to phonemes, but it's no problem with your kind of use, as you can define that manually, to your liking.

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
On 1/12/2020 at 9:12 PM, ilmenit said:

CC65 is the best one and it's still maintained, now on Github

Yes, this one is Ulrich Von Bassovitch's one, but it is very slow in my opinion. Perhaps because there are not enough  registers in 6502. I think Atari Basic has the same speed but with more compact code.

Link to comment
Share on other sites

Consider that the C code was largely generated from the original S.A.M. 6502 code and manually improved a bit., sort of like a human peephole optimizer. Even if you get the C code to compile with CC65, the end result will run sloooow and might not even fit in 64kB. gcc-6502 (to which I only added Atari support BTW) generates somewhat faster code, but not necessarily smaller, mostly bigger. It probably unrolls more loops and inlines beter. I think you're better of using the way smaller 6502 code directly, like Heaven did.

 

Edited by ivop
  • Like 1
Link to comment
Share on other sites

3 hours ago, ivop said:

Consider that the C code was largely generated from the original S.A.M. 6502 code and manually improved a bit., sort of like a human peephole optimizer. Even if you get the C code to compile with CC65, the end result will run sloooow and might not even fit in 64kB. gcc-6502 (to which I only added Atari support BTW) generates somewhat faster code, but not necessarily smaller, mostly bigger. It probably unrolls more loops and inlines beter. I think you're better of using the way smaller 6502 code directly, like Heaven did.

 

Guys, did you even try to use cc65? ? It's super fast in case of many constructs often not that much slower than asm. It's probably the fastest mature compiler we have for Atari now. It's faster than Action! 15% faster than optimized MadPascal.

Edited by ilmenit
  • Like 1
Link to comment
Share on other sites

5 hours ago, pfeuh said:

Yes, this one is Ulrich Von Bassovitch's one, but it is very slow in my opinion. Perhaps because there are not enough  registers in 6502. I think Atari Basic has the same speed but with more compact code.

You don't need many registers. Just use variables or even put them on zero page $80+. Basic is uncomparable slower (50-100 times).

Edited by ilmenit
Link to comment
Share on other sites

21 minutes ago, ilmenit said:

Guys, did you even try to use cc65? ? It's super fast in case of many constructs often not that much slower than asm. It's probably the fastest mature compiler we have for Atari now. It's faster than Action! 15% faster than optimized MadPascal.

I have used cc65 in the past and don't argue against its code quality. Of all 6502 C compilers, it's the best.

 

My point was, why would you use 6502 assembly, machine converted to C, after that a bit hand optimized, and then compile it back to 6502 assembly again with a C compiler?

 

Just use the original 6502 assembly code, like @Heaven/TQA did.

 

 

  • Like 2
Link to comment
Share on other sites

Speech synthesis is very demanding, and has to be basically cycle perfect. No idea what synchronization method SAM uses on Atari, but I've read it uses simple wait loops on some platforms. In such case, transcompiled code will never work. Also why would you do it ? You already have binary working on Atari.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...