public void setVolume(double value) {
		
		if ( (value <0) || (value >1) ) return;
		
		this.volume = value;
		
		if (this.midiSequencer instanceof Synthesizer) {
			
			Synthesizer synthesizer = (Synthesizer)this.midiSequencer;
			MidiChannel[] channels = synthesizer.getChannels();

			for (int i=0; i<channels.length; i++) {
				if (channels[i] != null) {
					channels[i].controlChange(7, (int)(value * 127.0));
				}
			}
		}		
	}