PROGRAMMABLE SEQUENCER 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: "1bit:d7, 7bit:opcode" cmdbyte:name brief description [x] params [x] params... notes ------------------------------------------------------------ 00h:STOP end of track this implies END command too ------------------------------------------------------------ SOURCE ------------------------------------------------------------ many source specifications..... 01:INSTRUMENT ------------- change instrument [8] instrument index ??/ 01:SRCPSG0/1 02:SRCPSG2/3 03:SRCPSG4/5 04:SRCPSG6/7 ---------------------------------------------------------- [d7] even/odd duty index (1=odd) set source to PSG square duty 0-7 05:SRCPCM8 ---------- set source to 8-bit PCM [d7] looped source [32] source address [16] source length (words) if "looped": [16] source loop point (words!) 06:SRCPCM16 ----------- set source to 16-bit PCM 07:SRCADPCM ----------- set source to 4-bit ADPCM 08:SRCNOISE ----------- set source to PSG noise 09:SRCTABLE ----------- set source from source table [p] direct source table index 86:SRCITABLE ------------ set source from source table - indirect [p] indirect source table index ------------------------------------------------------------ VOLUME/PANNING/PITCH ------------------------------------------------------------ 08:VOLUME set volume level [d7] maximum volume nonmax: [16] 16-bit volume level 09:PAN set panning level [d7] center panning noncenter: [8] 7-bit panning level 0A:PERIOD set period [d7] relative relative: [8] signed 8-bit adjustment value direct: [16] new period ------------------------------------------------------------ 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:NOTE ON start new note [d7] has note index/velocity [8] note index [8] velocity 8C:NOTE OFF [d7] release current note/note index d7=1: [8] note index [8] velocity ------------------------------------------------------------ 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-29) (indirect) 11:GVOL set track volume [8] "global" volume scale: 0-128 (Q7) 51:CVOL set channel volume [8] channel volume scale: 0-128 (Q7) 91:MVOL set track master volume [p] master volume scale: 0-16383 (Q14) (usually user controlled) 12:TEMPO set track tempo [32] track tempo: .32 fixed point ratio to 256hz internal cycle minus 1 (ie "1006632960 - 1" is 60hz (60/256*2^32)) 13:CUE track cue 53:PCUE track cue with user parameter [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)