break;
case 0x0a: // pan - 0x00 ~ x040 ~ 0x7f
smafMessage = new PanMessage(duration, channel, value);
break;
case 0x0b: // expression - normal: 0x00 ~ 0x7f
smafMessage = new ExpressionMessage(duration, channel, value);
break;
default:
smafMessage = new UndefinedMessage(duration);
Debug.println("unknown 0x00, 0x" + StringUtil.toHex2(e2) + ", 3, " + StringUtil.toHex2(data));
break;
}
break;
case 2: // modulation (short) 0x01 ~ 0x0e
smafMessage = new ModulationMessage(duration, channel, modulationTable[data]);
break;
case 1: // pitch bend (short) 0x01 ~ 0x0e
smafMessage = new PitchBendMessage(duration, channel, (data * 8) << 7);
break;
case 0: // expression (short) 0x01 ~ 0x0e
smafMessage = new ExpressionMessage(duration, channel, data == 1 ? 0 : data * 8 + 15);
break;
}
}
}
//Debug.println(available() + ", " + smafMessage);