Results 1 to 2 of 2
  1. #1
    Ravaa is offline Member
    Join Date
    Mar 2009
    Rep Power

    Default Byte arrays and MIDI - simple question?

    Hi all, I've been looking through the Javax.sound.midi (for midi programming) package and found this:


    public byte[] getMessage()

    Obtains the MIDI message data. The first byte of the returned byte array is the status byte of the message. Any subsequent bytes up to the length of the message are data bytes. The byte array may have a length which is greater than that of the actual message; the total length of the message in bytes is reported by the getLength() method.

    the byte array containing the complete MidiMessage data

    What I would like to do is to get this MIDI message and obtain the second byte of the byte array, either by println on the screen or just to store the number in the variable (this second byte is the velocity/volume byte apparently).

    If anyone has an idea how I could do this that'd be fantastic. Thank you.

  2. #2
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Rep Power


    Well, my recommendation would be to call getMessage() and then take the second byte of the array returned... Which is the actual bit you're struggling with?

Similar Threads

  1. Simple Question
    By barusk in forum Networking
    Replies: 13
    Last Post: 03-04-2009, 07:33 PM
  2. question about arrays
    By broganm1 in forum New To Java
    Replies: 3
    Last Post: 02-13-2008, 02:29 AM
  3. using Byte arrays
    By mew in forum New To Java
    Replies: 2
    Last Post: 01-30-2008, 03:54 AM
  4. Probably a really simple question...
    By ibanez270dx in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 01:27 AM
  5. Question about arrays
    By nhlfan in forum New To Java
    Replies: 4
    Last Post: 11-15-2007, 11:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts