Inherits from NSObject
Declared in MIKMIDISequencer.h

Overview

MIKMIDISequencer can be used to play and record to an MIKMIDISequence.

Note: MIKMIDISequencer currently only supports the playback and recording of MIDI note events. If you need to playback other events from a MIKMIDISequence, use MIKMIDIPlayer for now, keeping in mind that once MIKMIDISequencer is fully functional, MIKMIDIPlayer will be deprecated.

Tasks

Properties

clickTrackStatus

@property (nonatomic) MIKMIDISequencerClickTrackStatus clickTrackStatus
Discussion

When the click track should be heard. The default is MIKMIDISequencerClickTrackStatusEnabledInRecord.

Declared In

MIKMIDISequencer.h

currentTimeStamp

@property (nonatomic) MusicTimeStamp currentTimeStamp
Discussion

The current playback position in the sequence.

Declared In

MIKMIDISequencer.h

loop

@property (nonatomic, getter=shouldLoop) BOOL loop
Discussion

Whether or not playback should loop when between loopStartTimeStamp and loopEndTimeStamp.

Declared In

MIKMIDISequencer.h

loopEndTimeStamp

@property (nonatomic) MusicTimeStamp loopEndTimeStamp
Discussion

The loop’s ending time stamp during looped playback.

Note: To have the loop end at the end of the sequence, regardless of sequence length, set this value to less than 0. The default is -1.

Declared In

MIKMIDISequencer.h

loopStartTimeStamp

@property (nonatomic) MusicTimeStamp loopStartTimeStamp
Discussion

The loop’s beginning time stamp during looped playback.

Declared In

MIKMIDISequencer.h

looping

@property (readonly, nonatomic, getter=isLooping) BOOL looping
Discussion

Whether or not playback is currently looping between loopStartTimeStamp and loopEndTimeStamp.

Note: If loop is YES, and playback starts before loopStartTimeStamp, looping will be NO until currentTimeStamp reaches loopStartTimeStamp. At that point, looped playback will begin and the looping property will become YES. Conversely, if playback starts after loopEndTimeStamp, then the looped area of playback will never be reached and looping will remain NO.

Declared In

MIKMIDISequencer.h

metronome

@property (strong, nonatomic) MIKMIDIMetronome *metronome
Discussion

The metronome to send click track events to.

Declared In

MIKMIDISequencer.h

playing

@property (readonly, nonatomic, getter=isPlaying) BOOL playing
Discussion
Whether or not the sequencer is currently playing. This can be observed with KVO.

Declared In

MIKMIDISequencer.h

preRoll

@property (nonatomic) MusicTimeStamp preRoll
Discussion

The amount of time (in beats) to pre-roll the sequence before recording. For example, if preRoll is set to 4 and you begin recording, the sequence will start 4 beats ahead of the specified recording position.

The default is 4.

Declared In

MIKMIDISequencer.h

recordEnabledTracks

@property (copy, nonatomic) NSSet *recordEnabledTracks
Discussion

The tracks to record incoming MIDI events to while recording is enabled.

Each incoming event is added to every track in this set.

Declared In

MIKMIDISequencer.h

recording

@property (readonly, nonatomic, getter=isRecording) BOOL recording
Discussion

Whether or not the sequence is currently playing and is record enabled. This can be observed with KVO.

Note: When recording is YES, events will only be recorded to the tracks specified by recordEnabledTracks.

Declared In

MIKMIDISequencer.h

sequence

@property (strong, nonatomic) MIKMIDISequence *sequence
Discussion

The sequence to playback and record to.

Declared In

MIKMIDISequencer.h

Class Methods

sequencer

+ (instancetype)sequencer
Discussion

Convenience method for creating a new MIKMIDISequencer instance with an empty sequence.

Return Value

An initialized MIKMIDISequencer.

Declared In

MIKMIDISequencer.h

sequencerWithSequence:

+ (instancetype)sequencerWithSequence:(MIKMIDISequence *)sequence
Discussion

Convenience method for creating a new MIKMIDISequencer ready to playback and record to the specified sequence.

Parameters

sequence

The sequence to playback and record to.

Return Value

An initialized MIKMIDISequencer.

Declared In

MIKMIDISequencer.h

Instance Methods

destinationEndpointForTrack:

- (MIKMIDIDestinationEndpoint *)destinationEndpointForTrack:(MIKMIDITrack *)track
Discussion

Returns the destination endpoint for a track in the sequencer’s sequence.

Note: If track is not contained by the receiver’s sequence, this method returns nil.

Parameters

track

An MIKMIDITrack instance.

Return Value

The destination endpoint associated with track, or nil if one can’t be found.

Declared In

MIKMIDISequencer.h

initWithSequence:

- (instancetype)initWithSequence:(MIKMIDISequence *)sequence
Discussion

Initializes and returns a new MIKMIDISequencer ready to playback and record to the specified sequence.

Parameters

sequence

The sequence to playback and record to.

Return Value

An initialized MIKMIDISequencer.

Declared In

MIKMIDISequencer.h

recordMIDICommand:

- (void)recordMIDICommand:(MIKMIDICommand *)command
Discussion

Records a MIDI command to the record enabled tracks.

Note: When recording is NO, calls to this method will do nothing.

Parameters

command

The MIDI command to record to the record enabled tracks.

Declared In

MIKMIDISequencer.h

resumePlayback

- (void)resumePlayback
Discussion

Starts playback from the position returned by currentTimeStamp.

Declared In

MIKMIDISequencer.h

resumeRecording

- (void)resumeRecording
Discussion

Starts playback from the position returned by currentTimeStamp minus the value returned by preRoll, and enables recording of incoming events to the record enabled tracks.

Declared In

MIKMIDISequencer.h

setDestinationEndpoint:forTrack:

- (void)setDestinationEndpoint:(MIKMIDIDestinationEndpoint *)endpoint forTrack:(MIKMIDITrack *)track
Discussion

Sets the destination endpoint for a track in the sequencer’s sequence. Calling this method is optional. By default, the sequencer will setup internal default endpoints so that playback “just works”.

Note: If track is not contained by the receiver’s sequence, this method does nothing.

Parameters

endpoint

The MIKMIDIDestinationEndpoint instance to which events in track should be sent during playback.

track

An MIKMIDITrack instance.

Declared In

MIKMIDISequencer.h

startPlayback

- (void)startPlayback
Discussion

Starts playback from the beginning of the sequence.

Declared In

MIKMIDISequencer.h

startPlaybackAtTimeStamp:

- (void)startPlaybackAtTimeStamp:(MusicTimeStamp)timeStamp
Discussion

Starts playback from the specified time stamp.

Parameters

timeStamp

The position in the sequence to begin playback from.

Declared In

MIKMIDISequencer.h

startPlaybackAtTimeStamp:MIDITimeStamp:

- (void)startPlaybackAtTimeStamp:(MusicTimeStamp)timeStamp MIDITimeStamp:(MIDITimeStamp)midiTimeStamp
Discussion

Starts playback from the specified MusicTimeStamp at the specified MIDITimeStamp. This could be useful if you need to synchronize the playback with another source such as an audio track, or another MIKMIDISequencer instance.

Parameters

timeStamp

The position in the sequence to begin playback from.

midiTimeStamp

The MIDITimeStamp to begin playback at.

Declared In

MIKMIDISequencer.h

startRecording

- (void)startRecording
Discussion

Starts playback from the beginning of the sequence minus the value returned by preRoll, and enables recording of incoming events to the record enabled tracks.

Declared In

MIKMIDISequencer.h

startRecordingAtTimeStamp:

- (void)startRecordingAtTimeStamp:(MusicTimeStamp)timeStamp
Discussion

Starts playback from the specified time stamp minus the value returned by preRoll, and enables recording of incoming events to the record enabled tracks.

Declared In

MIKMIDISequencer.h

startRecordingAtTimeStamp:MIDITimeStamp:

- (void)startRecordingAtTimeStamp:(MusicTimeStamp)timeStamp MIDITimeStamp:(MIDITimeStamp)midiTimeStamp
Discussion

Starts playback from the specified MusicTimeStamp minus the value returned by preRoll at the specified MIDITimeStamp, and enables recording of incoming events to the record enabled tracks.

Declared In

MIKMIDISequencer.h

stop

- (void)stop
Discussion

Stops all playback and recording.

Declared In

MIKMIDISequencer.h