JDK-4895914 : noteOn() produces sound that continues forever
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-07-24
  • Updated: 2009-01-21
  • Resolved: 2009-01-21
Related Reports
Relates :  
Description

Name: rmT116609			Date: 07/24/2003


FULL PRODUCT VERSION :
java version "1.3.1_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_03-b03)
Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)


FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
If I select guitar instrument, then noteOn() method produces
quite strange sound. At the beginning it sounds normally,
but when sound fineshes then it appears again after about 1
second and continues forever with permanent loudness.

If I select piano instrument, then I have no such effect.

Could you tell me, please, how to avoid this problem when
I'm using guitar instrument?


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Compile example code
2.Run it
3.Hear the sound

EXPECTED VERSUS ACTUAL BEHAVIOR :
I expect no more guitar sound when sound volume has
decreased to the zero level (like piano sound behaves).
Actually I see, when guitar sound volume decreases to zero
level, then sound appears againg (after about 1 second) and
continues forever with permanent loudness.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No errors

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.sound.midi.*;

public class TestNoteOn {
    
    static Synthesizer synth;
    static MidiChannel channel;
    
    public static void main(String args[]) throws Exception {
       synth = MidiSystem.getSynthesizer();
       synth.open();
       channel = synth.getChannels()[0];
       
       //Select guitar instrument - number 24
       channel.programChange(24);

       //Select piano instrument - number 0
       //channel.programChange(0);

       //Play the note
       channel.noteOn(60,64);
    }
}

---------- END SOURCE ----------

CUSTOMER WORKAROUND :
noteOff()
(Incident Review ID: 178508) 
======================================================================

Comments
EVALUATION The issue has gone with new Synthesizer (Gervill). Closing the CR.
21-01-2009

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
14-06-2004

EVALUATION ###@###.### 2003-07-24 Per the MIDI specification, a note must be turned off with a NoteOff MIDI event, or a NoteOn event with velocity 0. So that's the way to prevent infinite notes. Here, however, another problem is encountered: guitar restarts playing after it has already finished its tone. Seems like a bug in the MIDI engine's envelope generator. ###@###.### 2003-09-22 No time for tiger, commit to dragonfly.
22-09-2003