Package wellen

Class BeatMIDI

java.lang.Object
wellen.BeatMIDI
All Implemented Interfaces:
MidiInListener

public class BeatMIDI extends Object implements MidiInListener
similar to Beat except that beat events are triggered by an external MIDI CLOCK signal.
  • Field Details

    • VERBOSE

      public static boolean VERBOSE
  • Method Details

    • start

      public static BeatMIDI start(Object pListener, String pMidiInput)
      Parameters:
      pListener - object which implements the method `beat(int beatCounter)`
      pMidiInput - MIDI input device to listen to
      Returns:
      BeatMIDI
    • reset_beat_counter_at_stop

      public void reset_beat_counter_at_stop(boolean pResetBeatCounterAtStop)
      Parameters:
      pResetBeatCounterAtStop - if `true` the beat counter is reset to `0` when the MIDI clock signal stops.
    • running

      public boolean running()
      Returns:
      true if beat is running
    • beat_count

      public int beat_count()
      Returns:
      current beat count in pulses per quarter notes (PPQN)
    • bpm

      public float bpm()
      returns an estimate of the current BPM deduced from the duration between two ticks ( or pulses )
      Returns:
      estimated BPM ( might be imprecise in the first few beats )
    • receiveProgramChange

      public void receiveProgramChange(int channel, int number, int value)
      Specified by:
      receiveProgramChange in interface MidiInListener
    • receiveControlChange

      public void receiveControlChange(int channel, int number, int value)
      Specified by:
      receiveControlChange in interface MidiInListener
    • receiveNoteOff

      public void receiveNoteOff(int channel, int pitch)
      Specified by:
      receiveNoteOff in interface MidiInListener
    • receiveNoteOn

      public void receiveNoteOn(int channel, int pitch, int velocity)
      Specified by:
      receiveNoteOn in interface MidiInListener
    • clock_tick

      public void clock_tick()
      Specified by:
      clock_tick in interface MidiInListener
    • clock_start

      public void clock_start()
      Specified by:
      clock_start in interface MidiInListener
    • clock_continue

      public void clock_continue()
      Specified by:
      clock_continue in interface MidiInListener
    • clock_stop

      public void clock_stop()
      Specified by:
      clock_stop in interface MidiInListener
    • clock_song_position_pointer

      public void clock_song_position_pointer(int pOffset16th)
      Specified by:
      clock_song_position_pointer in interface MidiInListener
    • stop

      public void stop()
    • start

      public void start()