I'm trying to make an application that will send a sysex message to a Roland device. I found an example and tried to modify it a bit for my own needs:
protected void transmitSYSEX(String byteString)
{
SysexMessage sysx = new SysexMessage();
int lengthInBytes = byteString.length() / 2;
byte sysxMsg[] = new byte[lengthInBytes];
String message = "";
for (int i = 0; i < lengthInBytes; i++)
{
sysxMsg[i] = (byte) Integer.parseInt(
byteString.substring(i * 2, i * 2 + 1), 16);
}
for (int i = 0 ; i < sysxMsg.length ; i++)
message += sysxMsg[i];
textView.setText(message);
try
{
sysx.setMessage(sysxMsg, sysxMsg.length);
}
catch (InvalidMidiDataException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
out_queue.add(sysx);
}
The byteString is a string that contains the following hex message: F0411000004F1200020201070272F7 However, my control printout at the line textView.setText(message) returns the following string: 15410041000000715
Not quite sure where it goes wrong, shouldn't the textView message be the same as the input message?
Regards /M