SEQUENCER DATA DEFINITION ============================================================ COMMANDS ============================================================ opcode format: "1bit:d7, 7bit:opcode" cmdbyte:name brief description [x] params [x] params... notes ------------------------------------------------------------ 00h:STOP cut all notes and pause track this implies END command too ------------------------------------------------------------ SOURCE ------------------------------------------------------------ 01:SOURCE change source [32] source address 02:SOURCEINDEX (TODO) indexed change source [8] source index 03:SOURCEOFFSET add source offset [16] sample offset x*256 samples 04:RESERVED 05:RESERVED ------------------------------------------------------------ VOICE PARAMETERS ------------------------------------------------------------ 06:VOLUME set volume level [d7] maximum volume (=65535) nonmax: [16] 16-bit volume level (0..65535) 07:PANNING set panning level [d7] center panning noncenter: [8] 7-bit panning level (0..128) 08:PITCH set pitch [d7] relative relative: [8] signed 8-bit adjustment value direct: [16] new pitch 09:FILTER set filter [d7] disable filter if !d7 [8] cutoff 0..127 [8] resonance 0..127 ------------------------------------------------------------ NOTE OPERATION ------------------------------------------------------------ 0A:NEW NOTE start new note [d7] has handle [8] handle (associated with voice) 0B:RELEASE NOTE [d7] release current note or notes with matching handles d7=1: [8] handle 0C:CUT NOTE [d7] mode if d7: operation = CUTE NOTE (H) [8] handle else: [8] operation 00H = CUTNOTE 01H = CUTRELEASED 02H = CUTALL 0D:FREE NOTE free note(s) [d7] handle mode d7=1: [8] handle 0E:RESERVED 0F:RESERVED ------------------------------------------------------------ CONTROL ------------------------------------------------------------ 10:CHSEL select channel [8] sequencer channel selection (0..xx [max:30 channels]) 11:GVOL set track volume [8] "global" volume scale: 0-128 (Q7) 12:CVOL set channel volume [8] channel volume scale: 0-128 (Q7) 13:MVOL set track master volume [16] master volume scale: 0-4096 (Q12) (usually user controlled) 14:TEMPO set track tempo [32] track tempo: .16 fixed point ratio to 256hz internal cycle (ie "15360" is 60hz (60/256*2^16) or (hz*256)) 15:CUE track cue [32] user data 16:RESERVED 17:RESERVED 18:RESERVED 19:RESERVED 1A:RESERVED 1B:RESERVED 1C:RESERVED 1D:RESERVED 1E:RESERVED ------------------------------------------------------------ 1F:ENDFRAME end of frame d7 = no duration (for instants) data is processed and X time is passed before processing next frame [32] duration of frame (x/65536 ticks) ------------------------------------------------------------ (20-23):EXT-TRACK user command (handled by extensions) y = extension slot [8] header [8] user data size [v] user data 2x(28-2B):EXT-CHANNEL user command y = extension slot [8] header [8] user data size [v] user data 3x(30-33):EXT-VOICE user command y = extension slot [8] header [8] user data size [v] user data 3x(38-3B):EXT-GVOICE user command y = extension slot [8] header [8] user data size [v] user data 50-7F: reserved *** released notes notes that are keyed off may 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)