Archie - ZX Spectrum 1-bit music engine
by utz 09'2019, 1tracker version by Shiru 04'2022


Archie is an experimental 1-bit sound engine for the ZX Spectrum Beeper.
It draws inspiration from other modern beeper engines such as Pytha,
povver, and Tritone Digi.

Archie uses the pulse interleaving technique to create 5 tone channels
with asynchronous volume. The first 4 channels are intended to be used
in pairs with controllable phase offset. This simple setup is useful for
producing a range of different, sometimes surprising effects.

Channels 1a and 2a are playing at roughly 1/3rd of the volume of channel
1 and 2, respectively. The 5th channel plays at about 2/3rds of the
volume of channel 1/2.

The 5th channel is a regular pulse wave channel with duty cycle control
and duty cycle sweep.

In addition to the tone channels, Archie features an interrupting click
drum channel with 3-bit volume control. Click drums are arbitrary PWM
samples played at 31250 Hz. Note that PWM encoded the time between flips
of a bit with 8-bit value, so it can't encode a period of complete
silence. It will be represented with a ~122 Hz square wave instead.

This engine is not compatible with ZX Spectrum 128K +3.



The columns are:

Sp T1 d T1adP T2 d T2adP T3 dWS Dv
.. .... ..... .... ..... ...... ..
   |  | |   | |  | |   | |    | ||
   +ch1 +ch2+ +ch3 +ch4+ +-ch5+ +drum
   
Sp    : Speed, 1..99
T1/T1a,T2/T2a,T3 : Note, C-0..B-9
d     : Detune, 1..9
P     : Phase offset, 1..9
W     : Duty cycle, 1..8 (3.125% to 50%), 9 free running (default 8)
S     : Duty sweep enable (1:enable, 2:disable)
D     : Drum sample, 1..9
v     : Drum volume, 1..7 (quietest to loudest)
