← Back to team overview

openjdk team mailing list archive

[Bug 1755640] [NEW] Pitch-Bend Control Wrong On Java MIDI Interface

 

Public bug reported:

When using a Java MIDI interface to connect a MIDI keyboard to either
the Java Sound Synthesizer, or to an external MIDI synthesizer (via a
hardware MIDI interface), the pitch-bend MIDI message is two half-steps
(one note) low (out-of-tune).

It appears that the data1 (least-significant byte), and data2 (most-
significant byte) values are interpreted as a signed 14-bit number
(whose mid-point is 0), rather than an unsigned 14-bit number whose mid-
point is X'00', X'40' = X'0200', as specified in the MIDI spec.

This results in all further notes played being a whole-step too low, and
the pitch-bend values within the range of the MIDI keyboard not being a
smooth progression from low to high.

Here is information from the MIDI trace:

Input IDLE. 
Input ACTIVE. 
Forwarded MIDI = E0, 00, 40 (this message generated by the code to compensate for being out-of-tune)
Received MIDI = E0, 00, 00 
Received MIDI-message: E0 
Received MIDI = E0, 00, 01 (should have been E0, 00, 41)
Input ACTIVE. 
Received MIDI-message: E0 
Received MIDI = E0, 00, 02 (should have been E0, 00, 42), etc.
Received MIDI-message: E0 
Received MIDI = E0, 00, 03 
Received MIDI-message: E0 
Received MIDI = E0, 00, 05 Input IDLE. 
Input ACTIVE. 
Forwarded MIDI = E0, 00, 40 
Received MIDI = E0, 00, 00 
Received MIDI-message: E0 
Received MIDI = E0, 00, 01 
Input ACTIVE. 
Received MIDI-message: E0 
Received MIDI = E0, 00, 02 
Received MIDI-message: E0 
Received MIDI = E0, 00, 03 
Received MIDI-message: E0 
Received MIDI = E0, 00, 05 
Input ACTIVE. 
Received MIDI-message: E0 
Received MIDI = E0, 00, 04 
Received MIDI-message: E0 
Input ACTIVE. 
Received MIDI = E0, 00, 03 
Received MIDI-message: E0 
Input ACTIVE. 
Received MIDI = E0, 00, 02 
Received MIDI-message: E0 
Input ACTIVE. 
Received MIDI = E0, 00, 01 
Received MIDI-message: E0 
Input IDLE. 
Input ACTIVE. 
Received MIDI = 90, 3C, 00 
Received MIDI-message: 90 
Input ACTIVE. 
Received MIDI = 90, 3C, 53 
Received MIDI-message: 90 
Input IDLE. 
Input ACTIVE.
Input ACTIVE. 
Received MIDI-message: E0 
Received MIDI = E0, 00, 04 
Received MIDI-message: E0 
Input ACTIVE. 
Received MIDI = E0, 00, 03 
Received MIDI-message: E0 
Input ACTIVE. 
Received MIDI = E0, 00, 02 
Received MIDI-message: E0 
Input ACTIVE. 
Received MIDI = E0, 00, 01 
Received MIDI-message: E0 
Input IDLE. 
Input ACTIVE. 
Received MIDI = 90, 3C, 00 
Received MIDI-message: 90 
Input ACTIVE. 
Received MIDI = 90, 3C, 53 
Received MIDI-message: 90 
Input IDLE. 
Input ACTIVE.

This is different from how it works on Oracle Java 8, where the value
for 'no pitch-bend' shows up as E0, 00, 40.

It is possible to send the proper pitch-bend values from a Java-
implemented MIDI transmitter, but received pitch-bend values (coming in
on an input MIDI interface) get transformed to an improper value.

This problem has probably been in-existence from the first release of
open Java.  I tested on an old system having Open Java 7, and the
problem was there too.

Until I created 'wrapper code' for the Java Sound (Gervill) Synthesizer,
I had no way to test this functionality.

My expectation is that Open Java will handle pitch-bend messages the
same way as Oracle Java does.

I am using Lubuntu 17.10, but the problem also occurs on Lubuntu
16.04.4.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: openjdk-8-jre 8u151-b12-0ubuntu0.17.10.2
ProcVersionSignature: Ubuntu 4.13.0-36.40-generic 4.13.13
Uname: Linux 4.13.0-36-generic i686
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: i386
CurrentDesktop: LXDE
Date: Tue Mar 13 19:00:12 2018
InstallationDate: Installed on 2016-05-01 (681 days ago)
InstallationMedia: Lubuntu 16.04 LTS "Xenial Xerus" - Release i386 (20160420.1)
SourcePackage: openjdk-8
UpgradeStatus: Upgraded to artful on 2017-10-23 (141 days ago)

** Affects: openjdk-8 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug artful i386

** Attachment added: "jSynth executable JAR file.  Run from terminal: java -jar jSynth.jar"
   https://bugs.launchpad.net/bugs/1755640/+attachment/5078790/+files/jSynth.jar

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-8 in Ubuntu.
https://bugs.launchpad.net/bugs/1755640

Title:
  Pitch-Bend Control Wrong On Java MIDI Interface

Status in openjdk-8 package in Ubuntu:
  New

Bug description:
  When using a Java MIDI interface to connect a MIDI keyboard to either
  the Java Sound Synthesizer, or to an external MIDI synthesizer (via a
  hardware MIDI interface), the pitch-bend MIDI message is two half-
  steps (one note) low (out-of-tune).

  It appears that the data1 (least-significant byte), and data2 (most-
  significant byte) values are interpreted as a signed 14-bit number
  (whose mid-point is 0), rather than an unsigned 14-bit number whose
  mid-point is X'00', X'40' = X'0200', as specified in the MIDI spec.

  This results in all further notes played being a whole-step too low,
  and the pitch-bend values within the range of the MIDI keyboard not
  being a smooth progression from low to high.

  Here is information from the MIDI trace:

  Input IDLE. 
  Input ACTIVE. 
  Forwarded MIDI = E0, 00, 40 (this message generated by the code to compensate for being out-of-tune)
  Received MIDI = E0, 00, 00 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 01 (should have been E0, 00, 41)
  Input ACTIVE. 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 02 (should have been E0, 00, 42), etc.
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 03 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 05 Input IDLE. 
  Input ACTIVE. 
  Forwarded MIDI = E0, 00, 40 
  Received MIDI = E0, 00, 00 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 01 
  Input ACTIVE. 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 02 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 03 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 05 
  Input ACTIVE. 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 04 
  Received MIDI-message: E0 
  Input ACTIVE. 
  Received MIDI = E0, 00, 03 
  Received MIDI-message: E0 
  Input ACTIVE. 
  Received MIDI = E0, 00, 02 
  Received MIDI-message: E0 
  Input ACTIVE. 
  Received MIDI = E0, 00, 01 
  Received MIDI-message: E0 
  Input IDLE. 
  Input ACTIVE. 
  Received MIDI = 90, 3C, 00 
  Received MIDI-message: 90 
  Input ACTIVE. 
  Received MIDI = 90, 3C, 53 
  Received MIDI-message: 90 
  Input IDLE. 
  Input ACTIVE.
  Input ACTIVE. 
  Received MIDI-message: E0 
  Received MIDI = E0, 00, 04 
  Received MIDI-message: E0 
  Input ACTIVE. 
  Received MIDI = E0, 00, 03 
  Received MIDI-message: E0 
  Input ACTIVE. 
  Received MIDI = E0, 00, 02 
  Received MIDI-message: E0 
  Input ACTIVE. 
  Received MIDI = E0, 00, 01 
  Received MIDI-message: E0 
  Input IDLE. 
  Input ACTIVE. 
  Received MIDI = 90, 3C, 00 
  Received MIDI-message: 90 
  Input ACTIVE. 
  Received MIDI = 90, 3C, 53 
  Received MIDI-message: 90 
  Input IDLE. 
  Input ACTIVE.

  This is different from how it works on Oracle Java 8, where the value
  for 'no pitch-bend' shows up as E0, 00, 40.

  It is possible to send the proper pitch-bend values from a Java-
  implemented MIDI transmitter, but received pitch-bend values (coming
  in on an input MIDI interface) get transformed to an improper value.

  This problem has probably been in-existence from the first release of
  open Java.  I tested on an old system having Open Java 7, and the
  problem was there too.

  Until I created 'wrapper code' for the Java Sound (Gervill)
  Synthesizer, I had no way to test this functionality.

  My expectation is that Open Java will handle pitch-bend messages the
  same way as Oracle Java does.

  I am using Lubuntu 17.10, but the problem also occurs on Lubuntu
  16.04.4.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: openjdk-8-jre 8u151-b12-0ubuntu0.17.10.2
  ProcVersionSignature: Ubuntu 4.13.0-36.40-generic 4.13.13
  Uname: Linux 4.13.0-36-generic i686
  ApportVersion: 2.20.7-0ubuntu3.7
  Architecture: i386
  CurrentDesktop: LXDE
  Date: Tue Mar 13 19:00:12 2018
  InstallationDate: Installed on 2016-05-01 (681 days ago)
  InstallationMedia: Lubuntu 16.04 LTS "Xenial Xerus" - Release i386 (20160420.1)
  SourcePackage: openjdk-8
  UpgradeStatus: Upgraded to artful on 2017-10-23 (141 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1755640/+subscriptions


Follow ups