Package wellen
Class BeatMIDI
java.lang.Object
wellen.BeatMIDI
- All Implemented Interfaces:
MidiInListener
similar to
Beat except that beat events are triggered by an external MIDI CLOCK signal.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintfloatbpm()returns an estimate of the current BPM deduced from the duration between two ticks ( or pulses )voidvoidclock_song_position_pointer(int pOffset16th) voidvoidvoidvoidreceiveControlChange(int channel, int number, int value) voidreceiveNoteOff(int channel, int pitch) voidreceiveNoteOn(int channel, int pitch, int velocity) voidreceiveProgramChange(int channel, int number, int value) voidreset_beat_counter_at_stop(boolean pResetBeatCounterAtStop) booleanrunning()voidstart()static BeatMIDIvoidstop()
-
Field Details
-
VERBOSE
public static boolean VERBOSE
-
-
Method Details
-
start
- 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:
receiveProgramChangein interfaceMidiInListener
-
receiveControlChange
public void receiveControlChange(int channel, int number, int value) - Specified by:
receiveControlChangein interfaceMidiInListener
-
receiveNoteOff
public void receiveNoteOff(int channel, int pitch) - Specified by:
receiveNoteOffin interfaceMidiInListener
-
receiveNoteOn
public void receiveNoteOn(int channel, int pitch, int velocity) - Specified by:
receiveNoteOnin interfaceMidiInListener
-
clock_tick
public void clock_tick()- Specified by:
clock_tickin interfaceMidiInListener
-
clock_start
public void clock_start()- Specified by:
clock_startin interfaceMidiInListener
-
clock_continue
public void clock_continue()- Specified by:
clock_continuein interfaceMidiInListener
-
clock_stop
public void clock_stop()- Specified by:
clock_stopin interfaceMidiInListener
-
clock_song_position_pointer
public void clock_song_position_pointer(int pOffset16th) - Specified by:
clock_song_position_pointerin interfaceMidiInListener
-
stop
public void stop() -
start
public void start()
-