Quantcast
Channel: nesdev.org
Viewing all articles
Browse latest Browse all 746

DPCM Wavetables

$
0
0
The interesting and useful thing about the APU DMC is that it only cares about $4012 and $4013 when a sample is started or loops. You can change them at any other time. This means that you can get seamless transitions from one sample to another, including from one wavetable to another.

So I built a pack of 34 wavetables - 17 byte ones with a period of 68 samples, ranging from 1 "up" and 67 "down" to 34 both directions. To make it clearly audible that there's no artifacts from changing the waveform, I chose something silent - the zapper - to choose which wavetable.


This means it's actually more versatile than "just" wavetables. You could take an arbitrary longer sample and cut it into an arbitrary number of portions: for example, an "attack" sample, a "sustain" loop, and a "release" sample. All that matters is that the hardware doesn't interrupt you when you update the "sample address" and "sample length" registers.


I've been talking about this for a while, and finally got around to making a very simple demonstration ROM. Source is included. I used Tepples's yonoff zapkernel; it's available under the All-Permissive license. My contributions are Public domain or CC0 as desired. Mapper 218, should work on mapper 7 too.

Expected controls: one joypad on player1, zapper on player2 / FC expansion port. Zapper Y coordinate chooses waveshape (and Y coordinate is displayed on the right); joypad buttons choose note (and the result is displayed on the left). Should work on NTSC and Dendy; no compensation is present for running on PAL.
dpcmwavetables.zip

Statistics: Posted by lidnariq — Tue Oct 01, 2024 7:38 am — Replies 1 — Views 74



Viewing all articles
Browse latest Browse all 746

Trending Articles