Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > DPCM Importing Owner: Karthon New post
Page 1 of 1 Sort:  
DPCM Importing Posted: 2012-11-03 23:03  (Last Edited: 2012-11-17 01:04) Reply | Quote
Karthon

Avatar

Member for: 3537 days
Location: Bikini Bottom
Status: Offline

#41706
Not a problem, but I'm really wondering why sample sounds are loaded when I load a random file, not .dcm or.wav.

_______________________
"Don't feed the trolls" (That's when the guy feeds them)
Posted: 2012-11-05 17:59  (Last Edited: 2012-11-05 18:33) Reply | Quote
za909

Avatar

Member for: 3962 days
Location: Hungary
Status: Offline

#41771
That's because there's no real "format" for the DPCM channel, it just reads the bytes of anything, and examines the bits (8 bits = 1 byte) one by one, that's why the NES does 1-bit DPCM (Today, we have 16-bit wav for example, which means that two bytes are processed at a time). Look up pictures of hex editors, that's what EVERYTHING is in real, just a bunch of numbers.

_______________________
Rectangular sh*t ©
Posted: 2012-11-07 21:00 Reply | Quote
Thom

Avatar

Member for: 4529 days
Status: Offline

#41815
[quote=za909]That's because there's no real "format" for the DPCM channel, it just reads the bytes of anything, and examines the bits (8 bits = 1 byte) one by one, that's why the NES does 1-bit DPCM (Today, we have 16-bit wav for example, which means that two bytes are processed at a time). Look up pictures of hex editors, that's what EVERYTHING is in real, just a bunch of numbers. [/quote]

Then how do you caulate 8-bit samples? 1.5 bytes?

Posted: 2012-11-07 22:53  (Last Edited: 2012-11-07 22:54) Reply | Quote
Dwedit

Avatar

Member for: 4972 days
Location: Chicago
Status: Offline

#41818
To go from DMC to WAV, you make the wave go up when there's a 1, and make the wave go down when there's a 0. When you reach the maximum value (127), you stop going up. When you reach the minimum value (0), you stop going down. That's what DMC is. 8 times as many samples as there are bytes.

Posted: 2012-11-07 23:59 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#41819
The NES DPCM data is still a format. It's not "just hex", those bytes and bits mean something.

It actually increases the counter by 2 on a 1 bit and down by 2 on a 0 bit.

If the counter is 126 or 127 it will not increase, if it is 1 or 0 it will not decrease. (Note: the DPCM sample can never change the least significant bit of the DMC counter.)

The bits are read LSB first, so hex $79 = binary $01111001 gets read as: 1, 0, 0, 1, 1, 1, 1, 0. Since most humans work with numbers in big-endian format, it will look backwards to you.

e.g. $79 $11 would read as...

1001111010001000

Even though normally in big-endian binary you would write it out:

%01111001 %00010001

The actual length of a DPCM sample must a multiple of 16 bytes + 1 extra byte. e.g. valid sample lengths are 1 byte, 17 bytes, 33 bytes, etc...

Posted: 2012-11-08 11:16 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#41823
DPCM has no dedicated file format so that's why any file can be interpreted as DPCM data, there is no header or anything telling if the file is valid or not.

_______________________
Programmer and developer
Page 1 of 1 Sort: