[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vr/ - Retro Games

Search:


View post   

>> No.2653124 [View]
File: 53 KB, 720x720, 1440140636049.jpg [View same] [iqdb] [saucenao] [google]
2653124

So I finished encoding the instrument wav samples to brr. I had to make a minor fix in my encoder to utilize the brr per block filters correctly, but now the encodes kick ass.

I used my guitar tuner to determine that all the 11025Hz wav files were of instruments sounding at C-4. Since the snes can only alter pitch +/-2octs (you can go lower, but risk distortion), I wanted to check the sample's range in the song to pick an appropriate note when playing at the snes's default 32768Hz. To make things easy, I chose to stick with C notes. Surprisingly I only had to go to C-3 on the "bass" instrument.

To make my life easier I used milkytracker to resample and crop the waveforms.

Next I used a hex editor to strip away the wav header, leaving only 16-bit PCM.

Finally I encoded.

Inserting the samples into ROM and writing a small test script, I have verified the quality of the encoding. The samples are nearly indistinguishable between snes9x and milkytracker, which is impressive for the snes's reputation of muffling sound with a gaussian filter.

I also updated the audio driver slightly in function (though it took damn long enough to fix pointers and hand assemble again). Most importantly I made it so that the KON and KOF registers (the things that make sounds start and stop) are written to only once per bgm iteration. I had it originally set up so that tracks could freely write to these registers, but listening to earlier work made me think some notes where being dropped. These registers get read by the DSP only every 64 SPC700 cycles, so one tracks key on could easily overwrite another's. To fix this I just OR the tracks' kons/kofs together and set them at the end of the subroutine.

Also I added a per track pause, but you need a debugger to use it right now. I tried adding mute with variable success.

I added some more track functions and now need to recode the tracks.

I've pushed to github.com/gewballs/graviton. Checkout "audio.asm"

Navigation
View posts[+24][+48][+96]