MKPartRecorder Class Reference

A MKPartRecorder is an MKInstrument that realizes MKNotes by adding copies of them to a MKPart. More...

#import <MKPartRecorder.h>

Inheritance diagram for MKPartRecorder:

MKInstrument

List of all members.

Public Member Functions

(id) - init
 Initializes the receiver by creating and adding its single MKNoteReceiver.
(id) - setTimeUnit:
 Sets the receiver's timeUnit instance variable to aTimeUnit, one of MK_second, MK_beat or MK_timeTag.
(MKTimeUnit- timeUnit
 Returns the receiver's timeUnit, either MK_second, MK_timeTag, or MK_beat.
(void) - setPart:
 Sets aPart as the receiver's MKPart.
(MKPart *) - part
 Returns the receiver's MKPart object.
(id) - realizeNote:fromNoteReceiver:
 Copies aNote, computes and sets the new MKNote's timeTag (and duration if it's a noteDur), and then adds the new MKNote to the receiver's MKPart.
(id) - copyWithZone:
 Creates and returns a new MKPartRecorder as a copy of the receiver.
(id) - setDeltaTCompensation:
 Assigns whether to use time compensation.
(BOOL) - compensatesDeltaT
 Returns whether to use time compensation.

Protected Attributes

MKTimeUnit timeUnit
MKNoteReceivernoteReceiver
MKPartpart


Detailed Description

A MKPartRecorder is an MKInstrument that realizes MKNotes by adding copies of them to a MKPart.

A MKPartRecorder's MKPart is set through the setPart: method. If the MKPart already contains MKNotes, the old MKNotes aren't removed or otherwise affected by recording into the MKPart - the recorded MKNotes are merged in.

Each MKPartRecorder contains a single MKNoteReceiver object. During a performance, a MKPartPerformer receives MKNotes from its MKNoteReceiver, copies them, and then adds them to its MKPart object. Each MKNote is given a new (but not necessarily different) timeTag; if the MKNote is a noteDur, it's also given a new duration. The timeTag and duration are computed either as beats or as seconds, depending on the value of the timeUnit instance variable. If timeUnit is set to MK_second, the default, the new values are in seconds from the beginning of the performance. If it's set to MK_beat, they're computed as beats. If it's set to MK_timeTag, the new values are derived from the timeTag value in the MKNote itself. For example, when recording from MKMidi, you may want to use MK_timeTag.

You can create MKPartRecorders yourself, or you can use a MKScoreRecorder object to create a group of them for you.

See also:
MKScoreRecorder, MKPart

Member Function Documentation

- (id) init  

Initializes the receiver by creating and adding its single MKNoteReceiver.

Returns:
Returns an id. You must invoke this method when creating a new object. A subclass implementation should send [super init] before performing its own initialization.

- (id) setTimeUnit: (MKTimeUnit aTimeUnit  

Sets the receiver's timeUnit instance variable to aTimeUnit, one of MK_second, MK_beat or MK_timeTag.

The default is MK_second.

Parameters:
aTimeUnit is a MKTimeUnit.
Returns:
Returns an id.
See also:
timeunits.h

Returns the receiver's timeUnit, either MK_second, MK_timeTag, or MK_beat.

Returns:
Returns a MKTimeUnit.
See also:
timeunits.h

- (void) setPart: (MKPart *)  aPart  

Sets aPart as the receiver's MKPart.

Parameters:
aPart is an MKPart instance.

- (MKPart *) part  

Returns the receiver's MKPart object.

Returns:
Returns an MKPart instance.

- (id) realizeNote: (MKNote *)  aNote
fromNoteReceiver: (MKNoteReceiver *)  aNoteReceiver 

Copies aNote, computes and sets the new MKNote's timeTag (and duration if it's a noteDur), and then adds the new MKNote to the receiver's MKPart.

aNoteReceiver is ignored. The timeTag and duration computations use the makeTimeTag: and makeDur: methods defined in MKNoteRecorder.

Parameters:
aNote is an MKNote instance.
aNoteReceiver is an MKNoteReceiver instance.
Returns:
Returns the receiver.

Reimplemented from MKInstrument.

- (id) copyWithZone: (NSZone *)  zone  

Creates and returns a new MKPartRecorder as a copy of the receiver.

The new object has its own MKNoteReceiver object but adds MKNotes to the same MKPart as the receiver.

Parameters:
zone is an NSZone.
Returns:
Returns an id.

Reimplemented from MKInstrument.

- (id) setDeltaTCompensation: (BOOL)  yesOrNo  

Assigns whether to use time compensation.

Parameters:
yesOrNo Default is NO.

- (BOOL) compensatesDeltaT  

Returns whether to use time compensation.

Default is NO.


Member Data Documentation

- (MKTimeUnit) timeUnit [protected]

Enumerates possible methods of how time is interpreted.

- (MKNoteReceiver*) noteReceiver [protected]

The object's single NoteReceiver.

- (MKPart*) part [protected]

The MKPartRecorder instance's MKPart.


The documentation for this class was generated from the following file:

Generated on Sat Dec 5 17:01:15 2009 for MusicKit by  doxygen 1.5.6