Octode - series of ZX Spectrum beeper music engines


There is a few Octode versions and forks developed over the years by 
different authors. All of them share the same feature set - eight 
channels of tone with detune, a few interrupting click drum sounds 
independent of the ROM data, loop support. There is minor differences in 
other features, and rather huge difference in the tone between the 
versions. Notes aren't continuous in 1tracker implementatipon, they only 
play for a row. To make a longer note just repeat it as much as needed. 
That's because it is easier to do volume effects through channel 
doubling this way. 

Octode - the original version, developed by Shiru 02/2011-04/2012. It 
 features almost the same sound as ZX-7, which was the main inspiration 
 source, yet uses totally different synthesis method, eight drum sounds, 
 global speed, loop support. Channel counters is 8-bit wide, so there is 
 some usual detuning issues. Speed setting is global. 

Octode XL - made by introspec, 10/2014-04/2015. Keeping most of the 
 original design, it has better sound quality on original ZX Spectrum 
 models, as well as better sound synthesis with more solid tone. It also 
 supports different pseudo-volume configurations that is affects the tone 
 too. This option is global, applied to the whole song. There are three 
 volume levels, plus two mixed configurations where first four channels 
 louder than next four. 

Octode 2k15 - developed by utz 09/2015. It uses 16-bit counters to 
 eliminate detuning issues, and introduces per-row speed control. The 
 tone differs a lot from the other versions. 

Octode PWM - futher development done by utz 09/2015. Having the same 
 features and music data format as 2k15 version, it has another kind of 
 tone, closer to traditional square wave. 

Octode 2k16 - yet another rewrite of the PWM version, by utz, 05/2016. 
 It features better frequency range and cleaner sound, drum volume 
 control, and new compact music data format. 

 
A row contains optional speed column, presented or missing depending on 
the engine version, then eight pairs of note and detune, then drum 
column. 2k16 version has two columns for drums, first is drum number, 
second is volume. 


The columns are:

   T1 d T2 d T3 d T4 d T5 d T6 d T7 d T8 d D   (original, XL)
Sp T1 d T2 d T3 d T4 d T5 d T6 d T7 d T8 d D   (2k15, PWM)
Sp T1 d T2 d T3 d T4 d T5 d T6 d T7 d T8 d Dv  (2k16)
.. .... .... .... .... .... .... .. . .. . ..
   |  | |  | |  | |  | |  | |  | |  | |  |
   +ch1 +ch2 +ch3 +ch4 +ch5 +ch6 +ch7 +ch8
   
Sp : Speed, 1..99
T1-T8 : Tone channels
 Tn : Note, it has different ranges in different versions:
       Original       G#1..B-7
	   XL             G#1..D-6
	   PWM,2k15,2k16  C-0..D-7
  d : Detune, 1..9
  
 D : Drum, 1..8 (less in different versions)
 v : Drum volume, 1..9 (lowest to loudest, 2k16 only)
