public interface Sequencer extends MidiDevice
Modifier and Type | Interface and Description |
---|---|
static class |
Sequencer.SyncMode
Sequencer 's Synchronization mode |
MidiDevice.Info
Modifier and Type | Field and Description |
---|---|
static int |
LOOP_CONTINUOUSLY
Loop eternally.
|
Modifier and Type | Method and Description |
---|---|
int[] |
addControllerEventListener(ControllerEventListener listener,
int[] controllers)
|
boolean |
addMetaEventListener(MetaEventListener listener)
Add
EventListener for MetaMessage |
int |
getLoopCount()
Get the count of loop.
|
long |
getLoopEndPoint()
Get the end point(ticks) of loop.
|
long |
getLoopStartPoint()
Get start point(ticks) of loop.
|
Sequencer.SyncMode |
getMasterSyncMode()
Get the
Sequencer.SyncMode for master. |
Sequencer.SyncMode[] |
getMasterSyncModes()
Get the available
Sequencer.SyncMode for master. |
long |
getMicrosecondLength()
Get the
Sequence length in microseconds. |
long |
getMicrosecondPosition()
Get the current microsecond position.
|
Sequence |
getSequence()
Get the
Sequence |
Sequencer.SyncMode |
getSlaveSyncMode()
Get the
Sequencer.SyncMode for slave. |
Sequencer.SyncMode[] |
getSlaveSyncModes()
Get the available
Sequencer.SyncMode for slave. |
float |
getTempoFactor()
Get the tempo factor.
|
float |
getTempoInBPM()
Get the tempo in the Beats per minute.
|
float |
getTempoInMPQ()
Get the tempos in the microseconds per quarter note.
|
long |
getTickLength()
Get the
Sequence length in ticks. |
long |
getTickPosition()
Get the current tick position.
|
boolean |
getTrackMute(int track)
Get if the track is mute on the playback.
|
boolean |
getTrackSolo(int track)
Get if the track is solo on the playback.
|
boolean |
isRecording()
Get if the
Sequencer is recording. |
boolean |
isRunning()
Get if the
Sequencer is playing OR recording. |
void |
recordDisable(Track track)
Set the
Track to disable recording |
void |
recordEnable(Track track,
int channel)
Set the
Track to enable recording on the specified channel. |
int[] |
removeControllerEventListener(ControllerEventListener listener,
int[] controllers)
Remove
EventListener for ShortMessage.CONTROL_CHANGE |
void |
removeMetaEventListener(MetaEventListener listener)
Remove
EventListener for MetaMessage |
void |
setLoopCount(int count)
Set count of loop.
|
void |
setLoopEndPoint(long tick)
Set end point(ticks) of loop.
|
void |
setLoopStartPoint(long tick)
Set start point(ticks) of loop.
|
void |
setMasterSyncMode(Sequencer.SyncMode sync)
Set the
Sequencer.SyncMode for master. |
void |
setMicrosecondPosition(long microseconds)
Set the current microsecond position.
|
void |
setSequence(InputStream stream)
Load a
Sequence from stream. |
void |
setSequence(Sequence sequence)
|
void |
setSlaveSyncMode(Sequencer.SyncMode sync)
Set the
Sequencer.SyncMode for slave. |
void |
setTempoFactor(float factor)
Set the tempo factor.
|
void |
setTempoInBPM(float bpm)
Set the tempo in the Beats per minute.
|
void |
setTempoInMPQ(float mpq)
Set the tempos in the microseconds per quarter note.
|
void |
setTickPosition(long tick)
Set the current tick position.
|
void |
setTrackMute(int track,
boolean mute)
Set the track to mute on the playback.
|
void |
setTrackSolo(int track,
boolean solo)
Set track to solo on the playback.
|
void |
start()
Start playing (starting at current sequencer position)
|
void |
startRecording()
Start recording (starting at current sequencer position)
|
void |
stop()
Stop playing AND recording.
|
void |
stopRecording()
Stop recording.
|
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getReceiver, getReceivers, getTransmitter, getTransmitters, isOpen, open
static final int LOOP_CONTINUOUSLY
setLoopCount(int)
,
Constant Field Values@NonNull Sequencer.SyncMode[] getMasterSyncModes()
Sequencer.SyncMode
for master.Sequencer.SyncMode
for master.@NonNull Sequencer.SyncMode getMasterSyncMode()
Sequencer.SyncMode
for master.Sequencer.SyncMode
for master.void setMasterSyncMode(@NonNull Sequencer.SyncMode sync)
Sequencer.SyncMode
for master.sync
- the Sequencer.SyncMode
for master.@NonNull Sequencer.SyncMode[] getSlaveSyncModes()
Sequencer.SyncMode
for slave.Sequencer.SyncMode
for slave.@NonNull Sequencer.SyncMode getSlaveSyncMode()
Sequencer.SyncMode
for slave.Sequencer.SyncMode
for slave.void setSlaveSyncMode(@NonNull Sequencer.SyncMode sync)
Sequencer.SyncMode
for slave.sync
- the Sequencer.SyncMode
for slave.void setSequence(@NonNull InputStream stream) throws IOException, InvalidMidiDataException
Sequence
from stream.stream
- sequence sourceIOException
InvalidMidiDataException
void setSequence(@Nullable Sequence sequence) throws InvalidMidiDataException
sequence
- the Sequence
InvalidMidiDataException
@NonNull int[] addControllerEventListener(@NonNull ControllerEventListener listener, @NonNull int[] controllers)
listener
- event listenercontrollers
- controller codes@NonNull int[] removeControllerEventListener(@NonNull ControllerEventListener listener, @NonNull int[] controllers)
EventListener
for ShortMessage.CONTROL_CHANGE
listener
- event listenercontrollers
- controller codesboolean addMetaEventListener(@NonNull MetaEventListener listener)
EventListener
for MetaMessage
listener
- event listenervoid removeMetaEventListener(@NonNull MetaEventListener listener)
EventListener
for MetaMessage
listener
- event listenerboolean isRecording()
Sequencer
is recording.Sequencer
is recordingboolean isRunning()
Sequencer
is playing OR recording.Sequencer
is playing OR recordingvoid recordDisable(@Nullable Track track)
Track
to disable recordingtrack
- the Track
to disable recordingvoid recordEnable(@NonNull Track track, int channel)
Track
to enable recording on the specified channel.track
- the Track
channel
- the channel, 0-15int getLoopCount()
LOOP_CONTINUOUSLY
: play loops eternallyvoid setLoopCount(int count)
count
- LOOP_CONTINUOUSLY
: play loops eternallylong getLoopStartPoint()
void setLoopStartPoint(long tick)
tick
- 0: start of Sequence
long getLoopEndPoint()
void setLoopEndPoint(long tick)
tick
- -1: end of Sequence
float getTempoFactor()
void setTempoFactor(float factor)
Sequence
's tempo.factor
- float getTempoInBPM()
void setTempoInBPM(float bpm)
bpm
- the tempo in the Beats per minutefloat getTempoInMPQ()
void setTempoInMPQ(float mpq)
mpq
- the tempos in the microseconds per quarter notelong getTickLength()
Sequence
length in ticks.Sequence
length in tickslong getMicrosecondLength()
Sequence
length in microseconds.Sequence
length in microsecondslong getTickPosition()
void setTickPosition(long tick)
tick
- the current tick positionlong getMicrosecondPosition()
getMicrosecondPosition
in interface MidiDevice
void setMicrosecondPosition(long microseconds)
microseconds
- the current microsecond positionboolean getTrackMute(int track)
track
- the track numbervoid setTrackMute(int track, boolean mute)
track
- the track numbermute
- true to set mute the trackboolean getTrackSolo(int track)
track
- the track numbervoid setTrackSolo(int track, boolean solo)
track
- the track numbersolo
- true to set solo the trackvoid start()
void startRecording()
Current Sequence
's events are sent to the all Transmitter
.
Received events art also sent to the all Transmitter
.
void stop()
void stopRecording()