Manual Extraction for DPCM samples (*.dmc) from NES/NSF

You can extract DPCM sample (*.dmc) from NES/NSF by hand.

Is there a batch extraction tool or something like that? Tell me if you know.

Requirements

Emulator with memory/register view tool. It's more preferable if frame advance is supported. I used G-NSF in 2008. Maybe you can use modern emulators such as FCEUX instead.

Instruction

  1. Start playing the music and pause while the target DPCM is sounding.
  2. Calculate the DPCM offset and size from $4012/3 register values. offset = ($4012 << 6) + 0xC000; size = ($4013 << 4) + 1; (Also, see lower-4bits of $4010 if you want to know the sampling rate.)
  3. Extract DPCM from RAM via memory viewer (save the whole memory image and cut it, if you cannot save the certain area of the memory).

I think the steps above can be scripted in 2018. We probably should!