MKSynthPatch
SubclassesThe MusicKit provides a number of
MKSynthPatch
subclasses, instances of which you
can use in your application. MKSynthPatch
objects are “data-driven”; during a performance, they're
sent MKNote
objects (through methods described
in the next section) from which they pluck the parameters of interest.
Thus, in order to use a MKSynthPatch
, you must
know not only what sort of synthesis/processing it embodies, but which
parameters it expects to see in the MKNote
s it
receives. A table of the MusicKit parameters organized by
MKSynthPatch
synthesis/processing technique is
given in Appendix A. Below, some of the MusicKit
MKSynthPatch
subclasses are listed and briefly
described. For a complete list, see <MusicKit/synthpatches/synthpatches.h>.
When doing synthesis in a realtime interactive context,
such as when playing it from a MIDI keyboard, you should invoke
[orchestra setTimed:NO] and call
|
Pluck
Pluck
employs physical modelling to
synthesize the sound of a plucked string, using a technique developed
by Alex Strong, Kevin Karplus, David Jaffe and Julius Smith. The
real-world mechanics of a plectrum plucking a string are replaced on
the DSP by a burst of noise filling a length of
delay memory. The delay memory is looped and filtered, causing the
initial noise burst to gradually become more harmonic as the spectral
energy subsides towards the fundamental, emulating the strike-and-fade
characteristics of a real plucked string.
Wavetable synthesis is a technique in which a length of memory is filled with one or more periods of a waveform; the memory is then looped during playback to produce a continuous signal. While wavetable synthesis is extremely easy to use―no messy formulas are needed to create a musical timbre―it's somewhat limited to the extent that you don't have control over the individual elements that create the timbre (which you do with techniques such as frequency modulation).
The MusicKit's wavetable synthesis
MKSynthPatch
es use single-period wavetables;
they are:
Table 5-2. MKSynthPatch
Descriptions
MKSynthPatch | Description |
---|---|
Wave1 | One wavetable |
Wave1v | One wavetable with vibrato |
Wave1i | One wavetable with frequency interpolation |
Wave1vi | One wavetable with vibrato and interpolation |
DBWave1v | One database wavetable with vibrato |
DBWave1vi | One database wavetable with vibrato and interpolation |
DBWave2vi | Two database wavetables with vibrato and interpolation |
The database wavetable MKSynthPatch
es
access the MusicKit's MKWaveTable
Database, a
library of predefined timbres. These are listed in Appendix A.
In frequency modulation (FM) synthesis, the output of one oscillator controls the frequency of another oscillator. If the frequency of the controlling oscillator (or “modulator”) is subaudio, the tone produced by the controlled oscillator (or “carrier”) will exhibit vibrato. However, as the modulator's frequency is increased, the carrier's vibrato also increases until the individual undulation become indistinguishable and sidebands, or reflections of the modulator's frequency around the carrier's frequency, appear. If the oscillators are producing sine waves with identical or harmonically-related frequencies, the sidebands produce a harmonic series. As the oscillators' waveforms become more complex, the sidebands become more numerous, but they may still produce a harmonic series. However, if the oscillators' frequencies aren't harmonically related, the result can be a clangorous mess (which is good if you're trying to make bell sounds, one of the more popular and occasionally unavoidable results of FM synthesis).
Table 5-3. FM MKSynthPatch
Descriptions
MKSynthPatch | Description |
---|---|
Fm1 | Simple (one-modulator) FM |
Fm1i | Simple FM with frequency interpolation |
Fm1v | Simple FM with vibrato |
Fm1vi | Simple FM with interpolation and vibrato |
Fm2cvi | Cascade FM |
Fm2cnvi | Cascade FM with random modulation (noise) on the modulators |
Fm2pvi | Parallel FM |
Fm2pnvi | Parallel FM with noise |
There are two waveshaping MKSynthPatch
es,
Shape
and Shapev
. They
differ in that the vibrato parameters are supported only by
Shapev
.
These MKSynthPatch
es implement non-linear
distortion synthesis, which means that they produce sound by using an
oscillator to drive a lookup table. Normally, the oscillator is a
sine wave and the complexity of the resulting waveform is a function
of the lookup table. However, for added flexibility, you may set the
oscillator waveform to anything you want.