Making Your Own MKSynthPatch Class

A MKSynthPatch subclass consists of three fundamental parts:

  1. A specification of a collection of MKUnitGenerators Classes instances of which comprise each MKSynthPatch instance. This is done using an auxiliary object called a “MKPatchTemplate.” A single MKSynthPatch class may supply various MKPatchTemplates representing various “flavors” of the MKSynthPatch. For example, there may be an additive synthesis MKSynthPatch with an 8-oscillator flavor and a 16-oscillator flavor. This is done by supplying the class method:

    + patchTemplateFor: 	
    	  
  2. A description of the interconnections of the MKUnitGenerator instances. This may be done in the MKPatchTemplate or in the MKSynthPatch init instance method.

  3. A description of the behavior of the MKSynthPatch when sent notes. This is done by supplying the instance methods:

    noteOnSelf:

    noteOffSelf:

    noteUpdateSelf:

    noteEnd

Figure 5-1. A Simple Synth Patch