[A6] A6 bank manager etc
Reid
reid at rawsound.com
Wed Jun 26 14:10:49 PDT 2002
I wrote a long description (with a minor error) on why you have to
jump through these 7 bit - 8 bit hoops back in November. I did a copy
and paste here (and fixed the error):
-------------
To start, a complete listing of the A6 sysex commands is available at
my web site (Alesis gave permission):
http://www.rawsound.com/programs/A6_SysEx.pdf
And yes you've seen this before. The A6 uses the same basic sysex
commands and data formatting as their QS series of synths.
The A6 is run by a normal type processor that uses 8-bit bytes. We're
all used to that. Data in the A6 banks are either 1-bit flags (in
groups of 8, 16 or 32), 8-bit numbers or characters, 2-byte (16-bit)
numbers, and in a few cases 4 byte numbers.
Serial communication (RS-232 & 422) can send bytes from 5 to 8 bits
in size. Pretty much all serial communication has defaulted to 8-bits
for the last 15 years, including MIDI which is based on that spec.
Why did I go through all of that? Just to show that "8-bits" is
pretty much carved in stone... er silicon. And using 7 or 14 bit
numbers really isn't normal.
But, even though MIDI uses 8-bit bytes, the first bit in a MIDI byte
is reserved for what I think of as the "do it now" bit, ie. note on,
note off, controller, etc. Any MIDI byte with a 1 in the highest
position is a command and most all those bytes are defined by the
MIDI spec. That means for raw data the top bit must be zero leaving
only 7 bits available. Normal 8-bit-grouped data must be sent out
only 7-bits at a time taking 8 serial/MIDI bytes to transmit 7 whole
bytes of real data. (Unless you want to get into data compression
algorithms. But not here.)
OK, you knew that. It's here for clarity.
Alesis refers to this as packing. I'm a little more fancy and call it
"8/7 encoding" referring to the bits per byte. If you have 7 normal
bytes laid-out like this (B=byte, b=bit; be sure you're using a
mono-spaced font for viewing):
B | b8 b7 b6 b5 b4 b3 b2 b1 [ordinal numbering!]
-- ------------------------
1 | A8 A7 A6 A5 A4 A3 A2 A1 [byte A or 1st]
2 | B8 B7 B6 B5 B4 B3 B2 B1 [byte B or 2nd]
3 | C8 C7 C6 C5 C4 C3 C2 C1 [byte C or 3rd]
4 | D8 D7 D6 D5 D4 D3 D2 D1 [byte D or 4th]
5 | E8 E7 E6 E5 E4 E3 E2 E1 [byte E or 5th]
6 | F8 F7 F6 F5 F4 F3 F2 F1 [byte F or 6th]
7 | G8 G7 G6 G5 G4 G3 G2 G1 [byte G or 7th]
then you'd have 8 transmitted bytes mapped like this ("oo" means bit
is set to zero):
B | b8 b7 b6 b5 b4 b3 b2 b1
-- ------------------------
1 | oo A7 A6 A5 A4 A3 A2 A1
2 | oo B6 B5 B4 B3 B2 B1 A8
3 | oo C5 C4 C3 C2 C1 B8 B7
4 | oo D4 D3 D2 D1 C8 C7 C6
5 | oo E3 E2 E1 D8 D7 D6 D5
6 | oo F2 F1 E8 E7 E6 E5 E4
7 | oo G1 F8 F7 F6 F5 F4 F3
8 | oo G8 G7 G6 G5 G4 G3 G2
See, obnoxious but necessary. Of course you have to reverse the
process at the receiving end to see the proper data. Not all Alesis
MIDI products change the bits in exactly this way, others use a
different bit order but the reasoning is the same.
If you want to get at other data in the Bank (not recommended! very
highly not!) keep in mind that the A6 uses a Motorola processor which
is "Big Endian". The bits in a 16-bit word are ordered this way:
16..9,8..1; same as a Macintosh. Intel (therefore PCs and Windows)
are "Little Endian" meaning the bits are ordered: 8..1,16..9. You'll
have to swap the bytes in 16 and 32 bit numbers to read them in a
meaningful way on PCs.
I know I'm breaking the convention of starting the count of bytes or
bits at one rather than zero. The first item is the 1st, not the
zero-th!! I use a zero based count when indexing; the first is the
beginning plus 0, the second is the beginning plus 1, the third is
the beginning plus 2, etc. Using a zero based count to talk about the
data seems like we're bringing our music to the computer rather than
bringing the computer to the music. Let the computer adapt to us, not
vice versa. [soap box cracking]
So, a 2048 byte Program Bank Member becomes 2350 bytes for
transmission with 8/7 encoding, sysex start and stop bytes,
manufacturer and product id's, and command opcodes. Or 2349 bytes if
retrieved from an edit buffer.
Class dismissed.
--
Reid Woodbury Jr
mailto:reid at rawsound.com http://www.rawsound.com
voice 818-749-6065 fax 818-548-8953
More information about the a6
mailing list