1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
import javax.sound.midi.Synthesizer;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiChannel;
public class SynthTest
{
public static void main(String[] args)
throws Exception
{
Synthesizer synth = MidiSystem.getSynthesizer();
out("Synthesizer: " + synth);
synth.open();
MidiChannel channel = synth.getChannels()[0];
for (int i = 121; i <= 127; i++)
{
out("controller " + i + ": " + channel.getController(i));
}
out("Mono: " + channel.getMono());
channel.setMono(true);
for (int i = 121; i <= 127; i++)
{
out("controller " + i + ": " + channel.getController(i));
}
out("Mono: " + channel.getMono());
synth.close();
}
private static void out(String msg)
{
System.out.println(msg);
}
}
|