Topic: new engine: Squeeker Plus

No fancy samples and sh*t this time - just finally finishing off a project that has been on my to-do list for the longest time: A remake of zilogat0r's Squeeker engine! Various cool features added, quoting the readme:

- 4 tone channels, mixed PFM/PWM synthesis
- 2 interrupting click drums
- per-tick duty cycle envelopes
- channels 1 and 2 can play fixed-pitch noise instead of square waves
- channel 4 can use a fast pitch slide for drum simulation
- mixing at approx. 9511 Hz.

I did make an XM converter for this one, but it is very rough code (as is the whole engine, it's got character, to say the least) and needless to say, it does a rather poor job of simulating the sound. Awaiting your bug reports, in any case.

download (XM converter included)
source
demo tune

Re: new engine: Squeeker Plus

This is just amazing, mate! Really, really good.

Re: new engine: Squeeker Plus

Thanks mate, glad you like it!

Re: new engine: Squeeker Plus

Very impressive as always smile

Great sound.

Re: new engine: Squeeker Plus

I love this one!

6 (edited by garvalf 2016-08-19 08:23:44)

Re: new engine: Squeeker Plus

it seems there is a required xmkit.h file which is missing in the archive... (I need to recompile xm2squeekerplus)

ok, I found it there, in the zbmod dir: https://github.com/utz82/ZX-Spectrum-1- … od/xmkit.h

edit: can't compile it:

I've cloned the whole github repo, i could compile zbmod but for squeekerplus, after copying xmlib.cpp and xmlib.h I got this:

g++ -c -Wall -Os -s -std=c++11 -o xmkit.o xmkit.cpp 
g++ -c -Wall -Os -s -std=c++11 -o xm2squeekerplus.o xm2squeekerplus.cpp 
xm2squeekerplus.cpp: In function ‘int main(int, char**)’:
xm2squeekerplus.cpp:103:79: error: ‘class xmod’ has no member named ‘instrVolEnvUsed’
          && (xm.ptnVolumes[ptn][0][row] == xm.ptnVolumes[ptn][0][row-1] || xm.instrVolEnvUsed[xm.ptnInstruments[ptn][0][row]]) && !xm.ptnTriggers[ptn][0][row])
/.../
xm2squeekerplus.cpp:219:34: error: ‘class xmod’ has no member named ‘instrVolEnvPoints’
      unsigned char startval = xm.instrVolEnvPoints[i][j*4+2];
                                  ^
make: *** [xm2squeekerplus.o] Erreur 1

and a bunch of other errors sad

g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4


I'll try the windows binary meanwhile.

(edit2) : ok, it was commented in the xmlib code, probably you've extended this in the version missing, I've uncommented after that: //TODO: hide this

and it compiles now smile

(edit3):

but the converter doesn't work (even with demo song):

XM 2 SQUEEKER PLUS CONVERTER
Segmentation fault

but with wine I can use the .exe so it's ok for me at the moment...

Re: new engine: Squeeker Plus

Whoa, dafuq did that happen? Yeah, the xmkit version from zbmod is not compatible with xm2squeekerplus. At the moment xmkit is still a rather dysfunctional mess, and a prime example of a bad programmer interface. I though "Oh, I'll quickly make a library so I don't have to rewrite the whole XM conversion code every time" but I greatly underestimated the amount of work involved, and lack of experience didn't help either.

Anyway, I've added the required files to the repo. Thanks for reporting!

8 (edited by garvalf 2016-08-19 13:16:35)

Re: new engine: Squeeker Plus

thanks, it's working now.
I've compared the two xmkit versions, there aren't so many differences, so it's not that bad. Maybe one day you'll manage to make a library suitable for every engine, but for the moment it's quite an achievement. Well done.

I've played with the squeeker plus, the duty change with volume or envelope is very clever, it's working fine, except it doesn't really sound similar with milkytracker, but I'm used to imagine clean sounds with some saturation in them wink Sometimes the saturation is quite too much though...

I guess the volume channel and the envelope are cumulative?

It seems possible to make several points in the envelope, is it taken into account by the engine? With two points, if I change the middle one, it will change the sound but I can't really tell if it's an average or if it modulates the effect (I think the former).

For the instrument envelope, we mustn't forget to enable ("on") it in the settings (it's just below the "add" button)

Re: new engine: Squeeker Plus

Cheers wink Channel volume overrides the envelope. Multi-point envelopes are taken into account, though there's a chance they aren't parsed correctly, so check the asm in case something sounds fishy.

10 (edited by garvalf 2016-08-21 20:37:49)

Re: new engine: Squeeker Plus

I'm working more on my Squeeker plus tune. Very enjoyable to compose with this...

I've noticed on the slide kick channel, if I enter some volume change, it doesn't change the duty cycle. But it works if I create a new instrument for that.
Also it looks like for tone instruments with volume envelope, it's the envelope which takes precedence over the channel volume (from my quick tests)

Hmm, strange I've made further tests and now it seems for example for instrument 3 (tone), I can't even change the duty by modifying the volume channel. I'm almost sure it worked before so I don't understand (i'm using this from another computer, maybe my settings? I'll investigate further).

11

Re: new engine: Squeeker Plus

You're right, envelopes take precedence over channel volume, not the other way around. Sorry 'bout that...

For the rest, it sounds like some good ol' bugs... I'll look into it, perhaps tomorrow if I can find some time.

Re: new engine: Squeeker Plus

I've put a sample file on the github tracker

13

Re: new engine: Squeeker Plus

Thanks mate. I've made a new commit, hopefully this should fix the issue. There might be more horrors lurking in the abyss of xmkit though.

Re: new engine: Squeeker Plus

Thank you for the quick fix. Now it's much easier to adjust the saturation to a more bearable level.
For the "Envelope overrides the Channel volume" or the reverse, what do you think would be better? After a bit working with this, I've got the feeling the reverse (like you said earlier) would be more logical but maybe it's just me.

And sorry to bother you also with this (I forgot in my previous post), but it seems the detune is not working.

15

Re: new engine: Squeeker Plus

I agree, the other way around would be more logical. But it would also be much more complicated to detect in the converter, so for the time being I can't be arsed. I've (hopefully) fixed the detune though.

Re: new engine: Squeeker Plus

thanks again, you're the best!

17

Re: new engine: Squeeker Plus

Seems I've introduced another bug with the latest changes. Under some circumstances ch4 appears to not generate the correct note frequencies. It only happens sometimes, haven't quite figured out why. Let me know if you encounter this bug as well.

Re: new engine: Squeeker Plus

I haven't experience anything like this. Is it really out of frequency or is it almost not noticable?
Do you have a sample tune with this behavior?

19 (edited by utz 2016-08-24 09:27:09)

Re: new engine: Squeeker Plus

Ok, found it. It's a bug in Squeeker Plus itself, rather than the converter.
What's happening is that in order to prevent ch4 from being left in a permanent "high" state after applying the slide effect (ie. counter hi byte + duty > 0xff, which would cause channel overload), the channel counter is reset on every tick. That's fine for higher notes, but it's deadly for bass notes.
I've applied a little temp fix for this, but I'm not entirely happy with that solution yet. I've pushed the changes to github for now, though.

Btw, something I forgot to mention regarding detune - contrary to standard XM behaviour, it is only effective in conjunction with a note trigger, and will live till the end of a note rather than the end of a row.

20 (edited by garvalf 2016-08-24 15:34:21)

Re: new engine: Squeeker Plus

I've applied the fix but I'm afraid it breaks some parts of my song. Maybe I was using a bug but I doubt it, because the sound is cut for some high notes, but not always (on other channels than ch4). I'll send you an email with some examples, before and after your modifications.

21

Re: new engine: Squeeker Plus

Reverted the fix and applied another one, which seems to be working. Latest fix is on github now.