Music Synth 48K - ZX Spectrum beeper music engine
Original Z80 code by Simon C. Tillson, 1989
Reversed and adapted for 1tracker by Shiru 01'2018


The engine comes from eponymoss ZX Spectrum 48K music editor. It was 
also featured in Ano Gaia game. 

The engine features two tone channels with pseudo-volume step-based 
envelopes, and a drum channel with pitch envelope. Global speed. 

This engine has very noticeable cross-detune and unstable tempo issues 
by the original design. Code mostly remained intact in the 1tracker 
adaptation, just a header added, so no improvements to tuning has been 
made. 


Instrument editor tab (F4) allows to edit step-based envelopes. There is 
9 envelopes shared between tone channels (press F4 while cursor is in a 
tone channel), and extra 9 envelopes exclusively for the drum channel 
(press F4 while cursor is in drum channel). 

An envelope is an array of 30 entries, each entry is a level 0..32. 
Envelopes share the same format across all channels, but has different 
effect between tone and drum channels.

Tone channel level 0 is no sound, 1 is quietest tone, 32 is loudest tone.

Drum channel level 0 no sound, 1 is highest pitch, 32 is lowest pitch. 



The columns are:

T1 d E T2 d E D
.... . .... . .
|    | |    | |
+-ch1+ +-ch2+ +drum

T1,T2 : Note, D#2..B-7
    d : Detune, 1..9
	E : Tone envelope number, 1..9
	D : Drum envelope number, 1..9
