File: SynthTest.java

package info (click to toggle)
libtritonus-java 20070428-7
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,792 kB
  • ctags: 11,840
  • sloc: ansic: 53,846; java: 45,251; sh: 3,032; makefile: 1,189; xml: 820; cpp: 147
file content (33 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (8)
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);
	}
}