Voice Outtakes

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Voice Outtakes
by on (#37219)
Hey all, I've been putting together a small game for the Garage Cart 2 release, and I had my son do some voices for the DMC channel. Sorry Bregalad, I know how much you hate that channel! ; ) hehe

I like to try and include him in as many things as possible, so I figured why not put his voice on the NES? Anyway, the point of this post is just for giggles. I made about a minute long mp3 of some outtakes. You can even hear me say "no" at one point where he started to get carried away haha

http://robertlbryant.com/gaming/mp3/Pegs%20Outtakes.mp3

I just thought some of you might find this a bit funny : )

by on (#37220)
I don't see what this does for the NES but you should be using $4011 if you want to do voices so that the quality is high enough (I don't hate the DMC channel if used with $4011 or if used as a slient IRQ source, what annoys me is the terrible hissing noise of DPCM), but you're free to do whathever you want with your games, just as I'm free to do whathever I want with my games.

Also non native people who lernt english have very low chances to make sense of it.

by on (#37224)
Bregalad wrote:
I don't see what this does for the NES but you should be using $4011 if you want to do voices so that the quality is high enough

I agree, if your game doesn't need speech and action at once. Wisdom Tree's Joshua is like this; so is Hi-Tech's Big Bird's Hide and Speak. But it wouldn't work for something like Irem's Kung Fu or Sony's Parappa the Rapper.

by on (#37225)
Bregalad wrote:
Also non native people who lernt english have very low chances to make sense of it.

Let's try... "Go!", "Choose an empty slot!" and "Good job!"? I'm not sure about "slot", but I think I got the rest right, no? I must admit it is sometimes hard for non-native speakers to understand recordings that were mostly spontaneous (not like in series or movies where everything is fake).

by on (#37226)
You got it Tokumaru : )

I actually had to have it change to "Choose a slot," because the file size was annoyingly big otherwise hehe Still though, that one ended up being the hardest to understand. To atone for that though, I've made sure that the words he's saying are printed on screen when it happens.

Now let's hope a language barrier doesn't make a Japanese person think that the countdown in the game isn't supposed to be counting from 3-2-1... 5!!

by on (#37227)
So Roth, are you gonna write the samples directly or will you use the 1 bit deltas? I think his voice sounded good for a video game, so I hope the encoding won't destroy it! =)

by on (#37228)
Honnesly, I can't undersand one word of it.
All I hear is "Haa ya !" and something like that. I didn't even notice it was supposed to mean something. Sorry, but you probably shouldn't exept any player to understand the voices if they aren't doubled by text. But feel free to do wathever you want.

by on (#37229)
Hahaha Guess you were right, Roth! He hates it! :D

Seriously though, yeah, I agree that text is a must. I was never able to understand anything that came out of the NES if there wasn't any text. Then again, I didn't know much english back then.

by on (#37231)
tokumaru wrote:
So Roth, are you gonna write the samples directly or will you use the 1 bit deltas? I think his voice sounded good for a video game, so I hope the encoding won't destroy it! =)


I've made them into .dmc files. I'm not quite sure what writing samples directly means, though : P

Yeah, the text is all present for each one. The really only bad one that came out was Choose a slot. Go and Good job came out very, very nice : )

Wait a second... Bregalad, you can't understand one word of the mp3?

by on (#37233)
Roth wrote:
I'm not quite sure what writing samples directly means, though : P

I've NEVER done any sound programming on the NES (sadly), but as far as I know, there are 2 forms of playing samples:

1. The NES automatically reads 1-bit deltas from the ROM and adjusts the waveform according to the value of each bit;

2. You write the samples (I think they are 7-bit values) directly;

Obviously, the 2nd method will produce better results, because you can handle all sorts of transitions, while the 1-bit deltas will fail to represent sudden transitions, causing sound distortions. However, the disadvantage of writing samples directly, besides the larger space they occupy (although you could come up with a compression algorithm, like tepples did), is the fact that your program has to continuously write the samples, leaving no time to do anything else. This is what tepples meant when he talked about "speech and action at the same time".

by on (#37234)
Quote:
Wait a second... Bregalad, you can't understand one word of the mp3?

No I can't, but I'm really not used to listen to people talking english, especially little kids.

And you should go for way 2 for making samples (no need to make .dmc, I've made a NES programm that uses SRAM to converts PCM to tepples' great ADPCM-like compression format I could send it to you if you want).

by on (#37235)
That's alright, I totally understand : )

As for this program, it's already finished. I just have to do some commenting in the source before I officially release it and such. So, I won't be able to put that converter that you're talking about to use right now, but I would still be interested in checking it out! My email address should be under my post here. Thanks!

by on (#37237)
Well, the encoder is only used to make a .sav file that contains data to be used by the player. The only reason I made it a NES programm is that I didn't have enough skill in java back then, now I'd make a java programm instead since I've taken course for it last year and it's great.

The player that you'll need in your code is like that.
Code:
   ldy #$00
--   ldx #$27   ;This values changes playback rate
-   dex
   bne -
   lda [DMCPointerL],Y
   lsr A
   lsr A
   lsr A
   lsr A      ;High nybble
   tax
   lda DPCMTable.w,X
   clc
   adc Last_DMCByte
   sta Last_DMCByte
   sta $4011
   ldx #$28
-   dex
   bne -
   lda [DMCPointerL],Y
   and #$0f        ;Low nybble
   tax
   lda DPCMTable.w,X
   clc
   adc Last_DMCByte
   sta Last_DMCByte
   sta $4011
   iny
   bne --
   inc DMCPointerH
   lda DMCPointerH
   cmp #$c0         ;Stupid way to check the end of the sample
   bcc --
-   jmp -

DPCMTable          ;Square table
   .db 0, 1, 4, 9, 16, 25, 36, 49, -64, -49, -36, -25, -16, -9, -4, -1


The encoder should look liks that (sorry I'm just pasting it):
Code:
   ldy #$00
-   lda [DMCPointerL],Y
   jsr PCMtoDPCM
   asl A
   asl A
   asl A
   asl A
   sta Temp
   inc DMCPointerL

   lda [DMCPointerL],Y
   jsr PCMtoDPCM
   ora Temp
   sta [DMCPointer2L],Y

   inc DMCPointer2L
   bne +
   inc DMCPointer2H
+   inc DMCPointerL
   bne -
   inc DMCPointerH
   lda DMCPointerH
   bpl -
   lda #$5a
   sta [DMCPointer2L],Y
   iny
   lda Last_DMCByte
   sta [DMCPointer2L],Y
   iny
   lda #$ff
   sta [DMCPointer2L],Y
-   jmp -

PCMtoDPCM         ;Actual conversion routine
   lsr A         ;7-bit unsigned format
   ldx #$00
   sec
   sbc Last_DMCByte   ;Differentiate with last sample
-   cmp DPCMTable2.w,X
   bcc ++
   inx
   cpx #$0f
   bne -

++   lda Last_DMCByte
   clc
   adc DPCMTable.w,X
   sta Last_DMCByte
   txa
   rts

DPCMTable
   .db 0, 1, 4, 9, 16, 25, 36, 49, -64, -49, -36, -25, -16, -9, -4, -1

DPCMTable2
   .db 1, 2, 6, 12, 20, 30, 42, 72, -57, -43, -31, -21, -13, -7, -3, -1


Basically it computes the delta between each sample, and the square root of the (un-signed) delta is being encoded (with the original sign). For example if the delta is -5, you'll encode -2 because the square root of 5 is slightly above 2, and it's rounded down to 2, and the original sign is preserved. Each sample is coded on 4-bit.

When playing, you just use a signed square table to play back the samples. For some reason that square/root technique sound a whole lot better than the linear version of the same 4-bit dela encoding (I've tried it), and tepples found that.