public class SysexRoutines extends Object
Data is in a packed format in order to optimize data transfer. Eight MIDI bytes are used to transmit each block of 7 QS data bytes. If the 7 data bytes are looked at as one 56-bit word, the format for transmission is eight 7-bit words beginning with the most significant bit of the first byte, as follows:
SEVEN QUADRASYNTH BYTES:| Constructor and Description |
|---|
SysexRoutines() |
| Modifier and Type | Method and Description |
|---|---|
static char |
decodeChar(int charCode)
Given an Alesis character code for a character, return the character it
represents
|
static int |
encodeChar(char ch)
Given a character, return the Alesis character code that represents it
|
static int |
getBits(byte[] sysex,
int headerCount,
int msBit,
int bitSize,
boolean signed)
Given a compressed sysex, retrieve a run of consecutive bits as an
integer
|
static String |
getChars(byte[] sysex,
int headerCount,
int msBit,
int count)
Given a compressed sysex, retrieve a run of consecutive characters,
starting at the given bit
|
static void |
setBits(int value,
byte[] sysex,
int headerCount,
int msBit,
int bitSize)
Given a compressed sysex, set a run of consecutive bits to a value
|
static void |
setChars(String chars,
byte[] sysex,
int headerCount,
int msBit,
int count)
Given a compressed sysex, set a run of consecutive characters, starting
at the given bit.
|
public static int getBits(byte[] sysex,
int headerCount,
int msBit,
int bitSize,
boolean signed)
sysex - the actual bytes of the sysex messageheaderCount - how many bytes of the sysex are used up as a header -
compression starts after the headermsBit - the starting (most significant) bitbitSize - the number of bits to return - 1 to 8signed - if true, take the two's complement of the resultpublic static void setBits(int value,
byte[] sysex,
int headerCount,
int msBit,
int bitSize)
value - the integer value to set the bits tosysex - the actual bytes of the sysex messageheaderCount - how many bytes of the sysex are used up as a header -
compression starts after the headermsBit - the starting (most significant) bitbitSize - the number of bits to return - 1 to 8public static String getChars(byte[] sysex, int headerCount, int msBit, int count)
sysex - the actual bytes of the sysex messageheaderCount - how many bytes of the sysex are used up as a header -
compression starts after the headermsBit - the starting (most significant) bitcount - the number of characters to returnpublic static void setChars(String chars, byte[] sysex, int headerCount, int msBit, int count)
chars - the characters to setsysex - the actual bytes of the sysex messageheaderCount - how many bytes of the sysex are used up as a header -
compression starts after the headermsBit - the starting (most significant) bitcount - the maximum number of characters to setpublic static char decodeChar(int charCode)
charCode - the code for the character, as stored in the Alesispublic static int encodeChar(char ch)
ch - the characterCopyright © 2014. All Rights Reserved.