snicklin Posted December 27, 2019 Share Posted December 27, 2019 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! 1 Quote Link to comment Share on other sites More sharing options...
Justin Payne Posted December 27, 2019 Share Posted December 27, 2019 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. Quote Link to comment Share on other sites More sharing options...
snicklin Posted December 27, 2019 Author Share Posted December 27, 2019 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! Quote Link to comment Share on other sites More sharing options...
Justin Payne Posted December 27, 2019 Share Posted December 27, 2019 (edited) 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 December 28, 2019 by Justin Payne Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 28, 2019 Share Posted December 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
Justin Payne Posted December 28, 2019 Share Posted December 28, 2019 (edited) Found this but it's in C. https://github.com/vidarh/SAM Also, a Javascript version. https://github.com/discordier/sam These might help if you're going to recreate something on your own. Edited December 28, 2019 by Justin Payne 2 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted December 28, 2019 Share Posted December 28, 2019 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. 2 Quote Link to comment Share on other sites More sharing options...
Justin Payne Posted December 28, 2019 Share Posted December 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
R0ger Posted December 28, 2019 Share Posted December 28, 2019 (edited) 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 December 28, 2019 by R0ger 5 Quote Link to comment Share on other sites More sharing options...
snicklin Posted December 28, 2019 Author Share Posted December 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted December 28, 2019 Share Posted December 28, 2019 I used SAM... it’s not that bad and you can have screen on but sacrifice some quality due to DMA... but thanks to Atari you can customize your display list to minimize. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 28, 2019 Share Posted December 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted December 28, 2019 Share Posted December 28, 2019 here I load sam and have the greetings spoken... 2 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted December 28, 2019 Share Posted December 28, 2019 1:40 sam on the lynx (patched for sound reg) and here you see the issue with the Rybags mentioned delay code... as it was tweaked for real Atari Lynx you see that emu is not accurate... 1 Quote Link to comment Share on other sites More sharing options...
R0ger Posted December 28, 2019 Share Posted December 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
pfeuh Posted January 12, 2020 Share Posted January 12, 2020 On 12/28/2019 at 1:16 AM, Justin Payne said: Found this but it's in C. https://github.com/vidarh/SAM I haven't found any working C compiler for a800 except the one from Ulrich Von Bassowitch... Is there another? Quote Link to comment Share on other sites More sharing options...
ilmenit Posted January 12, 2020 Share Posted January 12, 2020 6 hours ago, pfeuh said: I haven't found any working C compiler for a800 except the one from Ulrich Von Bassowitch... Is there another? CC65 is the best one and it's still maintained, now on Github 1 Quote Link to comment Share on other sites More sharing options...
pfeuh Posted February 3, 2020 Share Posted February 3, 2020 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. Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 3, 2020 Share Posted February 3, 2020 FWIW, ivop was porting bits of gcc to 6502 but it might still be very much in a WIP state. Ilmenit also pointed to KickC which so far is targeted for C64 and doesn't provide a full C implementation, to which extent you really need one in order to compile a software speech synthesis. Quote Link to comment Share on other sites More sharing options...
ivop Posted February 3, 2020 Share Posted February 3, 2020 (edited) 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 February 3, 2020 by ivop 1 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted February 3, 2020 Share Posted February 3, 2020 (edited) 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 February 3, 2020 by ilmenit 1 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted February 3, 2020 Share Posted February 3, 2020 (edited) 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 February 3, 2020 by ilmenit Quote Link to comment Share on other sites More sharing options...
ivop Posted February 3, 2020 Share Posted February 3, 2020 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. 2 Quote Link to comment Share on other sites More sharing options...
R0ger Posted February 3, 2020 Share Posted February 3, 2020 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. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted February 3, 2020 Share Posted February 3, 2020 Ability to easy modify and maintain is often strong point. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.