Sequence class

Represents a collection of tracks, play/pause state, position, loop state, and tempo. Play the sequence to schedule the events on its tracks.

Constructors

Sequence({required double tempo, required double endBeat})

Properties

endBeat double
getter/setter pair
engineStartFrame int
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id int
getter/setter pair
isPlaying bool
getter/setter pair
loopEndBeat double
getter/setter pair
loopStartBeat double
getter/setter pair
loopState LoopState
getter/setter pair
pauseBeat double
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tempo double
getter/setter pair

Methods

beatToFrames(double beat) int
For internal use only. Converts a beat to sample frames.
checkIsOver() → void
For internal use only. Pauses this sequence if it is at its end.
createTracks(List<Instrument> instruments) Future<List<Track>>
Creates tracks in the underlying sequencer engine.
deleteTrack(Track track) List<Track>
Removes a track from the underlying sequencer engine.
destroy() → void
Call this to remove this sequence and its tracks from the global sequencer engine.
framesToBeat(int frames) double
For internal use only. Converts sample frames to a beat.
getBeat([bool estimateFramesSinceLastRender = true]) double
Gets the current beat. Returns a value based on the number of frames rendered and the time elapsed since the last render callback. To omit the time elapsed since the last render callback, pass false.
getIsOver() bool
Returns true if the sequence is at its end beat.
getIsPlaying() bool
Returns true if the sequence is playing.
getLoopedFrame(int frame) int
For internal use only. Maps a frame beyond the end of the loop range to where it would be inside the loop range.
getLoopLengthFrames() int
For internal use only. Returns the length of the loop in frames.
getLoopsElapsed(int frame) int
For internal use only. Returns the number of loops that have been played since the sequence started playing.
getTempo() double
Gets the current tempo.
getTracks() List<Track>
Gets all tracks.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → void
Pauses playback of this sequence. If it is already paused, this will have no effect.
play() → void
Starts playback of this sequence. If it is already playing, this will have no effect.
setBeat(double beat) → void
Immediately changes the position of the sequence to the given beat.
setEndBeat(double beat) → void
Sets the beat at which the sequence will end. Events after the end beat won't be scheduled.
setLoop(double loopStartBeat, double loopEndBeat) → void
Enables looping.
setTempo(double nextTempo) → void
Sets the tempo.
stop() → void
Stops playback of this sequence and resets its position to the beginning.
toString() String
A string representation of this object.
inherited
unsetLoop() → void
Disables looping for the sequence.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

globalState GlobalState
final