Re: [stella] Berzerk Voice

Subject: Re: [stella] Berzerk Voice
From: Mike Mika <mikem@xxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Aug 2002 09:37:33 -0700

Sorry I'm so late to this, guys!

Eckhard answered it for me, pretty much. I do vary how often it updates the voice in some cases.

"Intruder Alert! Intruder Alert!" I stored the one half of the phrase, and played it back every 4 scan lines like Eckhard's demo, twice.
"Chicken Fight Like A Robot" I sampled this at a bit less than 4000hz, and update about every 4.5 lines (I believe)
"Humanoid must not escape" Same thing here, in an effort to make the samples fit, I downsampled below 4000hz until it could be stored in a bank + code, then adjusted the playback rate.

I also had another phrase in there, but it had to be so downsampled it was too unrecognizable.
The key is splitting the sample into 4bit, so you can save space. Also, the roboticized voices were already downsampled for the arcade game pretty well, and I found the word fragments from Berzerk on some random site when I did a Google search for "Berzerk .WAV". I used some tools I had from GBC sample building to downsample, and then wrote a quick (Redundant to Eckhard's tool!) 4bit converter- In this case, it does exactly what Eckhard's does, so use his- I wasted some time before realizing Eckhard already did the work!

As for the code, there is not much else you need to do other than what Eckhard outlined in his SAY.A65 code. That's the way we did it on GBC, as well, but on an interrupt during Hblank (GBC) so as to keep graphics on screen, etc.

You can get some pretty surprising results, actually. Drum beats, voice, etc, can sound pretty good. I found that the quality can be sustained, but you sacrifice space.

Again, study Eckhard's demo. It was the catalyst to the whole idea of adding voice to Berzerk.


At 03:59 PM 8/15/02 +0200, you wrote:
> Unfortunately, very little in the way of details there. I want sample
> bit depths, etc, darnit! :)  Any chance of getting the author to post here
> explaining how he did it?

Since Mike said he was inspired by the sampled voice demo that I posted
to the Stella list in early 1997, I guess it's OK, if try to answer this
question. ;-)

It's 4 bit at about 4000 Hz. Basically you set the audio control register
to constantly outputing a high signal, and then quickly change the 4 bit
volume register. In this example the volume gets changed every 4 scanlines,
which results in a sample frequency of about 4000 Hz. For the robotized
voices in Berzerk this seems to work quite well. Since changing the sound
data so often doesn't leave you too much processing time to generate the
game display, Mike blanks out the screen while he plays the sampled voices.

Where Mike got the samples from I don't know. But I suppose he just
downsampled the audio files for the MAME Berzerk emulation or something.

> I'd really like to know what this would sound like, or if it's already
> done. The hardest part of testing this technique would be generating the
> data. Parsing a WAV is easy, but determing the average frequency of each
> chunk would require a Fourier transform or similarly hairy algorithm.

That's an interesting idea, but at 60 changes per second, I fear it
would sound more like the "talking" of the guy in Little Computer people
than any recognizable words.

Ciao, Eckhard Stolberg

---------------------------------------------------------------------------------------------- Archives (includes files) at Unsub & more at

---------------------------------------------------------------------------------------------- Archives (includes files) at Unsub & more at

Current Thread