Jump to content

Photo

Voice Playback


36 replies to this topic

#1 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,777 posts
  • HarmlessLion
  • Location:BUR

Posted Sat Aug 13, 2016 10:07 AM

Some time ago artrag mentioned a voice converter he had created that ran on the MSX and produced really nice voice at 60Hz. He was kind enough to adapt it for the PSG in the TI-99/4A and ColecoVision, and after lots of work-induced delays, I've put together a small package for those interested in using it.

 

With only three voices, the results are not quite as nice as the MSX, but most voice is still quite legible. I've posted a sample YouTube (it's just a quick and dirty test, but it demonstrates both good samples and not-so-good samples, so you can hear the range.) (Sample is running on a TI-99/4A, but the ColecoVision results are the same.)

 

 

Playback takes very little CPU (just unpacking 6 bytes per frame) and a fair amount of memory (360 bytes per second). It's quite good for adding short voice samples!

 

The actual converter runs under Matlab so requires the Matlab runtime and 64-bit Windows to execute. Alternately, the Matlab script is included so you can run it on your choice of platform if you have the ability to run Matlab scripts. I experimented with Octave and although it didn't run out-of-the-box, I eventually got an early version processing there.

 

For playback, I've included assembly playback code for both the TI-99/4A and the ColecoVision (the ColecoVision code is hand-optimized from SDCC output and runs fine linked into C programs). There's also a VGM converter with C source in case you have a need to VGM audio files (for instance, for my VGM compressor).

 

Anyway, hope you enjoy! Archive is posted on my site:

http://harmlesslion....ftware/artvoice

 

 



#2 newcoleco OFFLINE  

newcoleco

    Stargunner

  • 1,268 posts
  • Always Tired
  • Location:Quebec

Posted Sat Aug 13, 2016 1:59 PM

I used the exact method in wav2cv to create a voice saying "no no no" in Coleco Reversi; you can hear it when you try to play an invalid move.



#3 Tursi OFFLINE  

Tursi

    River Patroller

  • Topic Starter
  • 4,777 posts
  • HarmlessLion
  • Location:BUR

Posted Sun Aug 14, 2016 1:59 AM

I used the exact method in wav2cv to create a voice saying "no no no" in Coleco Reversi; you can hear it when you try to play an invalid move.

 

Oh, excellent! Did you use FFTs? Did you manage to take advantage of the noise channel? I went to your page to try and download, but the devkit is currently showing 404.



#4 newcoleco OFFLINE  

newcoleco

    Stargunner

  • 1,268 posts
  • Always Tired
  • Location:Quebec

Posted Sun Aug 14, 2016 12:14 PM

 

Oh, excellent! Did you use FFTs? Did you manage to take advantage of the noise channel? I went to your page to try and download, but the devkit is currently showing 404.

 

Noise channel excluded (because I couldn't figure it out back then how to make it works with noise), WAV2CV works with FFT to extract frequencies from an uncompressed wave file. Did all the coding in VisualBASIC 5 I believe and it was a great practice for my computer knowledge of that time. 

 

As you know, transforming a wave sample into 3 channels beeping sounds is not great but it does work good enough for some cases like sound effects, music, but barely with voices.

 

I am sure your tool reaches the next step and WAV2CV is probably available if you want to give it a try. Warning : it formats the conversion result into Marcel deKogel's sound data format which can be manually converted into other formats; more information in the documentations about ColecoVision programming I wrote a long time ago.

 

Sorry for the inconvenience of my website losing its zip files, it seems to be a glitch or a new policy of the web hosting I'm using; I should fix that.


Edited by newcoleco, Sun Aug 14, 2016 12:38 PM.


#5 Tursi OFFLINE  

Tursi

    River Patroller

  • Topic Starter
  • 4,777 posts
  • HarmlessLion
  • Location:BUR

Posted Sun Aug 14, 2016 12:56 PM

Well, Artrag did all the work of conversion, and a lot of the heavy lifting is buried deep in the "fxpefac" function of the voicebox library for MATLAB. (http://www.ee.ic.ac....ox/fxpefac.html) It seems to be a pretty clever function, though it's apparently tuned specifically for voice.

 

I worked on my own tool about six months ago, when I got voice by accident. But I didn't get it quite as solid as this tool. I did try to get noise detection going in mine as well, but it never worked for me. :)



#6 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Mon Aug 15, 2016 7:47 AM

The technique of extracting the highest tones from voice works fine and has solid basis in literature on voice coding.
Voice segments are classified as voiced and unvoiced.
Voiced segments are almost periodic and can be characterized by a main tone named pitch and it's multiples said formats.
Unvoiced segments are aperiodic and it's formats aren't at multiple frequencies.
Early codec where able to decide if classify a segment as voiced or unvoiced. The former was coded by the pitch and the amplitudes of the upper harmonics (formats), the latter coding all couples of frequency and amplitude.

#7 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Mon Aug 15, 2016 7:47 AM

fxpefac is able to estimate the pitch and returns the probability the segment is voiced or unvoiced.
Actually this latter information is not used as with only 3 channels all segments are coded in the same manner independently by relationship among formants.
The main problems the technique suffer on psg chips is that they produce square waves and not tones.
This generates unwanted harmonics that for voiced segments can add in destructive manner.
The SCC experience, where you can generate pure tones shows the improvement passing from square waves to tones. Also the 2 extra channels help, but the difference is in the square waves vs tones.

Edited by artrag, Mon Aug 15, 2016 7:56 AM.


#8 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Mon Aug 15, 2016 8:02 AM

This could help
https://www.google.i...avQJD_ZykP36Z1A

#9 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Mon Aug 15, 2016 8:07 AM

The other issue is that you cannot control the phase of the channels (neither on SCC).
This leads to some minor perceived distortion also when one moves to pure tones. Anyway there is no way to control this aspect, at least keeping the code light and on the isr.

#10 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Mon Aug 15, 2016 8:16 AM

Anyway another possible improvement in intelligibly would be to add noise in the coding of unvoiced segments.

fxpefac could tell IF, but the how is something different and in the end I resolved in coding also these segments as tones with unrelated frequencies

Edited by artrag, Tue Aug 16, 2016 6:34 AM.


#11 digress OFFLINE  

digress

    Dragonstomper

  • 900 posts
  • Location:Toronto, Ontario, Canada

Posted Mon Aug 15, 2016 9:20 AM

Here is an in game sample with some digital voice effects that I've put together using the voice playback.

 

 

 

 

Anyway, hope you enjoy! Archive is posted on my site:

 

 

 



#12 Tarzilla OFFLINE  

Tarzilla

    Stargunner

  • 1,841 posts
  • Location:Alberta, Canada

Posted Mon Aug 15, 2016 1:00 PM

Here is an in game sample with some digital voice effects that I've put together using the voice playback.

 

 

Cool. For some reason I was expecting "Achtung!" from Castle Wolfenstein 3D

https://youtu.be/lN9Sg3l59-I?t=34

 

Or some from the original Castle Wolfenstein:



#13 alekmaul OFFLINE  

alekmaul

    Chopper Commander

  • 174 posts
  • Location:Blois (France)

Posted Wed Aug 17, 2016 3:10 AM

is it possible to have a 32bits version of the SN76489.EXE file, I'm currently working with a 32bits version of Windows XP :(

And another question, it seems to be for 60Hz frequency, is it adapt for European PAL 50hz console ?


Edited by alekmaul, Wed Aug 17, 2016 3:22 AM.


#14 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Wed Aug 17, 2016 4:43 AM

I have to see if I can compile it in my Windows XP laptop but you have to wait for September.
About 50/60hz you would get a small slow down of the voice speed but it does not affect intelligibly or pitch.
In case I can do a version with a switch on command line.

Edited by artrag, Wed Aug 17, 2016 5:01 AM.


#15 alekmaul OFFLINE  

alekmaul

    Chopper Commander

  • 174 posts
  • Location:Blois (France)

Posted Wed Aug 17, 2016 5:25 AM

I have to see if I can compile it in my Windows XP laptop but you have to wait for September.
About 50/60hz you would get a small slow down of the voice speed but it does not affect intelligibly or pitch.
In case I can do a version with a switch on command line.

Well, regarding new version of SN exe, thanks a lot in advance, will wait September !

About 50/60Hz, I also did patch of my VBL function to avoid slow / fast speed regarding the 0x0069 memory entry. It was just a question about that.

I think that If I update the voice as I do for music, it will be ok.



#16 youki OFFLINE  

youki

    River Patroller

  • 2,255 posts

Posted Wed Aug 17, 2016 1:42 PM

I vote also for a windows XP version of SN exe .  I 'm under 32bit XP also!

 

Thanks! :)



#17 Tursi OFFLINE  

Tursi

    River Patroller

  • Topic Starter
  • 4,777 posts
  • HarmlessLion
  • Location:BUR

Posted Wed Aug 17, 2016 6:06 PM

Sadly I don't have a Matlab compiler, so we'll have to wait on that. I have started porting the code to C but it will take me a while to get time to finish that task.



#18 alekmaul OFFLINE  

alekmaul

    Chopper Commander

  • 174 posts
  • Location:Blois (France)

Posted Thu Aug 18, 2016 10:51 AM

Sadly I don't have a Matlab compiler, so we'll have to wait on that. I have started porting the code to C but it will take me a while to get time to finish that task.

No problem Tursi, can wait for that ;)

I think Bagman will have an updated version with your voice playback driver :P



#19 Tursi OFFLINE  

Tursi

    River Patroller

  • Topic Starter
  • 4,777 posts
  • HarmlessLion
  • Location:BUR

Posted Thu Aug 18, 2016 3:34 PM

Cool, and artrag may have the 32-bit MATLAB version ready before me in the interim :)



#20 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Fri Aug 19, 2016 2:29 AM

I could compile in XP already tomorrow night, I cannot promise but I will try

#21 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Fri Aug 19, 2016 3:12 AM

Trursi, consider the use of rld and rrd to extract nibbles from the rom data.
Being the data in rom the rotation itself has no effect if not loading the upper or lower 4 bits of (HL) in A.

Edited by artrag, Fri Aug 19, 2016 3:13 AM.


#22 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Sat Aug 20, 2016 4:50 PM

Here it is!

This is compiled with Widows XP

Attached Files



#23 Tursi OFFLINE  

Tursi

    River Patroller

  • Topic Starter
  • 4,777 posts
  • HarmlessLion
  • Location:BUR

Posted Sat Aug 20, 2016 7:52 PM

Thanks artrag! I've updated the zip on my page.



#24 artrag OFFLINE  

artrag

    Dragonstomper

  • 704 posts

Posted Sat Aug 20, 2016 8:33 PM

let me know if it works, I did not test it properly



#25 alekmaul OFFLINE  

alekmaul

    Chopper Commander

  • 174 posts
  • Location:Blois (France)

Posted Sat Aug 20, 2016 11:44 PM

It does not work for me. I can now run it with my windows XP but I have this message with the wav files I put in wavs directory :

Num. channels = 3

ans =

file#0  reward_base.wav


Undefined function 'fxpefac' for input arguments of type 'double'.

Error in sn76489 (line 49)



MATLAB:UndefinedFunction


And size is odd : 294K for 32 bits version and 5M for 64bits version :o !

Edited by alekmaul, Sat Aug 20, 2016 11:50 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users