title: How to control the MIDI channel's volume
body: <p>I have this code:</p>
  
  <pre><code>Synthesizer synthesizer = MidiSystem.getSynthesizer();
  synthesizer.open();
  Instrument[] instrument = synthesizer.getDefaultSoundbank().getInstruments();
  synthesizer.loadInstrument(instrument[29]);
  MidiChannel[] channels = synthesizer.getChannels();
  MidiChannel channel = channels[1];
  channel.programChange(29);
  channel.noteOn(noteNumber, 127);
  Teszthang.sleep(2000);
  channel.noteOff(noteNumber);
  </code></pre>
  
  <p>so this is an example, to play a sound in max volume (127) for 2 seconds. but i want to control the channel's volume, like after 2 seconds, the volume fade out in an another 2 seconds. How could I do that? I know these methods:</p>
  
  <pre><code>channel.controlChange(controller, value);
  channel.setPolyPressure(noteNumber, pressure);
  </code></pre>
  
  <p>but these don't change any volume! I don't know how to use these methods. How could I change the channel's volume after the <code>noteOn()</code> while it has been playing?</p>