Topic: Quad tone engine

Hi guys

Came across this tune on YT which it says uses the 'quad tone' engine.

https://youtu.be/hZtP6VBQIXs?si=xeBR8OXDCJQD51aU


I've not heard of this. Is it a real ZX Beeper engine that can be played on real hardware or one of these ones from packages like furnace tracker?


Good composition

Re: Quad tone engine

quad tone is the Furnace one afaik

3 (edited by Shiru 2024-01-17 06:46:37)

Re: Quad tone engine

Yep, this one if from Furnace. The description says: 'another ZX Spectrum beeper system with full PWM pulses and 3-level volume per channel. It also has a pitchable overlay sample channel'.

A problem with Furnace, though, is that is has support for a lot of chips and platforms that is implemented inside the tracker only, i.e. you can't export some data/code and play it on the real hardware. I don't know about this engine, how exactly it has been designed (my bet it is does not exist as Z80 code and is not really within the actual possibilities), but for example, it has a PET support with the notes lower than 245 Hz, but without a proper exporter. So my guess is they're assuming it is possible, but at the moment it is a mis-named virtual target. Either engine has WAV export only.

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

Re: Quad tone engine

It's a shame Furnace doesn't put more effort into actually getting tracks to run on hardware, since it has already become somewhat of a de-facto standard in the scene and attracts a lot of young talent. But here's the point: That young talent doesn't have access to actual hardware for the most part, so they don't care if it runs on hardware. For them, this is as close to "real" as it gets. That's the reality of chiptune in 2024, like it or not. Can't blame the Furnace devs either - they focus on providing what the majority of their users want, and that works for them, both in terms of number of users as well as number of people involved with development.

The only chance for setting things right from our perspective would be to implement hw support for the two Furnace players ourselves. I think it's doable, the specs are relatively sane. There are a couple of issues - if I understand correctly both engines assume 50Hz updates, which is not feasible for QuadTone, and QuadTone seems to assume an internal loop time of >224t, which obviously is going to have much more of a parasite tone than what is currently emulated. But with a few minor adjustments it could be done. I'm not willing to work on it though for a number of reasons, at least not the C++ side of things.

Re: Quad tone engine

Furnace does feature some kind of debug stream dump, which may be used for conversion purpose, although I'm not really understand what's going on there. For QuadTone it looks like this:

# Furnace Command Stream

[Information]
name: 
author: 
category: 
system: ZX Spectrum (beeper only, QuadTone engine)

[SubSongInformation]
name: 
tickRate: 60.000000

[SysDefinition]

[Stream]
>> TICK 0
  0: HINT_ARPEGGIO 0 0
  0: NOTE_ON 45 2
  1: HINT_ARPEGGIO 0 0
  1: NOTE_ON 40 2
  2: HINT_ARPEGGIO 0 0
  2: NOTE_ON 24 2
  3: HINT_ARPEGGIO 0 0
  3: NOTE_ON 31 2
  4: HINT_ARPEGGIO 0 0
  4: NOTE_ON 24 2
>> TICK 12
  0: NOTE_ON 57 2
  1: NOTE_ON 52 2
  2: NOTE_ON 24 2
  3: NOTE_ON 31 2
>> TICK 24
  0: NOTE_ON 43 2
  1: NOTE_ON 41 2
  2: NOTE_ON 24 2
  3: NOTE_ON 31 2
  4: NOTE_ON 24 2
>> TICK 36
  0: NOTE_ON 55 2
  1: NOTE_ON 53 2
  2: NOTE_ON 24 2
  3: NOTE_ON 31 2
>> TICK 48
  0: NOTE_ON 41 2
  1: NOTE_ON 43 2
  2: NOTE_ON 24 2
  3: NOTE_ON 31 2
  4: NOTE_ON 24 2
website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

6 (edited by utz 2024-01-20 18:01:44)

Re: Quad tone engine

That actually looks quite workable, for a start. I think it could be compressed well enough by first condensing each row so that duplicate data is omitted and presence/absence of entries is marked with some control byte, then adding each unique row to a dictionary and constructing a sequence of pointers to the dictionary.

The question would be what to do with those 60Hz updates. Could be implemented as such in the engine, at the cost of lowering the sample rate and sacrificing accuracy in the time domain (ie. updates would be applied on consecutive loop iterations instead of all at once), or one could recalculate any effects for a lower update rate. In any case effects would need to be flattened/precalculated.

Some things in this dump are a mystery to me as well though. 4: NOTE_ON 24 2 might be a trigger for the interrupting PWM channel, but then where's the sample data and what defines the playback length of the sample?

Edit: Another problem with the stream dump format is that it does not seem to distinguish actual triggers from notes continued from the previous row. Also, where is the instrument information (eg duty)?

Re: Quad tone engine

rough engine draft

Post's attachments

test.tap 3.53 kb, 4 downloads since 2024-01-21 

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

8 (edited by Shiru 2024-01-22 09:50:43)

Re: Quad tone engine

Wow. Sounds reasonable!

In meanwhile, I found one actual FUR module for the QuadTone engine. May come handy for tests.

Post's attachments

Elasticity.fur 1.99 kb, 3 downloads since 2024-01-22 

You don't have the permssions to download the attachments of this post.
website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

Re: Quad tone engine

Ah, great, it's a binary. 1990s called, they want their file formats back. Even after decompressing it, I can't make much sense of it.

Meanwhile, massaged the engine a bit so it does 60Hz updates (at a sample rate of 9114Hz, can't go faster anyway). Now I'm wondering what to do with the drums. Documentation says they're pitchable 1-bit PCM drums up to a max length of 2048 samples running at a rate of 54420 Hz. Not sure why you would want to do it this way, but ok. I'd use PWM drums in any case, but 54420Hz comes down to about 63t, which I don't think is enough to decode either 1-bit PCM or PWM AND calculate pitch. Might have to cut some corners here.

Post's attachments

test.uncompressed.fur 8.32 kb, 2 downloads since 2024-01-22 

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

Re: Quad tone engine

Oh, sorry, here's the text dump. You can dump any module like that with File > Export command stream > Export text.

Post's attachments

elasticity.txt 164.71 kb, 4 downloads since 2024-01-22 

You don't have the permssions to download the attachments of this post.
website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

11 (edited by utz 2024-01-27 00:54:03)

Re: Quad tone engine

Voilà. Haven't tested it extensively so there might still be bugs lurking here and there.
Ended up implementing drums as 8-bit PWM at 27210 Hz. Tried to do it at 54420 Hz, but it's impossible. It wouldn't make much sense anyway since 54420 Hz would leave us with a lower range limit of ~212 Hz unless we'd go 16-bit.

Btw, looks like Furnace can't actually compile z80 code yet. So this is going to take a while in any case.

Edit: source updated with a small tweak to reduce row transition noise

Edit 2: cut player size down to 3333 bytes

Post's attachments

note_names.h 963 b, 5 downloads since 2024-01-24 

quadtone.asm 39.22 kb, 7 downloads since 2024-01-27 

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