import javax.sound.midi.*; public class Rytmilooja3{ public static void main(String argumendid[]) throws Exception{ ShortMessage lahti = new ShortMessage(); ShortMessage kinni = new ShortMessage(); ShortMessage lahti2 = new ShortMessage(); ShortMessage kinni2 = new ShortMessage(); ShortMessage lahti3 = new ShortMessage(); ShortMessage kinni3 = new ShortMessage(); ShortMessage algus = new ShortMessage(); algus.setMessage(ShortMessage.PROGRAM_CHANGE, 0, 117, 0); lahti.setMessage(ShortMessage.NOTE_ON, 0, 65, 93); kinni.setMessage(ShortMessage.NOTE_OFF, 0, 65, 93); lahti2.setMessage(ShortMessage.NOTE_ON, 0, 77, 93); kinni2.setMessage(ShortMessage.NOTE_OFF, 0, 77, 93); lahti3.setMessage(ShortMessage.NOTE_ON, 0, 69, 93); kinni3.setMessage(ShortMessage.NOTE_OFF, 0, 69, 93); Sequence sekvents=new Sequence(Sequence.PPQ, 4); //Taktimõõt 2/4, ehk 4 tiksu löögi, 8 tiksu takti kohta int taktidearv=16; int taktipikkus=8; //tiksu Track rada=sekvents.createTrack(); rada.add(new MidiEvent(algus, 0)); for(int takt=0; takt