SEQUENCER TRACK DATA delta: [p] ticks tick rate may be changed with TEMPO command default is 256hz commands: ***command byte is 7bit + 1bit upper param data (&80h=p7) cmdbyte:name - description [params] [notes] ------------------------------------------------------------ 00h:TERMINATE - end of track this implies 15h command too (end of block) ------------------------------------------------------------ SOURCE ------------------------------------------------------------ 01h:SRCPSG0 - set source: psg square duty 0 02h:SRCPSG1 - set source: psg square duty 1 03h:SRCPSG2 - set source: psg square duty 2 04h:SRCPSG3 - set source: psg square duty 3 05h:SRCPSG4 - set source: psg square duty 4 06h:SRCPSG5 - set source: psg square duty 5 07h:SRCPSG6 - set source: psg square duty 6 08h:SRCPSG7 - set source: psg square duty 7 09h:SRCNOISE - set source: psg noise 0Ah: SRCPCM8 - set source: 8-bit PCM 0Bh: SRCPCM16 - set source: 16-bit PCM 0Ch: SRCADPCM - set source: IMA-ADPCM p7 = looped sound [32] source address [16] source loop point (words) [16] source length (words) 0Dh:SRCTABLE - set source from source-table [16] source table index 0Eh:KEYON - key-on channel 0Fh:KEYOFF - key-off channel all SOURCE commands will perform KEY-ON ------------------------------------------------------------ VOLUME/PANNING/PITCH ------------------------------------------------------------ 10h:VOLUME - set volume [16] 16-bit volume 11h:PANNING - set panning [8] 7-bit panning 12h:PERIOD - set period [16] 16-bit period 13h:ENVELOPE - configure ADSR envelope [8] config flags &1 = AR follows &2 = DR follows &4 = SL follows &8 = SR follows &16 = RR follows &32 = bypass envelope (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 1->0 (attack) or 0->1 (decay) sustain level is .8 fixed point (0=0,255=~1.0) bypass is set as default ------------------------------------------------------------ CONTROL ------------------------------------------------------------ 20h:CHSEL - select channel [8] channel selection (0-39) re-mapping may be applied to tracks 21h:TRVOL - set track master volume [16] volume scale (0-256) 22h:TEMPO - set track tempo [32] track tempo (1.16 fixed point ratio to 256hz internal cycle) 23h:CONFIG - track configuration [track config struct see below] 24h:CUE - send cue [8] user-parameter 25h:CUT - cut current note 26h:CUTPREV - cut previous notes 27h:NNA - set new note action [8] nna type ------------------------------------------------------------ 2Fh:END - end of block data is processed and next delta value follows ------------------------------------------------------------ 30h..7Fh: custom slots new note actions (applied to current note on new key-on command) ---------------- 0: note cut current note will be cut (quick fade out) 1: key-off current note will keyed off 2: continue current note will not be affected by new note 3-15: custom action configuration struct: -------------------- u8 envelope_update_mode; 0=update envelopes each 256hz tick 1=update envelopes each track tick internal cycle = ~256hz (255.6914 hz) = busclock/128/1024 voices: 0-7: first 8 hardware channels 8-15: psg-capable hardware channels 16-31: software channels special use: 1,3 used for reverb (left,right) 4,5 used for audio stream 6,7 used for software mixer ***************************************************************** DATA TYPES [8] 1-byte value [16] 2-byte value [24] 3-byte value [32] 4-byte value [p] variable length value multiple bytes with an 'extend' bit (bit7) if the bit is set then another byte follows and extends the higher bit region, maximum 28 bits