RevEng Posted February 1, 2020 Share Posted February 1, 2020 I've expanded the library of sound effects that come with the 7800basic "soundtest" program. Currently there's 116 fairly distinct sound effects. In the meantime, I figured I'd give you guys a preview... so coders have something new to borrow sounds from, and so non-coders have a new 7800 bin to play around with for a bit of their Saturday evening. soundtest.bas.a78 soundtest.bas.bin (Source code is at the 7800basic github repo) You can also check this out in your web browser (with the most-excellent JS7800 emulator) by following this link. cc65 playback routines and some sample sounds can be found here! Anybody is free to do what they like with these... use them for basic, assembly, port them to the 2600, or whatever. Even if you don't know 7800basic, the TIA data format is pretty obvious. Part of the reason for the growth in sound effects in this library, is I was able to make some improvements in my wave2tia program. There are a few organic-sounding sfx here that were the result of these improvements. In the case of some others, I got a good result from the program, and hand tweaked what I wanted. Other times the result wasn't really accurate, but was hella neat anyway. Warning: nerdy theoretic technical talk ahead... While wave2tia can create some neat conversions, the FFT approach I took is doomed to mediocrity, due to some basics about FFT analysis that I didn't understand when I started this thing. With FFT analysis you have one big trade-off - either you have good frequency accuracy over a very large period of time, or damn poor frequency accuracy over a relatively short period of time. There is no good frequency accuracy that can be performed over short windows. Unfortunately 1/60th of a second sized windows have terrible frequency coarseness. The situation is made worse because FFTs have more coarseness of frequency in the lower end, and TIA has more coarseness of frequency in the higher end. In the end I had to implement a sliding window to get the detection as useful as it is. I analyse 2x 1/60th seconds together (for twice the frequency resolution), save the detected frequencies, advance a single 1/60th second chunk ahead, and then do the analysis on another 2x 1/60th seconds. The two frame sliding window is the sweet spot, and any larger of a window smears the results. So wave2tia is mostly good for WAVs that consist of mostly pure tones, without a lot of overlapping tone layers, and don't change character super quick. Whole songs aren't great, and intelligible human voices are a no-go. I also tried a more complicated implementation, where instead of picking detected fundamental frequencies, I compared the FFT of the WAV sound chunk to FFTs of the possible TIA sounds. While this one held the promise of using TIA noise effects, ultimately the result was even worse than my fundamental frequency approach. To get any sort of accuracy, I needed a sliding window of at least 8 frames. And FFT results tend to spread very differently to adjacent frequencies, depending on the phase of the frequency within the window, so in one phase the frequency in the FFT result would have distinct peaks, and in another phase you'd see those peaks more blurred across neighboring frequencies. I tried to account for this in the comparison scoring, but between that and the large window sizes, this method was beat. I should point out that @EricBall was the first person I'm aware of to try WAV to TIA conversion. (unfortunately I wound up naming my program "wave2tia" before I learned of his "wav2tia" attempts). Interestingly he took a non-fft least-squares approach, which didn't fully pan out either. 60Hz tone samples combined with the limited TIA tone palette is a pretty rocky path. So it's mostly the end of the road for the wave2tia code experiments. I'll likely rename it (to avoid collision with Eric) and post the fundamental-frequency version to github at some point. Of course, I still plan to use the program! The sound-effect library must grow! [edit... wave2tia was renamed to sound2tia, and uploaded to github] Where to get the sound2tia utility... sound2tia can be found at github. 12 2 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.