More tech details to come later, for now check out this vid.
WOW :O:O
That's so cooool!!
The music is great as usual, you're going against the current and trends and I like that. We'll all hooked on your video for sure...
I'm sure next year you'll be able to discover the 5th channel on Houston Tracker as well
Last edited by garvalf (Apr 1, 2016 9:09 am)
Thanks mate!
Also, did I seriously put this in /consoles instead of /handhelds? Would one of you mods be kind enough to move the thread?
I assure you that this is 100% legit So here's the ROM:
http://irrlichtproject.de/downloads/dmg5th.gb
Real hardware only, almost all emulators I've tested fail on this.
@herr_prof Afair that NL version could only play a few selected notes though?
Im pretty sure it could play a full range of note (chords too!) but was a simple square voice.
Im pretty sure it could play a full range of note (chords too!) but was a simple square voice.
This is NOT what I was expecting! The predictable thing would have been to use bit 3/7 of FF24 to create a square wave and the timer to generate frequencies. Instead, you are using using channel 2 to generate a DC offset and abusing its volume control to generate two interleaved PCM channels, as far as I could gather from a quick look at the code at least. Not necessarily what I would call a 5th channel, but really innovative!
As far as emulation is concerned, Gambatte does a good job of emulating it, if sound resampler is set to high quality (polyphase FIR) or higher, which it should be by default I believe.
This is NOT what I was expecting! The predictable thing would have been to use bit 3/7 of FF24 to create a square wave and the timer to generate frequencies. Instead, you are using using channel 2 to generate a DC offset and abusing its volume control to generate two interleaved PCM channels, as far as I could gather from a quick look at the code at least. Not necessarily what I would call a 5th channel, but really innovative!
As far as emulation is concerned, Gambatte does a good job of emulating it, if sound resampler is set to high quality (polyphase FIR) or higher, which it should be by default I believe.
DC offset how? PWM manipulation?
aha NATIVE fifth voice without using the external input! Neaaatt!
haaa damnit nitro, the joke could have kept on going for a couple more hours as far as I'm concerned
Ok, so what's going on here? In short, yes, there's an actual fifth voice. And no, it's of course not an actual DMG channel - if there was a fifth channel (other than Vin), I'm sure someone would've found it by now.
The method used is pretty much what nitro said, mixing two voices on PU2 via basic high speed pulse interleaving (so yes, a sort of PWM manipulation, if you will). Basically the same technique as in HoustonTracker or the Tritone routine for ZX Spectrum, but tweaked for use on DMG.
The DC offset is achieved by frequently restarting the duty cycle via FF19, so output will always stay high (some documents claim duty cycle is never reset, but as far as I can tell it is). To get the output low, PU2 is disconnected from the terminal via FF25.
FF17 (PU2 volume) is not used (just mentioning for clarity, not sure that was what you were implying). One could actually use FF17 on top of it, but it was a bit dodgy when I tested it, and I didn't want to delve further into it because I had set myself a time limit for completing the thing.
Anyway, thanks for checking it out
Edit: Btw glad to hear Gambatte is doing the trick. I only tested with an old version, which didn't work so well. Another one that does work is mednafen - surprisingly, as it's not even a dedicated Gameboy emulator.
Last edited by irrlichtproject (Apr 1, 2016 6:48 pm)
(some documents claim duty cycle is never reset, but as far as I can tell it is).
This is still true. What's referred to is that the phase isn't reset to 0. What is reset when restarting the channel is the phase accumulator, so the phase is only reset back to the previous (iirc) 1/16 of a complete cycle.
FF17 (PU2 volume) is not used (just mentioning for clarity, not sure that was what you were implying).
Yeah, sorry I did mean FF25.
Edit: Btw glad to hear Gambatte is doing the trick. I only tested with an old version, which didn't work so well. Another one that does work is mednafen - surprisingly, as it's not even a dedicated Gameboy emulator.
The real problem here actually isn't as much GB emulation accuracy, as audio oversampling.
irrlichtproject wrote:(some documents claim duty cycle is never reset, but as far as I can tell it is).
This is still true. What's referred to is that the phase isn't reset to 0. What is reset when restarting the channel is the phase accumulator, so the phase is only reset back to the previous (iirc) 1/16 of a complete cycle.
Ah, thanks for the info, makes sense. I guess it also explains why the writes to FF19 are necessary at such high frequency.