I have this code:
Synthesizer synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
Instrument[] instrument = synthesizer.getDefaultSoundbank().getI
You can use CC 7 for setting channel volume.
channel.controlChange(7, value);
see: http://improv.sapp.org/doc/class/MidiOutput/controllers/controllers.html
Sometimes you have some volume events in the midi file so you cannot change channel volume. After getting the sequence, remove these events :
Track[] tracks = sequence.getTracks();
for (Track track : tracks){
for(int i = 0; i < track.size(); i++){
if(!track.remove(track.get(i))){
System.out.println("MIDI Event not removed");
}
}}