MusicKit
0.0.0
|
MKNoteReceiver is an auxilliary class that completes the implementation of MKInstrument. More...
#import <MKNoteReceiver.h>
MKNoteReceiver is an auxilliary class that completes the implementation of MKInstrument.
MKNoteReceiver is an auxilliary class that completes the implementation of MKInstrument. Instances of MKNoteReceiver are owned by MKInstrument objects to provide the following:
It's part of the link between a MKPerformer and an MKInstrument. MKNoteReceiver's connect: method connects a MKNoteReceiver to a MKNoteSender, which is owned by a MKPerformer in much the same way that a MKNoteReceiver is owned by an MKInstrument. By connecting a MKNoteReceiver to a MKNoteSender, their respective owners are said to be connected. MKNoteSender defines an equivalent connect: method - it doesn't matter which of the two objects is the receiver and which is the argument when sending a connect: message.
Unlike MKNoteSenders, which are generally expected to be created by the MKPerformers that own them, MKNoteReceivers can be created either by their owners or by your application. For example, each MKSynthInstrument object creates and adds to itself a single MKNoteReceiver. MKScorefileWriter objects, on the other hand, don't create any MKNoteReceivers; it's left to your application to create and add them. A MKNoteReceiver is created through the new class method and added to an MKInstrument through the latter's addNoteReceiver:.
A MKNoteReceiver can be owned by only one MKInstrument at a time; however, it can be connected to any number of MKNoteSenders. In addition, two different MKNoteReceivers can be connected to the same MKNoteSender. Thus the connections between MKPerformers and MKInstruments can describe an arbitrarily complicated network. To retrieve the MKNoteReceivers that are owned by a particular MKInstrument you invoke the MKInstrument's noteReceiver or noteReceivers method.
MKNoteReceivers are also created, owned, and used by MKMidi objects as part of their assumption of the role of MKInstrument.