Topic: new engine: tftone

Ok, one more. This will be the last one for now. I've got some more ideas, but my motivation batteries are a bit exhausted for the time being. Also I do want to work on some other projects in the coming weeks.

Anyway, tftone is basically Tritone (Digi) without transition noise. No special tricks here, just plain and boring loop unrolling. Runs a bit slower than the original Tritone (216t loop), but row length can be controlled up to ¼ tick precision. So yep, it can go really fast.

Due to the big spaghetti mess there may be some bugs hiding here and there. Ultimately I would also like to get the synth loop a bit faster, 216t is still pretty noisy. I think at least 208t should be doable.

I did discover one neat trick. Probably nothing new to some of you, but. I normally like stack-based loaders, not just because they're fast, but also because you can do POP AF and have individually set Z,C,S and P flags for a quick&dirty compression scheme. With this engine however, stack-based loading wasn't feasible. So I found that actually, something functionally equivalent to POP AF can be achived with

  ld a,(hl)     ; or whatever the data pointer is
  or a          ; check for Z
  jr z,...        ; end of pattern or whatever
  sla a

Now the last one is where the magic happens. If bit 7 was set, Carry is now flagged. If bit 6 was set, Sign is flagged. SLA also flags Parity, which means we can turn that on or off individually as well, just need to pay attention to bit 6 and possibly flip another bit so the initial value is not 0 when we don't intend it to be.

Anyway. so much for that. Code's on my github repo as usual. Sorry for the crappy demo tune. Just wanted something fast to demonstrate that it does sound (relatively) clean, but of course that's really tedious to type up in asm. And this is actually speed 4, so it can go even faster.

Post's attachments

tftone-demo.tap 2.64 kb, 10 downloads since 2022-12-19 

You don't have the permssions to download the attachments of this post.

Re: new engine: tftone

Great! I thought of eliminating the row noise as an obvious engine evolution step to take, but never really done any engine with that.

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

Re: new engine: tftone

Thanks! The bad news is that eliminating row noise in this way is tedious as hell. 0/10, would not do it again. Even zbmod with its 20something cloned cores was more fun to write.

Btw, forgot to mention, the engine breaks Fuse. A work-around is to go "Media"->"Tape"->"Clear" after starting the tune.

As I was looking for an alternative, I surveyed a few other emulators running on Linux on their beeper capabilities. Results were mixed.

  • Mame: Still the same. Passable beeper emulation, but not as good as Fuse's. Also, no auto-load capabilities.

  • jsspeccy: Very noisy beeper emulation. Not usable.

  • ZEsarUX: Errr, no. Just no. With "real beeper" mode enabled, the sound is muffled as if it came from under a pillow. Turn "real" mode off and you're left with a screeching, grinding noise that bears 0 resemblence to the actual sound.

  • Xpeccy: I remember this having rather bad beeper emulation, but apparently it's improved quite a lot. It's a bit too clean, but definitely usable. I would consider switching (also because of the fantastic debugger), but unfortunately graphics render with extreme tearing. Also, no key combo to exit the program AND ignoring SIGTERM? Come on.

So, all in all, let's hope Fuse will fix this problem. Submitted a bug report, but no response yet.

Re: new engine: tftone

nice sound. It almost reminds me of some YM2149 tune / sound (Cybernoid?) with the arps.

Thanks for telling about the problem with Fuse, I was going to ask why I didn't get any sound. It looks like fuse is thinking your nice tune is some sort of data and it tries to fastload it. If you disable "fastloading" and "accelerate loaders", (in the media options) it will play fine.

Re: new engine: tftone

Whoa, a wild garvalf appears! Good to see you're still around, mate.