有人可以告诉我如何在不使用声音库或合成器的情况下控制 MIDI 音序器的音量吗?
我想让 MIDI 淡出,然后按顺序继续下一个 MIDI
if(midiplay)
{
midi = s + savereq;
try {
//System.out.println("Play MIDI " + midi);
if (musicSr != null)
{
/* This is where I want it to fade out*/
musicSr.stop(); //stop sequencer
musicSr.close(); //close sequencer
}
musicSr = null;
musicS = null;
File music = new File(midi);
if(music.exists())
{
musicS = MidiSystem.getSequence(music);
}
// Create a sequencer for the sequence
musicSr = MidiSystem.getSequencer();
musicSr.open();
musicSr.setSequence(musicS);
musicSr.setLoopCount(musicSr.LOOP_CONTINUOUSLY);
musicSr.start();
} catch (Exception ex) {
ex.printStackTrace();
}
midiplay = false;
}