I kept on meaning to go and make it less fragile but never got around to it. I figure it'd be better to post it here now, so that either 1- someone else benefits from it 2- someone else inspires me to fix it.
There are a few samples inside. You probably are most interested in noise.asm and noise.obj. (I'm using the xa65 assembler, because it's the only one in debian.). The actual converter itself is analyze.pl -- it's verbosely documented, so if you want to rewrite it in a different language you should be ok.
How it works:
The tool takes a reference set of sounds generatable by the noise hardware, takes their FFTs, and then compares this to the FFTs of a file to be converted, 1/60th of a second of audio at a time, finding the best match. (This is a kind of granular synthesis)
* This tool needs perl, PDL, and PDL::Audio.
* I wrote it on Linux. It might work on windows, but I've not even looked at it.
* I generated the reference audio using FCEU which I'm certain isn't very accurate.
* The closest-FFT algorithm is the wrong one to choose for the short-loop mode of the noise hardware, so tonal things convert things badly
* Conversion is actually simply wrong for converting files not sampled at 48kHz. (it's a tempo-preserving pitch shift of the file by 48kHz/input rate)
Anyway: -h-t-t-p-:-/-/-e-a-m-p-.-o-r-g-/-l-i-/-n-o-i-s-e-g-r-a-i-n-.-7-z- [937kB] It's only so big because I'm including the reference noisewaveforms.wav -- generating it involved stupid hackery.
edit x2: Please use the C version: , it doesn't have any of the build obnoxiousness of the PDL version is the same but also produces a residual (FFT resynthesis of error signal)
A demonstration NES image for the C version is at , or read on from http://nesdev.com/bbs/viewtopic.php?p=69538#p69538