Program: 7892
Project: 7892
Buggy source:
public static void main(String[] args) throws Exception {
  int samples=512;
  int width=512;
  int height=200;
  Box content=Box.createVerticalBox();
  Dimension dim=new Dimension(width,height);
  HarmonicOscillator osc=new HarmonicOscillator(samples);
  HarmonicOscillatorControlPanel control=new HarmonicOscillatorControlPanel(osc);
  control.setPreferredSize(dim);
  control.setMinimumSize(dim);
  OscillatorPanel panel=new OscillatorPanel(width,height);
  content.add(control);
  content.add(panel);
  Box controls=Box.createHorizontalBox();
  content.add(controls);
  final AudioOutput output=new AudioOutput(samples);
  JSlider slider=new JSlider(JSlider.VERTICAL,0,127,63);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSlider source=(JSlider)event.getSource();
      int value=(int)source.getValue();
      output.setSampleRate(value);
    }
  }
);
  controls.add(slider);
  slider=new JSlider(JSlider.VERTICAL,0,255,100);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSlider source=(JSlider)event.getSource();
      double value=(double)source.getValue();
      output.setScale(value);
    }
  }
);
  controls.add(slider);
  JFrame frame=new JFrame("String_Node_Str");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setSize(width,height * 3 + 60);
  frame.setContentPane(content);
  frame.setVisible(true);
  for (int i=0; ; ++i) {
    double[] values=osc.calculate();
    panel.setData(values);
    output.write(values);
    osc.increment();
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  int samples=512;
  int width=512;
  int height=200;
  Box content=Box.createVerticalBox();
  Dimension dim=new Dimension(width,height);
  final HarmonicOscillator osc=new HarmonicOscillator(samples);
  HarmonicOscillatorControlPanel control=new HarmonicOscillatorControlPanel(osc);
  control.setPreferredSize(dim);
  control.setMinimumSize(dim);
  OscillatorPanel panel=new OscillatorPanel(width,height);
  content.add(control);
  content.add(panel);
  Box controls=Box.createHorizontalBox();
  content.add(controls);
  final AudioOutput output=new AudioOutput(samples);
  JSlider slider=new JSlider(JSlider.VERTICAL,0,127,63);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSlider source=(JSlider)event.getSource();
      int value=(int)source.getValue();
      output.setSampleRate(value);
    }
  }
);
  controls.add(slider);
  slider=new JSlider(JSlider.VERTICAL,0,255,100);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSlider source=(JSlider)event.getSource();
      double value=(double)source.getValue();
      output.setScale(value);
    }
  }
);
  controls.add(slider);
  slider=new JSlider(JSlider.VERTICAL,0,180,30);
  slider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSlider source=(JSlider)event.getSource();
      int value=(int)source.getValue();
      osc.setTimeDelta(0.001 * value);
    }
  }
);
  controls.add(slider);
  JFrame frame=new JFrame("String_Node_Str");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setSize(width,height * 3 + 60);
  frame.setContentPane(content);
  frame.setVisible(true);
  for (; ; ) {
    double[] values=osc.calculate();
    panel.setData(values);
    output.write(values);
    osc.increment();
  }
}