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
-
Method Summary
Modifier and TypeMethodDescriptionint
float
bpm()
returns an estimate of the current BPM deduced from the duration between two ticks ( or pulses )void
void
clock_song_position_pointer
(int pOffset16th) void
void
void
void
receiveControlChange
(int channel, int number, int value) void
receiveNoteOff
(int channel, int pitch) void
receiveNoteOn
(int channel, int pitch, int velocity) void
receiveProgramChange
(int channel, int number, int value) void
reset_beat_counter_at_stop
(boolean pResetBeatCounterAtStop) boolean
running()
void
start()
static BeatMIDI
void
stop()
-
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:
receiveProgramChange
in interfaceMidiInListener
-
receiveControlChange
public void receiveControlChange(int channel, int number, int value) - Specified by:
receiveControlChange
in interfaceMidiInListener
-
receiveNoteOff
public void receiveNoteOff(int channel, int pitch) - Specified by:
receiveNoteOff
in interfaceMidiInListener
-
receiveNoteOn
public void receiveNoteOn(int channel, int pitch, int velocity) - Specified by:
receiveNoteOn
in interfaceMidiInListener
-
clock_tick
public void clock_tick()- Specified by:
clock_tick
in interfaceMidiInListener
-
clock_start
public void clock_start()- Specified by:
clock_start
in interfaceMidiInListener
-
clock_continue
public void clock_continue()- Specified by:
clock_continue
in interfaceMidiInListener
-
clock_stop
public void clock_stop()- Specified by:
clock_stop
in interfaceMidiInListener
-
clock_song_position_pointer
public void clock_song_position_pointer(int pOffset16th) - Specified by:
clock_song_position_pointer
in interfaceMidiInListener
-
stop
public void stop() -
start
public void start()
-