#import <DBWave1vi.h>
DBWave1vi is like Wave1vi, but it includes support for the Music Kit Timbre Data Base. DBWave1v is like DBWave1vi, but it uses a non-interpolating-oscillator (lower quality, but uses less DSP computation.) The Timbre Data Base is a set of spectra derived from recordings of musical instruments and voices in various ranges. The Data Base was created by Michael McNabb.
The MKSynthPatches that support the Data Base are DBWave1vi, DBWave2vi, and DBFm1vi. ("DB" stands for "Data Base".) Note that the use of the Data Base is strictly optional in these instruments. For example, if the Data Base is not used, DBWave1vi acts just like Wave1vi. That is, the waveform parameter may be passed either an ordinary MKWaveTable (as in Wave1vi) or a timbre string (as defined below).
To use the Data Base, you specify a timbre as a string (such as "SA", including the quotation marks) to the MKSynthPatch's waveform parameter. MKSynthPatches with multiple waveform parameters accept multiple timbre strings. Each timbre string represents a group of MKWaveTables, one for approximately every whole step in the normal range of the voice or instrument. The MKSynthPatch selects the MKWaveTable appropriate to the frequency. By default, the MKWaveTable selection is based on the parameter freq1 (synonym for freq, or MIDI keynum). By prefixing a timbre string with the zero character, e.g., "0SA", the timbre will be selected based on the freq0 parameter instead.
The various timbre groups have different numbers of MKWaveTables, as given in the chart below. Internally, the MKWaveTables for a particular timbre group are numbered sequentially, with 1 corresponding to the MKWaveTable for the bottom of the range of that timbre. Specific MKWaveTables in a timbre group can be requested by adding a numeric suffix. In this manner, the automatic selection based on frequencycan be overridden. For example, the timbre group "BA" (bass voice singing "AH") consists of 15 timbres. The timbre string "BA12" requests the 12th MKWaveTable, independent of the frequency.
Some of the timbres are actually recordings of the attack of an instrument. These are best used with the MKSynthPatch DBWave2vi, which can interpolate between timbres. Note also that for realism, appropriate envelopes, attack/decay values and vibrato must be used.
When using this MKSynthPatch in an interactive real-time context, such as playing from a MIDI keyboard, call MKUseRealTimeEnvelopes() before allocating the MKSynthPatch.
In addition to the parameters described in Wave1vi.rtfd, the following parameters are supported:
balanceSensitivity - In the range 0.0:1.0. Default is 1.0.
controlChange - MIDI balance (controller 8) interpolates between two timbres, waveform0 and waveform1. When the companion parameter, controlVal is 0 the result is waveform0. When controlVal is 127 (the default), the result is waveform1. Values between produce a linearly-interpolated timbre. Setting the balanceSensitivity parameter to less than 1.0 reduces the maximum proportion of waveform1. Since any change in balance in this SynthPatch results in a new wavetable being sent to the DSP, there are limitations as to how quickly and smoothly it can be done. Frequent changes may disturb timing. Setting wavelen to 128 or 64 helps. If you are doing a great deal of wave table interpolation, you should use DBWave2vi.
MIDI pan (controller 10) has the same effect as bearing. If the panSensitivity is 1.0, a MIDI pan value of 0 is full left and 127 is full right. If the value of panSensitivity is less than 1.0, the pan range is narrowed toward the center. The value is set by the companion parameter, controlVal.
controlVal - See controlChange.
panSensitivity - In the range 0.0:1.0. Default is 1.0.
waveform0 - Waveform when balance is 0. Default is a sine wave.
waveform1 - Waveform when balance is 1. Default is a sine wave. waveform1 is a synonym for waveform.