It is currently Thu Nov 23, 2017 12:24 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Sun Nov 18, 2007 1:41 pm 
Offline

Joined: Thu Jun 29, 2006 7:44 pm
Posts: 524
Location: lolz!
If your asking me to do that, I can't even subtract or add numbers yet.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 3:18 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
I haven't yet made an NES-side decoder, but I've simulated the compression and decompression process in C. Have a listen:

Audio file
"What should a Nintendo sound like?"
1. original wave; 2. through my 4-bit codec; 3. through dpcm at 4x oversampling (close to rate $F)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 3:51 pm 
Offline

Joined: Thu Jun 29, 2006 7:44 pm
Posts: 524
Location: lolz!
probably 2. Was that you saying that?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 4:31 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
NotTheCommonDose wrote:
Was that you saying that?

Yes.

Does this rom work at all on NES hardware?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 4:38 pm 
Offline

Joined: Thu May 03, 2007 3:07 pm
Posts: 155
tepples wrote:
Yes.

Does this rom work at all on NES hardware?

I dunno about actual NES hardware (I cannot test it myself yet), but it does work on the latest versions of Nestopia and Nintendulator. Is that enough accuracy, or do you really need the NES itself? By the way, your demo's pretty cool - it has a pretty good sound quality.


Last edited by strangenesfreak on Sun Nov 18, 2007 4:41 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 4:41 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
strangenesfreak wrote:
I dunno about actual NES hardware (I cannot test it myself yet), but it does work on the latest versions of Nestopia and Nintendulator. Is that enough accuracy, or do you really need the NES itself?

I too tried it on Nestopia and Nintendulator. But I seem to remember a long time ago when someone said that if nobody runs it on an NES, I might as well develop for DirectX instead.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 5:57 pm 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
Works fine* on my PAL NES using a PowerPak.

* Different pitch or what it is called = sounds like Nintendulator in PAL mode :)

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 7:47 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
Thanks. That's good enough for now. But what else can I do with this engine?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 18, 2007 12:42 pm 
Online
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
Hey ! I'm now playing with the PCM channel (manual $4011 mode) and I don't feel like starting a new thread for this.
Since using plain 8-bit PCM samples is pure waste (especially since the LSB is ignored) and because the ROM capacity of the NES is small, I did it in 4 bit DPCM (the wav can decrease by down to 8 or increase up to 7 each step). However, I got terrible results. A lot of time this slew rate is just too much for the sampling rate I use, and this sound terrible, almost as bad as 1-bit hardware DPCM.
I'd like to implement some kind of other compression such as Adaptative DPCM or something like this. I don't know much about ADPCM, but would 2 bits for the number of shits and 6 bits for 2 samples (3 bit per samples) all packed in a byte do the trick ? Would I end up with better quality than before ? I'm not sure how to encode for this format efficiently either.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 18, 2007 8:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
Bregalad wrote:
Since using plain 8-bit PCM samples is pure waste (especially since the LSB is ignored) and because the ROM capacity of the NES is small, I did it in 4 bit DPCM (the wav can decrease by down to 8 or increase up to 7 each step). However, I got terrible results. A lot of time this slew rate is just too much for the sampling rate I use, and this sound terrible, almost as bad as 1-bit hardware DPCM.

To avoid slope overload on "loud" portions, use bigger steps in loud portions. You can do this either by varying the step scale (like IMA ADPCM and SNES ADPCM do) or just by using nonlinear stepsizes:
{-64, -49, -36, -25, -16, -9, -4, -1, 0, 1, 4, 9, 16, 25, 36, 49}

Quote:
I'd like to implement some kind of other compression such as Adaptative DPCM or something like this. I don't know much about ADPCM, but would 2 bits for the number of shits and 6 bits for 2 samples (3 bit per samples) all packed in a byte do the trick ?

You might want to spread the number of shifts over a longer block of samples. SNES ADPCM encodes each block of 16 samples in 9 bytes: 4 bits for step scale (your "number of shits"), 2 bits for prediction method (in effect, a choice between literal and delta interpretation of the sample values), 2 bits for other shit related to looping, followed by 4*16 bits for sample values. IMA ADPCM (used on Nintendo DS and several other systems) uses a running count based on the delta values to predict the step scale.

But my question remains: What kind of game design would use a lot of audio that pauses the game?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 9:43 am 
Online
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
I'll try to get the parabolic step size thing in, I'll tell if it gives better results. That does seem like a good idea, however I don't know if it will sound a lot better or just slightly better.

Quote:

You might want to spread the number of shifts over a longer block of samples. SNES ADPCM encodes each block of 16 samples in 9 bytes: 4 bits for step scale (your "number of shits"), 2 bits for prediction method (in effect, a choice between literal and delta interpretation of the sample values), 2 bits for other shit related to looping, followed by 4*16 bits for sample values.

Yeah, I know how SNES ADPCM works, it's fairly good however not all bits are used and there is those different filters that require advanced maths that definitely cannot be done on the NES (in real time). Buffering the samples is out of question due to low RAM (even with SRAM). And I'd like to avoid to have a whole byte as a "header" of a block, as it's hard to make full good use to the whole 8 bits of the header.

Quote:
IMA ADPCM (used on Nintendo DS and several other systems) uses a running count based on the delta values to predict the step scale.

Sounds very interesting. Could the NES perform a such process in real-time ? If so where can I have more details about that thing ?

Quote:
But my question remains: What kind of game design would use a lot of audio that pauses the game?

RPG, tactical-RPG or anything that doesn't require the player to interact with the game in real time.

EDIT : Parabolic DPCM seems to do much better results ! Thank you tepples ! While not sounding absolutely perfect, my stuff now sounds decent. I wonder if there is any way of making sounding even better, but I doubt.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 25, 2007 8:07 am 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
Tepples:
Nice work. How about trying a 2-bit ADPCM codec as well? Even if most 2-bit codecs I've heard have a noticable degrade in sound quality, it might still be acceptable if you need lots of speech samples. =)

Then again, for speech-specific compression, there are better codecs to use. But most of them are very CPU-demanding IIRC.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 28, 2007 1:58 am 
Offline

Joined: Thu Oct 05, 2006 6:29 am
Posts: 911
Quote:
Then again, for speech-specific compression, there are better codecs to use. But most of them are very CPU-demanding IIRC.


Yeah, try to do an AMR decoder. It might be doable if the NES' CPU was running at, say, 30-40 MHz..

Quote:
Sounds very interesting. Could the NES perform a such process in real-time ? If so where can I have more details about that thing ?


http://nocash.emubase.de/gbatek.htm#dssound
http://wiki.multimedia.cx/index.php?title=IMA_ADPCM


Top
 Profile  
 
 Post subject: Practical application.
PostPosted: Thu Jan 03, 2008 2:10 pm 
Offline
User avatar

Joined: Thu Jan 03, 2008 1:48 pm
Posts: 543
As I am an infamously useless troll of sorts, I will just make a request for the betterment of the sk3n3 and get the codemonkeys to do the hard work.

1.) jsr and thefox, please hack up a way to apply this into the NES/Fami tracking experience in FamiTracker, NerdTracker, and PornoTracker plz plz, Scandi-niggahs.

2.) Please rewrite the NSF specs, kev so that we may be lovins some good ADPCM vocodings and/or sexamples.

+,

Tidings of lub, j'all.

--

teh b00, crusader for j00z.


Top
 Profile  
 
PostPosted: Thu Jan 03, 2008 4:59 pm 
Offline

Joined: Thu Jun 29, 2006 7:44 pm
Posts: 524
Location: lolz!
B00daW wrote:
As I am an infamously useless troll of sorts, I will just make a request for the betterment of the sk3n3 and get the codemonkeys to do the hard work.

1.) jsr and thefox, please hack up a way to apply this into the NES/Fami tracking experience in FamiTracker, NerdTracker, and PornoTracker plz plz, Scandi-niggahs.

2.) Please rewrite the NSF specs, kev so that we may be lovins some good ADPCM vocodings and/or sexamples.

+,

Tidings of lub, j'all.

--

teh b00, crusader for j00z.


Are drunk or something? :?:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group