Sequencer (Java SE 15 & JDK 15) (original) (raw)

All Superinterfaces:

[AutoCloseable](../../../../java.base/java/lang/AutoCloseable.html "interface in java.lang"), [MidiDevice](MidiDevice.html "interface in javax.sound.midi")


public interface Sequencer extends MidiDevice

A hardware or software device that plays back a MIDIsequence is known as a sequencer. A MIDI sequence contains lists of time-stamped MIDI data, such as might be read from a standard MIDI file. Most sequencers also provide functions for creating and editing sequences.

The Sequencer interface includes methods for the following basic MIDI sequencer operations:

In addition, the following operations are supported, either directly, or indirectly through objects that the Sequencer has access to:

See Also:

Sequencer.SyncMode, addMetaEventListener(javax.sound.midi.MetaEventListener), ControllerEventListener, Receiver, Transmitter, MidiDevice

Nested Classes

Modifier and Type Interface Description
static class Sequencer.SyncMode A SyncMode object represents one of the ways in which a MIDI sequencer's notion of time can be synchronized with a master or slave device.

Fields

Modifier and Type Field Description
static int LOOP_CONTINUOUSLY A value indicating that looping should continue indefinitely rather than complete after a specific number of loops.
Modifier and Type Method Description
int[] addControllerEventListener​(ControllerEventListener listener, int[] controllers) Registers a controller event listener to receive notification whenever the sequencer processes a control-change event of the requested type or types.
boolean addMetaEventListener​(MetaEventListener listener) Registers a meta-event listener to receive notification whenever a meta-event is encountered in the sequence and processed by the sequencer.
int getLoopCount() Obtains the number of repetitions for playback.
long getLoopEndPoint() Obtains the end position of the loop, in MIDI ticks.
long getLoopStartPoint() Obtains the start position of the loop, in MIDI ticks.
Sequencer.SyncMode getMasterSyncMode() Obtains the current master synchronization mode for this sequencer.
Sequencer.SyncMode[] getMasterSyncModes() Obtains the set of master synchronization modes supported by this sequencer.
long getMicrosecondLength() Obtains the length of the current sequence, expressed in microseconds, or 0 if no sequence is set.
long getMicrosecondPosition() Obtains the current position in the sequence, expressed in microseconds.
Sequence getSequence() Obtains the sequence on which the Sequencer is currently operating.
Sequencer.SyncMode getSlaveSyncMode() Obtains the current slave synchronization mode for this sequencer.
Sequencer.SyncMode[] getSlaveSyncModes() Obtains the set of slave synchronization modes supported by the sequencer.
float getTempoFactor() Returns the current tempo factor for the sequencer.
float getTempoInBPM() Obtains the current tempo, expressed in beats per minute.
float getTempoInMPQ() Obtains the current tempo, expressed in microseconds per quarter note.
long getTickLength() Obtains the length of the current sequence, expressed in MIDI ticks, or 0 if no sequence is set.
long getTickPosition() Obtains the current position in the sequence, expressed in MIDI ticks.
boolean getTrackMute​(int track) Obtains the current mute state for a track.
boolean getTrackSolo​(int track) Obtains the current solo state for a track.
boolean isRecording() Indicates whether the Sequencer is currently recording.
boolean isRunning() Indicates whether the Sequencer is currently running.
void recordDisable​(Track track) Disables recording to the specified track.
void recordEnable​(Track track, int channel) Prepares the specified track for recording events received on a particular channel.
int[] removeControllerEventListener​(ControllerEventListener listener, int[] controllers) Removes a controller event listener's interest in one or more types of controller event.
void removeMetaEventListener​(MetaEventListener listener) Removes the specified meta-event listener from this sequencer's list of registered listeners, if in fact the listener is registered.
void setLoopCount​(int count) Sets the number of repetitions of the loop for playback.
void setLoopEndPoint​(long tick) Sets the last MIDI tick that will be played in the loop.
void setLoopStartPoint​(long tick) Sets the first MIDI tick that will be played in the loop.
void setMasterSyncMode​(Sequencer.SyncMode sync) Sets the source of timing information used by this sequencer.
void setMicrosecondPosition​(long microseconds) Sets the current position in the sequence, expressed in microseconds.
void setSequence​(InputStream stream) Sets the current sequence on which the sequencer operates.
void setSequence​(Sequence sequence) Sets the current sequence on which the sequencer operates.
void setSlaveSyncMode​(Sequencer.SyncMode sync) Sets the slave synchronization mode for the sequencer.
void setTempoFactor​(float factor) Scales the sequencer's actual playback tempo by the factor provided.
void setTempoInBPM​(float bpm) Sets the tempo in beats per minute.
void setTempoInMPQ​(float mpq) Sets the tempo in microseconds per quarter note.
void setTickPosition​(long tick) Sets the current sequencer position in MIDI ticks.
void setTrackMute​(int track, boolean mute) Sets the mute state for a track.
void setTrackSolo​(int track, boolean solo) Sets the solo state for a track.
void start() Starts playback of the MIDI data in the currently loaded sequence.
void startRecording() Starts recording and playback of MIDI data.
void stop() Stops recording, if active, and playback of the currently loaded sequence, if any.
void stopRecording() Stops recording, if active.