View Single Post
  #2 (permalink)  
Old 10-08-2008, 12:30 AM
willemjav willemjav is offline
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 342
Rep Power: 3
willemjav is on a distinguished road
Default
So the hearth beat of this code is the var clkpls and all small counters called in Dutch "tellers" are synchronized on this var.


Code:
miditimer = new Timer(midiclockrate, listener);     // sets the midi clock
miditimer.setRepeats(true); 

class EventHandler implements  ActionListener {
        
         public void actionPerformed(ActionEvent evt) {
           Object source = evt.getSource();
           if (source ==  miditimer)  {          // clkpls reads out the pascal timer
		clkpls++;                          // augments the clock pulse counter  
           }


public void clkset(int x, int y)  {   // after pascal clkset(6,klok); para not used
       // miditimer.stop();                // I do not know if you should stop a timer
        miditimer.start();                 // before starting
        miditimer.setRepeats(true);
        clkpls = 0;
        System.out.println(" midi clock started, rate in mili " + midiclockrate);
     }
     
      public void stopclk()  {
             miditimer.stop();
             
      }
Reply With Quote