How do I control the volume when playing Midi audio?

John Zukowski

If your Sequencer is a Synthesizer, get its channels and adjust them.

Synthesizer synthesizer = (Synthesizer)sequencer;
MidiChannel channelsp[] = synthesizer.getChannels();
for (int i=0, n=channels.length; i<n; i++) {
  channels[i].controlChange(7, (int)(gain * 127.0)); // gain between 0 and 1
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.