I would appreciate if someone could help me out cleaning up the code below for a basic program i am doing. Im still very much a begginer but ive added comments to most things to make it easier. The code near the end of class is probably wrong so anyhelp on that would be apprecaited.
// Check if message exists if (byteData != null) { byte [] byteData = message.getMessage (); for (byte b : byteData) { int i = b & 0xFF; System.out.print (i + " "); } System.out.println (); }
// Get status byte and extract command and channel bits int status = byteData [0] &0xFF; int command = status & 0xF0; int channel = status & 0xF0;
// Process message according to the command bits switch (command) { case NOTE_ON;
// Check if note on or alternative note off if (byteData [2]!=0) { win.ShowNoteon (channel, byteData [1], byteData [2] }