TO DO:
* BUG! chain + tile allocation (can't do 1<<0xf)
* note value should modify envelope+sweep when used in ch3?

future:
* include sample playing support (808 kit)
* soft-synth (including filter+delay?)
* fix song screen multiple up/down
* glide to note command
* add some selectable palettes
* markup parts in song with different colors
* add possibity of having two different songs 
  in mem simultaneously!


---------ROM MAP----------

BANK 1: main
BANK 2: mem,effects,player,sound
BANK 3: screen, views, instr view
BANK 4: tile view
BANK 5: groove view, table view
BANK 6: chain view, wave view
BANK 7: song view, getstr view, misc view

grooves:
16*16/2*frame = 128 bytes

tiles: 
0x66u*0x10u*note*effect1*value1*effect2*value2 = 8160 bytes

chains: 
+- tilenodata = 128*16 = 2048 bytes
+- transposedata = 128*16 = 2048 bytes
+-= 4096 bytes

song: 
+- chainnodata = 0x100*4
+-= 0x400 bytes

arpeggiatos:
+- 0x10 arps * 0x10 steps * 3 = 0x300 bytes
+- grooveptrs = 8 bytes (0x10*4bit)
+-= 0x308 bytes

tempo: 1 byte




-------SRAM MAP-------------

_BANK 0_
A000-AFEF: tiles-> notes
AFF0-B08F: instr-> names

_BANK 1_
A000-A07F: grooves
A080-A87F: chains-> tileno
A880-B07F: chains-> transposes
B080-B47F: song-> chainno
B480-B67F: arpeggiatos-> transpose
B680-B87F: arpeggiatos-> fx
B880-BA7F: arpeggiatos-> fx val
BA80-BC7F: arpeggiatos-> fx 2
BC80-BE7F: arpeggiatos-> fx 2 val
BE80-BE81: mem initialized flag (set to "rb" on init)
BE82-BEA1: tile allocation table
BEA2-BEB1: line allocation table
BEB2-BFB1: instruments->param

_BANK 2_
A000-AFEF: tiles-> fx
AFF0-BFDF: tiles-> fx val

_BANK 3_
A000-AFFF: sample bank 1
B000-BFEF: tiles->instr-ptr


ONE INSTRUMENT CONTAINS...

instrument type: 
         _ _ _ _ _ _ _ _
byte 0: |_|_|_|_|_|_|X|X|

ch 0,1:

byte 1: envelope
byte 2: wave (bits 7-6)
byte 3: sound length (bit 6-0) (if bit 6 is unset, soundlength is UNLIM)
byte 4: sweep
byte 5: vibrato type (bit 2-1: type, bit 0: down/up)
byte 6: auto arpeggiato (bit 5-0: if 5 is unset, no auto arp)
byte 7: pan (bits 1-0)
8 bytes/instrument seems enough!

ch 2:
byte 1: envelope (bits 1-0)
byte 2: wave
byte 3: sound length (bit 6-0) (if bit 6 is unset, soundlength is UNLIM)
byte 5: vibrato type (bit 2-1: type, bit 0: down/up)
byte 6: auto arpeggiato (bit 5-0: if 5 is unset, no auto arp)
byte 7: pan (bits 1-0)
