import javax.sound.midi.*; public class Helilooja4{ public static void main(String argumendid[]) throws Exception{ int[] cduur={60, 64, 67, 72, 76}; int[] fduur={53, 57, 60, 65, 69}; int[] gduur={55, 59, 62, 67, 71}; String akordid="CCCCCCCCGGGGGGGGCCCCGGFGCCCCGGFGCCCCGGGGCCCCGGFGCCCCGGFGCC"; ShortMessage algus = new ShortMessage(); algus.setMessage(ShortMessage.PROGRAM_CHANGE, 0, 21, 0); //Sequence sekvents=new Sequence(Sequence.PPQ, 4); Sequence sekvents=MidiSystem.getSequence( new java.io.File("madis.mid")); //Taktimõõt 2/4, ehk 4 tiksu löögi, 8 tiksu takti kohta int taktidearv=akordid.length(); int looketaktis=3; int tikseloogis=4; int taktipikkus=looketaktis*tikseloogis; //tiksu Track rada=sekvents.createTrack(); rada.add(new MidiEvent(algus, 0)); int noodinr=0; for(int takt=0; takt0){noodinr--;} } else{ if(noodinr