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

Method controlChange() does not reset the lower 7 bits of a 14-bit controller

    XMLWordPrintable

Details

    Description

      The specification on javax.sound.midi.MidiChannel.controlChange(int controller,int value) says:

      ------------------------------------------------------------------------------------------
       . . .
      The value of a 14-bit controller is determined by the interaction of the two halves.
      When the most significant 7 bits of a controller are set (using controller numbers 0
      through 31), the lower 7 bits are automatically set to 0.
       . . .
      ------------------------------------------------------------------------------------------

      The testcase api/javax_sound/midi/MidiChannel/index.html#control[control003] checks this behavior.
      Here is the excerpt of the meaningful part of the code:

      ------------------------------------------------------------------------------
              int val = 16;
              int contr = 39; //Channel volume LSB

              try {
                   . . .
                  //Channel volume MSB

                  chan.controlChange((contr - 32), val);

                  . . .
                  //Channel volume LSB
                  if (chan.getController(contr) != 0) {
                      failed = true;
                      log.println("Controller(" + contr +") does not return proper"
                              + " value: " + chan.getController(contr));
                  }

                  . . .
      ------------------------------------------------------------------------------

      And here is the output:

      Controller(39) does not return proper value: 16
      control003: Failed.

      Attachments

        Issue Links

          Activity

            People

              darcy Joe Darcy
              ashusher Alexander Shusherov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: