Class

AVAudioSequencer

A collection of MIDI events organized into multiple music tracks, plus a player to play back the events.

Declaration

@interface AVAudioSequencer : NSObject

Topics

Creating an Audio Sequencer

- init

Initializes a new sequencer that's not connected to an audio engine.

- initWithAudioEngine:

Initializes a new sequencer, handing it the audio engine.

- writeToURL:SMPTEResolution:replaceExisting:error:

Creates and writes a MIDI file from the events in the sequence.

Handling Music Tracks

AVMusicTrack

A collection of music events sent to a given destination, and which can be offset, muted, and manipulated independently from other track events.

AVMusicTrackLoopCount

Constants that define the number of times a track will loop.

Operating an Audio Sequencer

- prepareToPlay

Gets ready to play the sequence by prerolling all events.

- startAndReturnError:

Start the sequencer's player.

- stop

Stops the sequencer's player.

Managing Sequence Load Options

- loadFromData:options:error:

Parses the data and adds its events to the sequence.

- loadFromURL:options:error:

Loads the file referenced by the URL and adds the events to the sequence.

AVMusicSequenceLoadOptions

A structure that defines whether data on different MIDI channels is mapped to multiple tracks, or if the tracks are preserved as they are.

Managing Time Stamps

AVMusicTimeStamp

A fractional number of beats.

- hostTimeForBeats:error:

Returns the host time that will be (or was) played at the specified beat.

- secondsForBeats:

Gets the time, in seconds, for the given beat position (timestamp) in the track.

Handling Beat Range

- beatsForHostTime:error:

Returns the beat that will be (or was) played at the specified host time.

- beatsForSeconds:

Gets the beat position (timestamp) for the given time in the track.

AVBeatRange

A specific time range within a music track.

Getting Sequence Properties

- dataWithSMPTEResolution:error:

Returns a data object containing the events from the sequence.

currentPositionInBeats

The current playback position in beats.

currentPositionInSeconds

The current playback position, in seconds.

playing

A Boolean value that indicates whether or not the sequencer's player is playing.

rate

The playback rate of the sequencer's player.

tempoTrack

The tempo track.

tracks

An array containing all the tracks in the sequence.

userInfo

A dictionary containing metadata derived from a sequence.

Relationships

Inherits From

See Also

Source Node Types

AVAudioInputNode

A node that connects to the system's audio input.

AVAudioIONode

The base class for nodes that connect to the system's audio input or output.

AVAudioIONodeInputBlock

A block to get input data when called by a render operation in the manual rendering mode.

AVAudioNodeCompletionHandler

A general callback handler.

AVAudioPlayerNodeCompletionHandler

The callback handler for buffer or file completion.

AVAudioPlayerNode

A class that plays buffers or segments of audio files.

AVAudioUnitGenerator

An audio unit subclass that generates audio output.

AVAudioUnitMIDIInstrument

An abstract class representing music devices or remote instruments.

AVAudioUnitSampler

A class that encapsulates Apple's Sampler Audio Unit.