Nonogram Dev Log #8: Music Tool

Demo of Catfort Sound, a C#/WPF NES APU emulator

It’s amazing the time you can lose to personal projects when you get like, “employed” or whatever it’s called. Now that that’s out of the way (even if I wish it still was IN the way), I’ve had some time to re-look at the engine – and I’ve got issues. Mainly, I created this game with only a few screens in mind- so few, that I thought I could get away with minimal ROM use by just throwing the full nametables for each game mode plain raw into the ROM.

Big mistake, of course.

I have ideas to optimize that to a large degree, but until then, the sound engine has to live in the swappable banks. This wouldn’t be too much of a problem, except that multiple copies of labels – even in swappable banks – doesn’t go down well with NESASM. To get around this, I have to compile the sound engine individually for every small change made to it – I can store songs per bank, but if I want to make a new arpeggio definition or note length or volume envelope or pitch bend effect… I need to do a whole list of nonsense to even see how it sounded.

by my calculations, I making some new drawing functions to deal with the screen drawing should leave me with MORE than enough room to insert the sound engine into the stable bank, removing the need to re-compile.

…But, that doesn’t necessarily make testing sounds any easier. I still need to try a new setting, make sure it’s defined everywhere it needs to be, put it in the song, recompile, play, and wait to hear the effect. If it’s a bust, that’s a whole new set of retweaks.

Luckily, I’m a programmer standing on the shoulders of much, much smarter giants – and I want to procrastinate screen drawing refactors. With a couple google searches and a LOT of time on the NESDEV APU wiki, I was able to create my own C# tool to test out making music for my specific engine. I wrote a custom API for the APU that can emulate the NES as well as I can get it to, including pretty accurate Pulse, Triangle, Noise, and DMC channels. Big fan of that EB0 bass kick and snare, So I wanted to make sure I could use ’em!

I have support for the FDS wavetable stubbed out too, but that wiki article is much more involved, and I’ll need to dig into it’s implementation more before I can comfortably use it. There are some elements of DSP I’ve elected to not delve into further… It makes pretty dang clear sound as is, but maybe learning limited-band synthesis and how to make and understand a Fourier transform will be well within my near future.

I’d usually have posted the same updates here as I did on linked in, where you can see the progression of the tool – but here it is in it’s current form, where I’ve put in some familiar tunes for testing. Special thanks to Oscilloscope Breakdown YouTubers, the NESDEV community, MiniMeters, and one random guy on Codeproject for all being helpful tools in creating a working NES APU in a WPF program.

…Though, I hope someday soon to move everything over to C++ so I can make all this in Linux instead


Leave a Reply

Discover more from Catfort Software

Subscribe now to keep reading and get access to the full archive.

Continue reading