#import <MKPartRecorder.h>
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 |
MKNoteReceiver * | noteReceiver |
MKPart * | part |
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.
- (id) init |
Initializes the receiver by creating and adding its single MKNoteReceiver.
- (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.
aTimeUnit | is a MKTimeUnit. |
- (MKTimeUnit) timeUnit |
Returns the receiver's timeUnit, either MK_second, MK_timeTag, or MK_beat.
- (void) setPart: | (MKPart *) | aPart |
- (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.
aNote | is an MKNote instance. | |
aNoteReceiver | is an MKNoteReceiver instance. |
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.
zone | is an NSZone. |
Reimplemented from MKInstrument.
- (id) setDeltaTCompensation: | (BOOL) | yesOrNo |
Assigns whether to use time compensation.
yesOrNo | Default is NO. |
- (BOOL) compensatesDeltaT |
Returns whether to use time compensation.
Default is NO.
- (MKTimeUnit) timeUnit [protected] |
Enumerates possible methods of how time is interpreted.
- (MKNoteReceiver*) noteReceiver [protected] |
The object's single NoteReceiver.
The MKPartRecorder instance's MKPart.