NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode


Subject$4011 RAW vs. DMC new  
Posted byAnonymous
Posted on9/12/04 7:47 PM
From IP152.163.100.68  



Why does $4011 raw data come out at much better quality then the DMC. I realize that if you update it a lot at a constant rate you can get much better frequency than the DPCMs best 33Khz. But it's gotta be something different than that. I've seen an NES rom that compared $4011 vs. DMC and $4011 sounds much better than DMC and it's only playing at 8Khz. The DMC doesn't sound as "clear" as $4011 RAw does.

What's up with $4011 sounding so much better?
Does the DMC do anything to the data to alter the sound?
Do the DMC and RAW do the exact same thing with the data it receives?






SubjectRe: $4011 RAW vs. DMC new  
Posted byDisch
Posted on9/12/04 8:28 PM
From IP66.82.9.55  



> What's up with $4011 sounding so much better?

PCM streaming to $4011 allows for full control over every sample played by the DMC. Thus it's possible to have very high quality wav playback if it's updated quickly.

The DMC, however, works differently. Instead of each sample being fed to the output... it builds each sample from the previous sample. Sample N is always going to be 2 more or less than Sample N-1.

To put this in perspective... let's say that just for an example, you wanted the DMC to play a square wav using the above methods. With the $4011 mehtod... you could continually update the output with the exact output you want:

00 00 .... 00 00 7F 7F .... 7F 7F 00 00 .... etc

Thus you'd have a perfect square wave with no distortion.

With the DMC method... you don't have the luxury of specifying individual output values... so each output sample has to be built off the previous... which will give you something like this:

00 02 04 06 ... 7E 7C 7E 7C 7E 7C 7E 7C 7A 78 76 74 .... 04 02 00

for a sloppy visual diagram:

http://www.geocities.com/disch_/dmc.png

The DMC isn't capable of making large changes quickly. The output can only change by 2 in either direction... max. This is the cause for the slopes instead of the harsh edges in the second pic.

Also... the DMC isn't capable of "staying still". Each time it updates... it MUST change the output value (by either -2 or +2). This causes the ripples along the tops and bottoms of the wave as shown in that pic.


> Does the DMC do anything to the data to alter the sound?

Well the samples the DMC uses to output are built from data stored in the ROM. So the DMC doesn't really alter it... but the sound has to be altered to conform to the format the DMC requires.

> Do the DMC and RAW do the exact same thing with the data it receives?

Not at all. They both receive completely different types of input and both output in different ways.


For more info I would recommend Brad's excellent DMC doc. Even if you can't understand most of it... it should give you a better idea of how the DMC actually builds its output from the data stored in the ROM:

http://nesdev.parodius.com/dmc.txt




SubjectWhy DMC sucks new  
Posted bytepples
Posted on9/12/04 11:18 PM
From IP68.53.188.30  



"What's up with $4011 sounding so much better?"

Read this post to see why DMC sucks:
http://nesdev.parodius.com/cgi-bin/wwwthreads/showpost.pl?Board=music&Number=563&page=4&view=collapsed&sb=5

Nintendo really screwed up when designing NES DMC. I made the "hello" ROM to demonstrate that Nintendo should have used 4-bit linear PCM at 1/4 the rate rather than 1-bit delta modulation. The only good thing about DMC is that it can run at the same time as game logic without having to use insane Atari 2600 era timed code techniques.

____________________
My English is better than your Geberquen.


SubjectRe: Why DMC sucks new  
Posted byAnonymous
Posted on9/13/04 01:06 AM
From IP83.226.103.194  



Perhaps the idea was to save space, since Nintendo prolly never expected ROMs to grow as big as they did (a lot more than the 32k on an NROM board)




SubjectWasn't a space issue new  
Posted bytepples
Posted on9/13/04 03:06 AM
From IP68.53.188.30  



A DMC waveform at 1 bit per sample, 33500 samples per second (rate $F), takes exactly as much space as a literal PCM waveform at 4 bits per sample, 8375 samples per second (rate $F divided by 4). Nintendo must have had some other motivation for using delta modulation.

____________________
My English is better than your Geberquen.


SubjectRe: $4011 RAW vs. DMC new  
Posted byBregalad
Posted on9/13/04 4:20 PM
From IP81.62.106.212  



Is it possible to "overflow" the data by increasing sample position when it's at $7f to reach $00 ?

Bregalad, Ent from the woods of Fangorn


SubjectRe: $4011 RAW vs. DMC new  
Posted byquietust
Posted on9/13/04 5:10 PM



DMC will not wrap (i.e. go from 7F to 00 or vice-versa); instead, it will clip (7F to 7F, 00 to 00).

--
Quietust
P.S. If you don't get this note, let me know and I'll write you another.


SubjectRe: $4011 RAW vs. DMC new  
Posted byBregalad
Posted on9/13/04 6:23 PM
From IP83.77.233.209  



Ok, then you can do a wave that's standing at $00 or at $7f for a while by increasing data everytime (to do a square wave -> 0 +2->2 +2->4, ..., 7c +2-> 7e +2-> 7f +2->7f +2->7f....)

Bregalad, Ent from the woods of Fangorn


SubjectRe: $4011 RAW vs. DMC new  
Posted byblargg
Posted on9/13/04 6:47 PM
From IP199.170.90.131  



Correct, the comment above about a DMC sample not being able to have a flat part was incorrect in these two specific cases. A DMC sample is made of a continuous stairstep that is either going up or down at any given moment, or a flat region when at either extreme. This doesn't help much. The maximum delta bit rate is ~33kHz, and a transition from 0 to 127 takes 64 bits. A triangle wave generated in this fashion (0, 2, 4 ... 124, 126, 127, 125, 123 ... 3, 1, 0, 2, 4 ...) comes out to 257 Hz. A square wave with 256 bits per period (128 of which are the transition) would be only 128 Hz, and sound quite muffled.





SubjectRe: $4011 RAW vs. DMC new  
Posted byAnonymous
Posted on9/13/04 11:11 PM
From IP205.188.116.75  



OK, I almost completely get it now thx :-)

I've got 2 questions though.

1) What is the highest and lowest DMC value and/or RAW PCM value?
2) What is the starting position (0)?
3) So it'd be %11110000 %00001111 in DMC playback to make a triangle wave (with assumed starting value of 0).It goes up to 8 (in increments of 2) and then goes down to -8 and goes back up to -2. What would that be in RAW PCM playback. Can the $4011 have negative values so it can go under the baseline?

4) The format of the DMC byte is.....if bit = 1 go up from last position 2 (which is what you meant when you said the samples are combined), if bit = 0 go down 2 from last position. What is the format of the RAW PCM byte?

Here's my guess. The format of RAW PCM byte......Is a 7-bit value (the 7th bit is unused) which is fed directly to the DAC and is the exact position that the wave position will be at (does it stay there or go back down to 0 eventually?). I guess the LSB of it plays a part. But Brad's doc didn't say why it was special.




SubjectRe: $4011 RAW vs. DMC new  
Posted byDisch
Posted on9/13/04 11:35 PM
From IP66.82.9.44  




1) It's 7-bit, so $00 is lowest, $7F is highest.

2) I believe it starts at $00 at system startup, yes.

3) That would make a triangular shaped wave, yes. $4011 cannot go to negative values... it's minimum value is zero. If you want to think of it having a baseline, you can say $40 or $3F is the baseline, and you can set that as the starting point (by writing that value to $4011).


4) You nailed it. What you write to $4011 is exactly what's output. To my knowledge it stays there (until changed by the DMC or another $4011 write), but I'm not sure if it slowly drifts back to zero or scrambles over time due to insufficient voltage.

All 7 bits are used in outputting... although the DMC only affects the upper 6 bits (so the least significant bit can only be change via $4011)




SubjectRe: $4011 RAW vs. DMC  
Posted byAnonymous
Posted on9/13/04 11:55 PM
From IP205.188.116.75  



OK, thx! I comlpetely get it now :-) But is there anything special about $4011 being able to access the LSB of the DAC, while the DMC can't?




SubjectRe: $4011 RAW vs. DMC new  
Posted byDisch
Posted on9/14/04 02:00 AM
From IP66.82.9.44  



Not really. Just gives the raw PCM output a bit higher resolution than the DMC. Don't think there's anything really significant about it.




SubjectRe: $4011 RAW vs. DMC new  
Posted byblargg
Posted on9/14/04 03:55 AM
From IP199.170.90.167  



Among other things, the sound output is put through a high-pass filter. This eliminates any DC (unchanging) component in the signal, in addition to attenuating low frequencies around 30 Hz.

All channels output only positive signal levels. If a square wave is playing by alternating between 0 and 8, the high-pass filter will eventually settle to an offset of -4, resulting in the square wave effectively going from -4 to +4. The high-pass can be thought of as an extra offset which is added to the signal, which is continually adjusted to keep the signal centered around 0 (but takes a little time to adjust to a changing signal).

This applies to the DMC's DAC. Say it starts out at 0. If it's set to 127, there will be a large positive step, which will slowly move back to 0. Then if it's set to 0, there will be a large negative step, of the same amplitude as before. Buf it it's set to 127 and then quickly set back to 0, the signal will hardly go negative at all.

     l~-_
| | |~-_ .__ .__ .__
| | | | | ~| | ~| | ~|
_____| | | | | | | | | | ___________
|___| | | | | | | | ___---~~~
|__-` |__-` |__-` |__--~~

l~-_
| ~-__
| ~~--__
_____| ~~~---___ ___________
| ___---~~~
| __--~~
| _-~~
|_-~

l~-_
| |
| |
_____| | ______________
|___---~~~




Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo