/******************************************************************************/ // Examples of Synthesizer methods getSynthesizer, getChannels, getLatency, // and getMaxPolyphony. // // Roy Vanegas: rvanegas@hunter.cuny.edu /******************************************************************************/ import javax.sound.midi.*; public class ExampleOfSomeSynthesizerMethods { public static void main( String[] args ) { try { // Acquire the default synthesizer Synthesizer synth = MidiSystem.getSynthesizer(); System.out.println(); // Obtains the set of MIDI channels controlled by this synthesizer. MidiChannel[] midiChannels = synth.getChannels(); /** * getLatency obtains the processing latency, expressed in * microseconds, incurred by this synthesizer. */ System.out.println( "Latency on the synth is " + synth.getLatency() ); /** * getMaxPolyphony obtains the maximum number of notes that this * synthesizer can sound simultaneously. */ System.out.println( "Maximum polyphony: " + synth.getMaxPolyphony() ); } catch( MidiUnavailableException e ){} System.exit( 0 ); } }