rodot wrote:They main difficulty to play though is the key binding with all the keys for the left hand
Easy enough to change, I'll add a user configuration dialog box for it.
rodot wrote:As soon as I start the program, even before I start a game, there is a continuous high pitch tone
Given the feedback I've been getting here I think it's becoming fairly evident that I'll need to use a different sound playback method. Currently I'm using native winmm functions but there's always the balancing problem of getting the size of the playback buffers just right. Too large and your sound starts to noticeably lag the rest of the game, too small and you get artifacts like stuttering. I think I might have to blow the dust off some of my old DirectSound code.
rodot wrote:The sound rendering is very faithful, do you directly update the sound output at 16Mhz?
No! I got about halfway through implementing the code to do it properly before realizing it was completely unnecessary. The eureka moment for me was when I saw this line of code in your library and realized it was ultimately responsible for every sample being sent to the speaker:
- Code: Select all
OCR2B = output; //60x faster than analogOutput() !
My architecture is designed such that if Timer2 is set for PWM mode then I can easily calculate when it will toggle the speaker port, and my plan was to actually do the full emulation of this and integrate the result. But when I saw that line I instantly realized that if I do it with 100% accuracy the value I get will be exactly the same as the byte stored in OCR2B. Dennith was absolutely correct when he suggested this as a possibility for adding sound support to his emulator in the other thread. You don't even need to modify it in any way, you just create an 8-bit unsigned mono sound channel and you fill it with whatever is in OCR2B and what comes out your speaker will be an exact match.
Well, sort of. The next logical step would be to play a range of frequencies into the speaker, capture them with a very high quality microphone and generate a response curve which could then be fed into a digital equalizer to mimic what it will actually sound like coming from a real Gamebuino speaker.....but that's a project for a rainy day when I'm bored.