nesdev.com
http://forums.nesdev.com/

DMC Sample?
http://forums.nesdev.com/viewtopic.php?f=2&t=15627
Page 1 of 1

Author:  DementedPurple [ Wed Mar 08, 2017 9:58 am ]
Post subject:  DMC Sample?

Hey, does anyone know how I would compress and use a DMC sample? Is it pretty much just an MP3?

Author:  dougeff [ Wed Mar 08, 2017 10:19 am ]
Post subject:  Re: DMC Sample?

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...

Author:  tepples [ Wed Mar 08, 2017 10:21 am ]
Post subject:  Re: DMC Sample?

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?

Author:  tokumaru [ Wed Mar 08, 2017 10:24 am ]
Post subject:  Re: DMC Sample?

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.

Author:  DementedPurple [ Sun Jul 02, 2017 1:09 pm ]
Post subject:  Re: DMC Sample?

Okay, the main question I had was how would I make one?

Author:  dougeff [ Sun Jul 02, 2017 1:18 pm ]
Post subject:  Re: DMC Sample?

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.

Author:  rainwarrior [ Sun Jul 02, 2017 3:20 pm ]
Post subject:  Re: DMC Sample?

Use the RJDMC tool.
http://forums.nesdev.com/viewtopic.php?t=6975

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/