It is currently Fri Dec 15, 2017 8:37 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: DMC Sample?
PostPosted: Wed Mar 08, 2017 9:58 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 303
Location: Colorado USA
Hey, does anyone know how I would compress and use a DMC sample? Is it pretty much just an MP3?


Top
 Profile  
 
 Post subject: Re: DMC Sample?
PostPosted: Wed Mar 08, 2017 10:19 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1868
Location: DIGDUG
Famitracker does a good job making DMC samples....but I think you have to feed it mono WAV files. You can convert MP3 to WAV using an audio editor, like Audacity.

Unrelated side note, I believe you have to download a separate LAME encoder dll to output MP3 from Audacity.

Tepples also made a DMC encoder, but I think famitracker has better results. I can't remember which file it is.

EDIT, tepples linked to it below...

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Last edited by dougeff on Wed Mar 08, 2017 10:23 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: DMC Sample?
PostPosted: Wed Mar 08, 2017 10:21 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19348
Location: NE Indiana, USA (NTSC)
The MP3 codec was invented in the mid-1990s. Delta modulation is much older. The counter in the NES version has 64 levels, and deltas are packed little-endian with 1 to add one level and 0 to subtract one level.

I've written two command-line conversion tools to convert a .wav file: one in C (available as a Windows executable and source code) and one as a Python script that runs on all major operating systems. The Python script is included in the tools directory in the source code of Eighty; do you want me to dig up the C version?


Top
 Profile  
 
 Post subject: Re: DMC Sample?
PostPosted: Wed Mar 08, 2017 10:24 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10165
Location: Rio de Janeiro - Brazil
No, nothing like MP3, which is a format waaay too complex for the NES to handle. The only format of sampled audio the NES can play automatically is 1-bit DPCM, at different rates. A value of 0 or 1 moves the audio wave up or down, and that's it. I believe there are a few programs that can convert audio to this format. More samples per second means higher quality, but also more space. After you start a sample, the APU will periodically read sample bytes from PRG-ROM automatically, leaving the CPU free to do other things. The APU can optionally fire an IRQ when the sample ends, so you can decide what to do next (repeat the same sample, play another one, etc.).

You can also write 7-bit audio samples directly to the APU, which means you can use your own compression format (MP3 would require a much faster CPU though) and output samples manually in a timely fashion. Due to the time needed to decode the samples and the need to output them at a constant rate, this typically uses 100% of the CPU time, so you normally can't do this while running a game.


Top
 Profile  
 
 Post subject: Re: DMC Sample?
PostPosted: Sun Jul 02, 2017 1:09 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 303
Location: Colorado USA
Okay, the main question I had was how would I make one?


Top
 Profile  
 
 Post subject: Re: DMC Sample?
PostPosted: Sun Jul 02, 2017 1:18 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1868
Location: DIGDUG
You can either.
-Record a sound, and edit it
-Generate a new sound, using a DAW, or soft-synth
-Borrow a free public-domain sample
-use math (ie, program a small program) to produce the data of a sine-wave (for example)

Edit, you could also go to the famitracker forum, download some famitracker files, and take the DMC samples from there. Preferably with permission.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: DMC Sample?
PostPosted: Sun Jul 02, 2017 3:20 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
Use the RJDMC tool.
http://forums.nesdev.com/viewtopic.php?t=6975


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot], Yahoo [Bot] and 9 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