MKScore Class Reference

A MKScore is a collection of MKPart objects. MKScores can be read from and written to a scorefile or midifile, performed with a MKScorePerformer, and can be used to record MKNotes from a MKScoreRecorder. More...

#import <MKScore.h>

List of all members.

Public Member Functions

(id) - init
 Initializes the receiver.
(void) - dealloc
 Releases the receiver and its contents.
(void) - removeAllParts
 Removes the receiver's MKParts.
(id) - readScorefile:
 Opens the scorefile named fileName and merges its contents with the receiver.
(id) - readScorefileStream:
 Reads the scorefile pointed to by stream into the receiver.
(id) - readScorefile:firstTimeTag:lastTimeTag:timeShift:
 The same as readScorefile:, but only those MKNotes with timeTags in the specified range are added to the receiver.
(id) - readScorefileStream:firstTimeTag:lastTimeTag:timeShift:
 The same as readScorefileStream:, but only those MKNotes with timeTags in the specified range are added to the receiver.
(id) - writeScorefile:
 Opens the scorefile named aFileName and writes the receiver to it (the file is overwritten).
(id) - writeScorefileStream:
 Writes the receiver into the scorefile pointed to by aStream.
(id) - writeScorefile:firstTimeTag:lastTimeTag:timeShift:
 The same as writeScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - writeScorefileStream:firstTimeTag:lastTimeTag:timeShift:
 The same as writeScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - writeOptimizedScorefile:
 Opens the OptimizedScorefile named fileName and writes the receiver to it (the file is overwritten).
(id) - writeOptimizedScorefileStream:
 Writes the receiver into the OptimizedScorefile pointed to by aStream.
(id) - writeOptimizedScorefile:firstTimeTag:lastTimeTag:timeShift:
 The same as writeOptimizedScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - writeOptimizedScorefileStream:firstTimeTag:lastTimeTag:
 The same as writeOptimizedScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - writeOptimizedScorefileStream:firstTimeTag:lastTimeTag:timeShift:
 The same as writeOptimizedScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file. The written MKNotes' timeTags are shifted by timeShift beats. Returns the receiver or nil if the file couldn't be written.
(id) - readMidifile:firstTimeTag:lastTimeTag:timeShift:
 Reads the midifile aFileName into the receiver.
(id) - readMidifileStream:firstTimeTag:lastTimeTag:timeShift:
 Reads the midifile from aStream into the receiver.
(id) - readMidifile:
 Reads the midifile fileName into the receiver, creating MKParts for each MIDI Channel represented in the file and MKNotes for each MIDI message.
(id) - readMidifileStream:
 Reads the midifile from aStream, converting the messages therein into MKNote objects.
(id) - writeMidifile:firstTimeTag:lastTimeTag:timeShift:
 Writes the receiver's MKNotes, within the given timeTag range, as a midifile named aFileName.
(id) - writeMidifileStream:firstTimeTag:lastTimeTag:timeShift:
 Write the receiver, as a midifile, to aStream.
(id) - writeMidifileStream:
 Write the receiver, as a midifile, to aStream.
(id) - writeMidifile:
 The receiver is written as a format 1 midifile.
(unsigned) - noteCount
 Returns the number of MKNotes in all the receiver's MKParts.
(MKPart *) - replacePart:with:
 Removes oldPart from the receiver and replaces it with newPart.
(id) - addPart:
 Adds aPart to the receiver.
(id) - removePart:
 Removes aPart from the receiver.
(id) - shiftTime:
 Shifts the timeTags of all receiver's MKNotes by shift beats.
(id) - scaleTime:
 Scales the timeTags and durations of all receiver's MKNotes by scale beats.
(double) - earliestNoteTime
 Returns the time tag of the earliest note in the score.
(BOOL) - isPartPresent:
 Returns YES if aPart has been added to the receiver, otherwise returns NO.
(MKPart *) - midiPart:
 Returns the first MKPart object that represents MIDI Channel aChan by checking the MK_midiChan info parameter.
(unsigned) - partCount
 Returns the number of MKPart contained in the receiver.
(NSMutableArray *) - parts
 Creates and returns a NSMutableArray containing the receiver's MKParts.
(NSArray *) - notes
 Returns an NSArray of all MKNotes in all MKParts in the receiver.
(NSArray *) - notesBetweenFirstTimeTag:lastTimeTag:
 Returns an NSArray of all the notes in the score which have a time tag between the bounds.
(id) - combineNotes
 Combine notes into noteDurs for all MKParts.
(id) - copyWithZone:
 Creates and returns a new MKScore as a copy of the receiver in the nominated NSZone.
(void) - setInfoNote:
 Sets the receiver's info MKNote to a copy of aNote.
(MKNote *) - infoNote
 Returns the receiver's info MKNote.
(void) - setScorefilePrintStream:
 Sets the stream used by ScoreFile print statements to aStream.
(NSMutableData *) - scorefilePrintStream
 Returns the receiver's ScoreFile print statement stream.
(id) - writeScorefile:firstTimeTag:lastTimeTag:
 The same as writeScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - writeScorefileStream:firstTimeTag:lastTimeTag:
 The same as writeScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - readScorefile:firstTimeTag:lastTimeTag:
 The same as readScorefile:, but only those MKNotes with timeTags in the specified range are added to the receiver.
(id) - readScorefileStream:firstTimeTag:lastTimeTag:
 The same as readScorefileStream:, but only those MKNotes with timeTags in the specified range are added to the receiver.
(id) - writeOptimizedScorefile:firstTimeTag:lastTimeTag:
 The same as writeOptimizedScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.
(id) - readMidifile:firstTimeTag:lastTimeTag:
 Reads the midifile aFileName into the receiver.
(id) - readMidifileStream:firstTimeTag:lastTimeTag:
 Reads the midifile from aStream into the receiver.
(id) - writeMidifile:firstTimeTag:lastTimeTag:
 Writes the receiver's MKNotes, within the given timeTag range, as a midifile named aFileName.
(id) - writeMidifileStream:firstTimeTag:lastTimeTag:
 Write the receiver, as a midifile, to aStream.
(MKPart *) - partTitled:
 Returns the MKPart whose info note has an MK_title parameter equal to partTitleToFind, nil if it couldn't be found.
(MKPart *) - partNamed:
 Returns the MKPart named partNameToFind, nil if it couldn't be found.

Static Public Member Functions

(id) + setMidifilesEvaluateTempo:
 Sets the class variable midifilesEvaluateTempo, which specifies how tempo is interpreted when reading or writing MIDI files.
(BOOL) + midifilesEvaluateTempo
 Returns the value of the class variable midifilesEvaluateTempo..
(NSArray *) + midifileExtensions
 Returns the possible file extensions used in writing and reading MIDI files appropriate for the native operating system.
(NSArray *) + scorefileExtensions
 Returns the possible file extensions used in writing and reading scorefiles files appropriate for the native operating system.
(void) + setAlternativeScorefileExtensions:
 This method allows overriding the file extensions used in writing and reading scorefiles files returned by scorefileExtensions.
(NSArray *) + fileExtensions
 Returns the possible file extensions used in writing and reading scorefiles and MIDI files appropriate for the native operating system.
(NSArray *) + bundleExtensions
 Returns the possible file extensions supported by any available plugins.
(MKScore *) + score
 Creates and returns an allocated, initialised and autoreleased MKScore instance.
(MKScoreFormat) + scoreFormatOfData:
 Determines the format of the scorefile data.
(MKScoreFormat) + scoreFormatOfFile:
 Determines the format of the named scorefile.

Protected Attributes

NSMutableArray * parts
NSMutableData * scorefilePrintStream
MKNoteinfo


Detailed Description

A MKScore is a collection of MKPart objects. MKScores can be read from and written to a scorefile or midifile, performed with a MKScorePerformer, and can be used to record MKNotes from a MKScoreRecorder.

A MKScore is a collection of MKPart objects. MKScores can be read from and written to a .score or .playscore scorefile or a Standard MIDI file, performed with a MKScorePerformer, and can be used to record MKNotes from a MKScoreRecorder.

Each MKScore has an info MKNote (a mute) that defines, in its parameters, information that can be useful in performing or otherwise interpreting the MKScore. Typical information includes tempo, DSP headroom (see the MKOrchestra Class), and sampling rate (the parameters MK_tempo, MK_headroom, and MK_samplingRate are provided to accommodate this utility).

When you read a scorefile into a MKScore, a MKPart object is created and added to the MKScore for each MKPart name in the file's part statement. If the MKScore already contains a MKPart with the same name as a MKPart in the file, the MKNotes from the two sources are merged together in the existing MKPart in the MKScore.

MKScoreFile print statements are printed as the scorefile is read into a MKScore. You can set the stream on which the messages are printed by invoking setScorefilePrintStream:.


Member Function Documentation

- (id) init  

Initializes the receiver.

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

- (id) readScorefile: (NSString *)  fileName  

Opens the scorefile named fileName and merges its contents with the receiver.

Parameters:
fileName is an NSString instance.
Returns:
Returns an id. The file is automatically closed. Returns the receiver or nil if the file couldn't be read.

- (id) readScorefileStream: (NSData *)  stream  

Reads the scorefile pointed to by stream into the receiver.

Parameters:
stream is a NSData instance.
Returns:
Returns the receiver or nil if the file couldn't be read. The file must be open for reading; the sender is responsible for closing the file.

- (id) readScorefile: (NSString *)  fileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

The same as readScorefile:, but only those MKNotes with timeTags in the specified range are added to the receiver.

Parameters:
fileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns the receiver or nil if the file couldn't be read. The added MKNotes' timeTags are shifted by timeShift beats.

- (id) readScorefileStream: (NSData *)  stream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

The same as readScorefileStream:, but only those MKNotes with timeTags in the specified range are added to the receiver.

Parameters:
stream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns the receiver or nil if the file couldn't be read. The added MKNotes' timeTags are shifted by timeShift beats.

- (id) writeScorefile: (NSString *)  aFileName  

Opens the scorefile named aFileName and writes the receiver to it (the file is overwritten).

Parameters:
aFileName is a NSString instance.
Returns:
Returns the receiver or nil if the file couldn't be written. The file is automatically closed.

- (id) writeScorefileStream: (NSMutableData *)  aStream  

Writes the receiver into the scorefile pointed to by aStream.

Parameters:
aStream is a NSMutableData instance.
Returns:
Returns an id. The file must be open for reading; the sender is responsible for closing the file. Returns the receiver or nil if the file couldn't be written.

- (id) writeScorefile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

The same as writeScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns the receiver or nil if the file couldn't be written. The written MKNotes' timeTags are shifted by timeShift beats.

- (id) writeScorefileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

The same as writeScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns the receiver or nil if the file couldn't be written. The written MKNotes' timeTags are shifted by timeShift beats.

- (id) writeOptimizedScorefile: (NSString *)  aFileName  

Opens the OptimizedScorefile named fileName and writes the receiver to it (the file is overwritten).

Parameters:
aFileName is a NSString instance.
Returns:
Returns the receiver or nil if the file couldn't be written. The file is automatically closed.

- (id) writeOptimizedScorefileStream: (NSMutableData *)  aStream  

Writes the receiver into the OptimizedScorefile pointed to by aStream.

Parameters:
aStream is a NSMutableData instance.
Returns:
Returns the receiver or nil if the file couldn't be written. The file must be open for reading; the sender is responsible for closing the file.

- (id) writeOptimizedScorefile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

The same as writeOptimizedScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns the receiver or nil if the file couldn't be written. The written MKNotes' timeTags are shifted by timeShift beats.

- (id) writeOptimizedScorefileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

The same as writeOptimizedScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns the receiver or nil if the file couldn't be written.

- (id) writeOptimizedScorefileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

The same as writeOptimizedScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file. The written MKNotes' timeTags are shifted by timeShift beats. Returns the receiver or nil if the file couldn't be written.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns an id.

- (id) readMidifile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

Reads the midifile aFileName into the receiver.

Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns an id. The MKNotes that are created are retained in the receiver only if their timeTags are within the given boundaries. TimeShift is added to each timeTag.
See also:
-readMidiFileStream: for a discussion of MIDI to MKNote conversion.

- (id) readMidifileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

Reads the midifile from aStream into the receiver.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns an id. Only the MKNote objects that have timeTags within the given boundaries are retained in the receiver. timeShift is added to each MKNote's timeTag.

- (id) readMidifile: (NSString *)  fileName  

Reads the midifile fileName into the receiver, creating MKParts for each MIDI Channel represented in the file and MKNotes for each MIDI message.

Parameters:
fileName is a NSString instance.
Returns:
Returns an id.
See also:
-readMidifileStream: for a discussion of MIDI to MKNote conversion.

- (id) readMidifileStream: (NSMutableData *)  aStream  

Reads the midifile from aStream, converting the messages therein into MKNote objects.

Parameters:
aStream is a NSMutableData instance.
Returns:
Returns an id. A midifile is converted into MKNotes as follows:
If the file is format 0, the Channel Voice messages are written into 16 MKParts, one for each channel. Channel Mode and System messages are combined in an additional MKPart. The midi channel of a particular MKPart can be determined by examining the MK_midiChan parameter of the MKPart info MKNote. The special MKPart has no MK_midiChan parameter.

If the file is format 1, each track is written to a separate MKPart. The track number is set in the MKPart info's MK_track parameter.

If the file is format 2, each track is written to a separate MKPart. The track number is set in the MKPart info's MK_sequence parameter.

Tempo is encoded in the MK_tempo parameter of the MKScore's info. Similarly, copyright shows up in the MKScore's info as an MK_copyright parameter.

The info of each MKPart that corresponds to a track is given an MK_instrumentName parameter if a corresponding meta-event appears in the file.

Other MIDI file meta-events such as time signature, lyric, etc. appear as corresponding MKNote parameters in mute MKNotes in the appropriate MKPart.

The current contents of the MKScore are not affected. The new MKParts are never merged with the current contents. Instead, new MKParts are added to the MKScore.

- (id) writeMidifile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

Writes the receiver's MKNotes, within the given timeTag range, as a midifile named aFileName.

Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns an id. timeShift is added to each MKNote's timeTag.
See also:
-- writeMidifile: for conversion details.

- (id) writeMidifileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag
timeShift: (double)  timeShift 

Write the receiver, as a midifile, to aStream.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
timeShift is a double.
Returns:
Returns an id. Only the MKNotes within the given timeTag boundaries are written. timeShift is added to each MKNote's timeTag.

- (id) writeMidifileStream: (NSMutableData *)  aStream  

Write the receiver, as a midifile, to aStream.

Parameters:
aStream is a NSMutableData instance.
Returns:
Returns an id.

- (id) writeMidifile: (NSString *)  aFileName  

The receiver is written as a format 1 midifile.

Parameters:
aFileName is a NSString instance.
Returns:
Returns an id. The MKScore instance is written as follows:
The MKParts are written in the order they appear in the MKScore as separate tracks. The track number encoded in the MKPart's info MKNote is ignored. MKNoteDurs are split into noteOns and noteOffs as defined by MKPart's splitNotes method. The original MKPart isn't altered.

If the receiver's info has a title or tempo parameter, these are written to the midifile.

- (unsigned) noteCount  

Returns the number of MKNotes in all the receiver's MKParts.

Returns:
Returns an unsigned.

- (MKPart *) replacePart: (MKPart *)  oldPart
with: (MKPart *)  newPart 

Removes oldPart from the receiver and replaces it with newPart.

If oldPart is not a member of this score, returns nil and doesn't add newPart. If oldPart is nil, or if newPart is already a member of this score, or if oldPart is not a kind of MKPart, returns nil.

Parameters:
oldPart is an id.
newPart is an id.
Returns:
Returns newPart.

- (id) addPart: (MKPart *)  aPart  

Adds aPart to the receiver.

The MKPart is first removed from the MKScore that it's presently a member of, if any.

Parameters:
aPart is an MKPart instance.
Returns:
Returns self, or nil if it's already a member of the receiver.

- (id) removePart: (MKPart *)  aPart  

Removes aPart from the receiver.

Parameters:
aPart is an MKPart instance.
Returns:
Returns self or nil if it wasn't a member of the receiver.

- (id) shiftTime: (double)  shift  

Shifts the timeTags of all receiver's MKNotes by shift beats.

Parameters:
shift is a double.
Returns:
Returns the receiver.

- (id) scaleTime: (double)  scale  

Scales the timeTags and durations of all receiver's MKNotes by scale beats.

Parameters:
scale is a double.
Returns:
Returns the receiver.

- (double) earliestNoteTime  

Returns the time tag of the earliest note in the score.

This can be useful to determine how much silence precedes the first note.

Returns:
Returns a double of time in seconds.

- (BOOL) isPartPresent: (MKPart *)  aPart  

Returns YES if aPart has been added to the receiver, otherwise returns NO.

Parameters:
aPart is an MKPart instance.
Returns:
Returns a BOOL.

- (MKPart *) midiPart: (int)  aChan  

Returns the first MKPart object that represents MIDI Channel aChan by checking the MK_midiChan info parameter.

There are 17 MIDI Channels: 0 represents the channel for MIDI System and Channel Mode messages and 1 through 16 represent the Voice Channels.

Parameters:
aChan is an int.
Returns:
Returns an MKPart instance.

- (unsigned) partCount  

Returns the number of MKPart contained in the receiver.

Returns:
Returns an unsigned.

- (NSMutableArray *) parts  

Creates and returns a NSMutableArray containing the receiver's MKParts.

The MKParts themselves aren't copied.

Returns:
Returns an id.

- (NSArray *) notes  

Returns an NSArray of all MKNotes in all MKParts in the receiver.

Returns:
Returns an autoreleased NSArray instance.

- (NSArray *) notesBetweenFirstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

Returns an NSArray of all the notes in the score which have a time tag between the bounds.

Returns:
Returns an autoreleased NSArray instance.

- (id) copyWithZone: (NSZone *)  zone  

Creates and returns a new MKScore as a copy of the receiver in the nominated NSZone.

The receiver's MKPart, MKNotes, and info MKNote are all copied.

Returns:
Returns an id.

- (void) setInfoNote: (MKNote *)  aNote  

Sets the receiver's info MKNote to a copy of aNote.

The receiver's previous info MKNote is removed and released.

Parameters:
aNote is an MKNote.

- (MKNote *) infoNote  

Returns the receiver's info MKNote.

Returns:
Returns an MKNote.

- (void) setScorefilePrintStream: (NSMutableData *)  aStream  

Sets the stream used by ScoreFile print statements to aStream.

Parameters:
aStream is a NSMutableData instance.

- (NSMutableData *) scorefilePrintStream  

Returns the receiver's ScoreFile print statement stream.

Returns:
Returns a NSMutableData instance.

+ (id) setMidifilesEvaluateTempo: (BOOL)  yesOrNo  

Sets the class variable midifilesEvaluateTempo, which specifies how tempo is interpreted when reading or writing MIDI files.

Tempo is interepreted as follows:

If midifilesEvaluateTempo is YES, the MKNotes' timeTags and durations are modified according to the tempo. For example, if the tempo is 120 and a MIDI note begins at time 1.0 in the file and lasts for a half of a beat, the corresponding Music Kit MKNote will have a timeTag of 0.5 and a duration of 0.25. Similarly, when writing files, the tempo is taken into account. For example, if the tempo is 120 and a Music Kit MKNote has a timeTag of 0.5 and a duration of 0.25, it is converted back to a MIDI note that begins at time 1.0 and lasts for a half of a beat.

If midifilesEvaluateTempo is NO, the modification of timeTags and durations is not performed. NO is an appropriate value when you are doing real-time tempo modification with a slider or other control.

Whatever the value of midifilesEvaluateTempo, the first tempo event found in the file is supplied as the MKScore info's MK_tempo parameter. Note that the Music Kit does not currently support evaluating time-varying tempos found in Standard MIDI Files.

The default value of midifilesEvaluateTempo is YES. When so, when writing to a MIDIfile, tempo is factored into the timestamps.

Parameters:
yesOrNo is a BOOL.
Returns:
Returns an id.

+ (BOOL) midifilesEvaluateTempo  

Returns the value of the class variable midifilesEvaluateTempo..

See also:
++ setMidifilesEvaluateTempo:.
Returns:
Returns a BOOL.

+ (NSArray *) midifileExtensions  

Returns the possible file extensions used in writing and reading MIDI files appropriate for the native operating system.

Returns:
Returns an NSArray of NSStrings.

+ (NSArray *) scorefileExtensions  

Returns the possible file extensions used in writing and reading scorefiles files appropriate for the native operating system.

Returns:
Returns an NSArray of NSStrings.

+ (NSArray *) fileExtensions  

Returns the possible file extensions used in writing and reading scorefiles and MIDI files appropriate for the native operating system.

Returns:
Returns an NSArray of NSStrings.

+ (NSArray *) bundleExtensions  

Returns the possible file extensions supported by any available plugins.

It does not make a distinction between extensions supported for reading and those for writing, so query each plugin in turn to see what it supports.

Returns:
Returns an NSArray of NSStrings.

+ (MKScore *) score  

Creates and returns an allocated, initialised and autoreleased MKScore instance.

Returns:
Returns a newly allocated MKScore instance.

+ (MKScoreFormat) scoreFormatOfData: (NSData *)  fileData  

Determines the format of the scorefile data.

Parameters:
fileData An NSData object containing score data, it should be a MIDI file, Scorefile or playscore format.
Returns:
Returns whether the data is a MIDI file (MK_MIDIFILE), Scorefile (MK_SCOREFILE), playscore (MK_PLAYSCORE).

+ (MKScoreFormat) scoreFormatOfFile: (NSString *)  filename  

Determines the format of the named scorefile.

Parameters:
filename The name of the file to be inspected.
Returns:
Returns the format of the files data.

- (id) writeScorefile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

The same as writeScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns the receiver or nil if the file couldn't be written.

- (id) writeScorefileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

The same as writeScorefileStream:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns the receiver or nil if the file couldn't be written.

- (id) readScorefile: (NSString *)  fileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

The same as readScorefile:, but only those MKNotes with timeTags in the specified range are added to the receiver.

Parameters:
fileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns the receiver or nil if the file couldn't be read.

- (id) readScorefileStream: (NSMutableData *)  stream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

The same as readScorefileStream:, but only those MKNotes with timeTags in the specified range are added to the receiver.

Parameters:
stream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns the receiver or nil if the file couldn't be read.

- (id) writeOptimizedScorefile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

The same as writeOptimizedScorefile:, but only those MKNotes with timeTags in the specified range are written to the file.

Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns the receiver or nil if the file couldn't be written.

- (id) readMidifile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

Reads the midifile aFileName into the receiver.

The MKNotes that are created are retained in the receiver only if their timeTags are within the given boundaries.

See also:
-readMidiFileStream: for a discussion of MIDI to MKNote conversion.
Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns an id.

- (id) readMidifileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

Reads the midifile from aStream into the receiver.

Only the MKNote objects that have timeTags within the given boundaries are retained in the receiver.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns an id.

- (id) writeMidifile: (NSString *)  aFileName
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

Writes the receiver's MKNotes, within the given timeTag range, as a midifile named aFileName.

See also:
-- writeMidifile: for conversion details.
Parameters:
aFileName is a NSString instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns an id.

- (id) writeMidifileStream: (NSMutableData *)  aStream
firstTimeTag: (double)  firstTimeTag
lastTimeTag: (double)  lastTimeTag 

Write the receiver, as a midifile, to aStream.

Only the MKNotes within the given timeTag boundaries are written.

Parameters:
aStream is a NSMutableData instance.
firstTimeTag is a double.
lastTimeTag is a double.
Returns:
Returns an id.

- (MKPart *) partTitled: (NSString *)  partTitleToFind  

Returns the MKPart whose info note has an MK_title parameter equal to partTitleToFind, nil if it couldn't be found.

Parameters:
partTitleToFind 
Returns:
Returns the MKPart, nil if it couldn't be found.

- (MKPart *) partNamed: (NSString *)  partNameToFind  

Returns the MKPart named partNameToFind, nil if it couldn't be found.

Parameters:
partNameToFind 
Returns:
Returns the MKPart named partNameToFind, nil if it couldn't be found.


Member Data Documentation

- (NSMutableArray*) parts [protected]

The object's collection of MKParts.

- (NSMutableData*) scorefilePrintStream [protected]

The stream used by scorefile print statements.

- (MKNote*) info [protected]

The object's info MKNote.


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