Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8338481

Received pitch-bend MIDI messages are wrongly decoded.

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      While the outgoing pitch-bend messages are correctly created with short messages that use `data1 = value14Bit & 0x7F`, data2 = (value14Bit >> 7) & 0x7F`, incoming messages are wrong. When coding back to 14-bit values, one obtains 8192 for the lowest pitch-bend, 0 for the center pitch bend, and 16383 for the highest pitch-bend. In other words, while the correct decoding should work via

      `value14Bit = data2 << 7 | data1`

      one has to actually change the value via

      `value14Bit = ((data2 << 7 | data1) + 8192) % 16384`

      Therefore, any MIDI code that correctly parses an incoming pitch bend message, obtains wrong values.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Attach a `new jmidi.Receiver { }` to the `Transmitter` corresponding to a hardware MIDI controller, and observe the incoming `ShortMessage` data.


      CUSTOMER SUBMITTED WORKAROUND :
      Wrap the values around.

      FREQUENCY : always


            kizune Alexander Zuev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: