Behavior is defined by supplying the instance methods:
noteOnSelf:
noteUpdateSelf:
noteOffSelf:
noteEndSelf
These are invoked as follows:
When a noteOn or
noteDur arrives, the noteOn: message is sent. This invokes noteOnSelf:
When a noteUpdate arrives, the
noteUpdate: message is sent.
This invokes noteUpdateSelf:
When a noteOff arrives or the end of the
duration occurs, the noteOff:
message is sent. This invokes noteOffSelf: noteOffSelf: returns the time required to finish, in
seconds. This is ordinarily the time for the amplitude envelope
to finish its release portion.
When the phrase is really finished (the release portion is finished) , the noteEnd message is sent. This invokes noteEndSelf
Like a MKUnitGenerator, a
MKSynthPatch may be in one of three states:
Table 5-4. MKSynthPatch States
MK_idle | Not producing sound. |
MK_running | Running. |
MK_finishing | MKEnvelope release. |
A MKSynthPatch is in the idle state when
it is first created or after it has received
noteEnd
A MKSynthPatch is in the running state
when it has received a noteOn or
noteDur.
A MKSynthPatch is in the finishing state
when it has received a noteOff or its duration
has elapsed.
The only requirement for the behavior of a
MKSynthPatch is that it be left “safe” and
“quiet” when idle.
An easy way to make a MKSynthPatch quiet
is to set its amplitude to 0.