import javax.media.sound.midi.*; public class K2{ public static void main(String argumendid[]) throws Exception{ // Sequencer secuencer=MidiSystem.getSequencer(null); Synthesizer synthesizer=MidiSystem.getSynthesizer(null); synthesizer.open(); Instrument pill=synthesizer.getDefaultSoundbank(). getInstruments()[0]; synthesizer.loadInstrument(pill); MidiChannel kanal=synthesizer.getChannels()[0]; for(int i=40; i<120; i++){ kanal.noteOn(i, 60); Thread.sleep(200); kanal.noteOff(i); } } }