MKUnitGenerators MKUnitGenerator is abstract. It is an
Objective-C class that represents a DSP module.
The MusicKit supplies a library of
MKUnitGenerator subclases. Each has the
letters UG in its name. The library is sufficient for most common
uses.
To be fast, the DSP uses parallel memory spaces X, Y, P. To get the most possible voices in real time, it is necessary to concern ourselves with memory spaces. The MusicKit has the best benchmarks for 56001 usage we have seen.
Each MKUnitGenerator has some number of
inputs and outputs. For each configuration, a
MKUnitGenerator subclass exists. Example:
OnepoleUG ("master class") has 1
input and 1 output. Therefore, it has 4 subclasses ("leaf
classes"):
OnepoleUGxx,
OnepoleUGxy,
OnepoleUGyx,
OnepoleUGyy
OnepoleUGxy writes its output to X
memory and reads its input from Y memory. For starters, you
can just use all x memory and worry about optimization
later.
When creating your own MKUnitGenerator,
you only have to write the DSP code and run the
command-line program dspwrap,
which automatically writes all the classes for you. You
never have to edit the leaf classes. You may
optionally edit the master class.