SEQUENCER TRACK DATA DEFINITION track data blocks are prefixed with a timing value "delta" it is the number of ticks to pass until processing the block delta is a variable-width value [p] ============================================================ COMMANDS ============================================================ opcode format: "2bit:upper, 6bit:lower" cmdbyte:name brief description [x] params [x] params... notes ------------------------------------------------------------ 00h:STOP end of track this implies 1F command too (end of block) ------------------------------------------------------------ SOURCE ------------------------------------------------------------ many source specifications..... 01:SRCPSG0 41:SRCPSG1 81:SRCPSG2 C1:SRCPSG3 set source to PSG square duty 0->3 02:SRCPSG4 42:SRCPSG5 82:SRCPSG6 C2:SRCPSG7 set source to PSG square duty 4->7 03:SRCPCM8 43:SRCPCM16 set source to one-shot PCM [32] source address [16] source length (words) 83:SRCLPCM8 C3:SRCLPCM16 set source to looped PCM [32] source address [16] source length (words) [16] source loop point (words) 04:SRCADPCM set source to one-shot ADPCM [32] source address [16] source loop point (words) 84:SRCLADPCM set source to looped ADPCM [32] source address [16] source loop length (words) [16] source loop point (words) 05:SRCNOISE set source to PSG noise 06:SRCTABLE set source from source table [p] direct source table index 86:SRCITABLE set source from source table - indirect [p] indirect source table index 07:reserved all SOURCE commands will perform KEY-ON ------------------------------------------------------------ VOLUME/PANNING/PITCH ------------------------------------------------------------ 08:VOLUME set volume level [16] 16-bit volume level 09:PAN set panning level [8] 7-bit panning level 49:CPAN center panning level 89:LPAN hard-left panning level C9:RPAN hard-right panning level 0A:PERIOD set period [16] 16-bit period 4A:APERIOD adjust period [8] signed 8-bit offset ------------------------------------------------------------ VOLUME ENVELOPE ------------------------------------------------------------ 0B:ENVELOPE [8] config flags &1 = AR follows &2 = DR follows &4 = SL follows &8 = SR follows &16= RR follows (if corresponding bits are set:) [p] AR attack rate [p] DR decay rate [p] SL sustain level [p] SR sustain decay rate [p] RR release rate rates are specified in number of ticks that it will take to slide from 0->1 (ar) or 1->0 (dr,sr,rr) sustain level is 0.14 fixed point (0=0,16383=~1.0) 8B:BYPASSENV bypass envelope bypass is set as default ------------------------------------------------------------ KEY ON/OFF ------------------------------------------------------------ 0C:KEYON start new note 8C:KEYOFF release current note ------------------------------------------------------------ CUT ------------------------------------------------------------ 0D:CUT cut current note current note will be released and cut 4D:CUTPREV released notes associated with channel will be cut 8D:CUTALL all notes associated with channel will be released and cut ------------------------------------------------------------ OTHER ------------------------------------------------------------ 0E:AUTORELEASE_ON 8E:AUTORELEASE_OFF auto release: new notes will apply key-off to current ------------------------------------------------------------ CONTROL ------------------------------------------------------------ 10:CHSEL select channel [8] sequencer channel selection (0-39) re-mapping is applied to tracks 11:MVOL set track master volume [p] master volume scale: 0-16383 (Q14) 12:TEMPO set track tempo [p] track tempo: x.24 fixed point ratio to 256hz internal cycle (ie "3932160" is 60hz (60/256*2^24)) 13:CUE track cue [8] user parameter 14:AUTORELEASE_ALL 94:AUTORELEASE_ALLOFF enable/disable auto release for all channels ------------------------------------------------------------ 1F:END end of block data is processed and next delta value follows ------------------------------------------------------------ 20-37: 24 custom channel slots 38-3F: 8 custom global slots *** released notes notes that are keyed off will be able to be overwritten by new notes voices: 0-15: hardware channels 16-31: software channels special hardware use: 1,3 used for reverb (left,right) 4,5 used for audio stream 6,7 used for software mixing stream (30ch max) 8-13 psg square capable 14,15 psg noise capable ***************************************************************** DATA TYPES [8] 8-bit value [16] 16-bit value [24] 24-bit value [32] 32-bit value [p] variable length value 7-bit data with 1-bit extend param if bit7 is set then another byte follows and extends the higher bit region, maximum length is 29 bits of data (7+7+7+8bits)