Appendix A. Music Tables

Table of Contents
MusicKit Parameters
Wave Table Synthesis Parameters
Frequency Modulation Parameters
Pluck Parameters
Waveshaping Parameters
MKWaveTable Database
Pitches and Frequencies

MusicKit Parameters

This section lists and describes the parameters that are recognized by the MusicKit MKSynthPatches. The following information is given for each parameter:

Keep in mind that a parameter's print name is used when the parameter is written to a scorefile. In an application, a parameter is known as an integer identifier that's represented as MK_printName. For example, the parameter listed below as amp is identified in an application as MK_amp.

As described in Chapter 4, a constant-valued parameter can be retrieved as any data type, regardless of how it was set. However, the MusicKit MKSynthPatches always retrieve parameter values as specific types. The type by which a particular parameter is retrieved is implied by the value range. For example, a value range of [0.0, 1.0] implies that the parameter value is retrieved as a double; the range [0, 127] means that the type is int.

The parameters are organized according to synthesis technique. Many of the parameters, such as those that affect frequency, are common to more than one synthesis technique. Thus, for completeness, the same parameter description may be given in more than one section.

For further information (or rather, the same info presented in a different style!), see MKSynthPatches Introduction.

Tip

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:

MKUseRealTimeEnvelopes(YES)

before allocating the MKSynthPatch.

Wave Table Synthesis Parameters

There are seven subclasses of MKSynthPatch that implement wave table synthesis. The first four use MKWaveTable objects that you supply, the others have access to the MusicKit MKWaveTable database:

Table A-1. Wave Table Subclasses of MKSynthPatch

MKSynthPatchDescription
Wave1One MKWaveTable
Wave1vOne MKWaveTable with vibrato
Wave1iOne MKWaveTable with frequency interpolation
Wave1viOne MKWaveTable with vibrato and interpolation
DBWave1vOne database MKWaveTable with vibrato
DBWave1viOne database MKWaveTable with vibrato and interpolation
DBWave2viTwo database MKWaveTables with vibrato and interpolation

The wave table synthesis parameters are:

Table A-2. Wave Table Synthesis Parameters

NameValue RangeDescription
amp[0.0, 1.0] or [-∞, 0.0] dBBasic amplitude (but see amp1). The dB (decibel) scaling is obtained through the MKdB() C function; in a scorefile, with the dB postfix operator.
amp0same as ampAmplitude when ampEnv = 0.0.
amp1same as ampAmplitude when ampEnv = 1.0; synonym for amp.
ampAtt[0.0, ∞]ampEnv attack duration in seconds.
ampEnvMKEnvelope objectAmplitude envelope.
ampRel[0.0, ∞]ampEnv release duration in seconds.
bearing[-45.0, 45.0]Stereophonic placement in degrees. 0.0 is center, -45.0 is hard left, and 45.0 is hard right.
controlChange[0,127]If controlChange is 7, then controlVal is MIDI volume. Implemented as an attenuation of amplitude. Default is 127 (no attenuation). If controlChange is 1, then controlVal is MIDI modWheel. Implemented as an attenuation of vibrato. Default is 127 (no attenuation). Some Wave MKSynthPatches also implement MIDI pan and MIDI balance.
controlVal[0,127]See controlChange.
freq[~15.0, ~11000.0] or pitch variableFundamental frequency (but see freq1).
freq0same as freqFrequency when freqEnv = 0.0.
freq1same as freq Frequency when freqEnv = 1.0; synonym for freq.
freqAtt[0.0, ∞] freqEnv attack duration in seconds.
freqEnvMKEnvelope object Frequency envelope.
freqRel[0.0, ∞] freqEnv release duration in seconds.
keyNum[0, 127] or key numberSpecifies pitch as an index into the default TuningSystem, an array of frequencies. Used only in the absence of freq.
phase[-180.0, 180] Initial phase of the first MKWaveTable, in degrees.
pitchbend[0,0x3fff]MIDI pitch bend. Default is no bend
pitchbendSensitivity[0,∞] Number of semitones represented by full pitch bend deviation. Default is 3.
portamento[0.0, ∞]Phrase rearticulation time in seconds. Resets the x value of the second point of all Envelopes.
rvibAmp[0.0, 1.0] Random vibrato amplitude; unused by Fm1 and Fm1i.
svibAmp[0.0, 1.0] Sinusoidal vibrato amplitude; see above.
svibFreq[0.0, ~15.0] Sinusoidal vibrato frequency; see above.
velocity[0,127] MIDI velocity is a scaling on amplitude. 64 produces no modification. Below produces an attenuation. Above produces an amplification.
velocitySensitivity[0.0, 1.0] Scaling on velocity. If velocitySensitivity is 0, velocity has no effect. If it is 1.0, a velocity of 0 produces silence. Default is 0.5.
waveformMKWaveTable object or database stringFirst MKWaveTable (but see waveform1). The database string is used only by database MKSynthPatches.
waveform0same as waveformMKWaveTable when waveformEnv = 0.0. Used by DBWave2vi only.
waveform1same as waveformMKWaveTable when waveformEnv = 1.0; synonym for waveform.
waveformEnvMKEnvelope objectMKEnvelope that pans between the two MKWaveTables. Used by DBWave2vi only.
waveLenpower of 2waveform length (optimal value by default).
vibWaveformMKWaveTable objectSpecifies shape of vibrato.

Frequency Modulation Parameters

There are nine subclasses of MKSynthPatch that perform frequency modulation (FM). The simplest of these are single-modulator instruments. There's also a simple FM that has access to the MusicKit MKWaveTable database for use in the carrier oscillator. The rest of the FM MKSynthPatches use two modulators. All of these classes provide frequency interpolation and vibrato:

Table A-3. FM Subclasses of MKSynthPatch

MKSynthPatchDescription
Fm1Simple (one-modulator) FM
Fm1iSimple FM with frequency interpolation
Fm1vSimple FM with vibrato
Fm1viSimple FM with interpolation and vibrato
DBFm1viSimple FM with interpolation, vibrato, and MKWaveTable database
Fm2cviCascade FM
Fm2cnviCascade FM with random modulation (noise) on the modulators
Fm2pviParallel FM
Fm2pnviParallel FM with noise

The database contents are listed in the Section called MKWaveTable Database.

The parameters recognized by the FM MKSynthPatches are listed below; parameters that are recognized by only a subset of the MKSynthPatches are so noted.

Table A-4. Frequency Modulation Parameters

NameValue RangeDescription
amp[0.0, 1.0] or [-∞, 0.0] dBBasic amplitude (but see amp1). The dB (decibel) scaling is obtained through the MKdB() C function; in a scorefile, with the dB postfix operator.
amp0same as amp Amplitude when ampEnv = 0.0.
amp1same as amp Amplitude when ampEnv = 1.0; synonym for amp.
ampAtt[0.0, ∞] ampEnv attack duration in seconds.
ampEnvMKEnvelope object Amplitude envelope.
ampRel[0.0, ∞] ampEnv release duration in seconds.
bearing[-45.0, 45.0] Stereophonic placement in degrees. 0.0 is center, -45.0 is hard left, and 45.0 is hard right.
bright[0.0, 1.0] Modulation index scaler (defaults to 1.0).
controlChange[0,127] If controlChange is 7, then controlVal is MIDI volume. Implemented as an attenuation of amplitude. Default is 127 (no attenuation). If controlChange is 1, then controlVal is MIDI modWheel. Implemented as an attenuation of vibrato. Default is 127 (no attenuation). Some FM MKSynthPatches also implement MIDI pan and MIDI balance.
controlVal[0,127] See controlChange.
cRatio[0.0, ~10.0] Carrier frequency as a ratio of the fundamental.
c1Ratiosame as cRatio Synonym for cRatio.
freq[~15.0, ~11000.0] or pitch variableFundamental frequency (but see freq1).
freq0same as freq Frequency when freqEnv = 0.0.
freq1same as freq Frequency when freqEnv = 1.0; synonym for freq.
freqAtt[0.0, ∞] freqEnv attack duration in seconds.
freqEnvMKEnvelope object Frequency envelope.
freqRel[0.0, ∞] freqEnv release duration in seconds.
keyNum[0, 127] or key numberSpecifies pitch as an index into the default TuningSystem, an array of frequencies. Used only in the absence of freq.
m1Ind[0.0, ~10.0] Index of modulator 1 (but see m1Ind1).
m1Ind0same as m1Ind Index of modulator 1 when m1IndEnv = 0.0.
m1Ind1same as m1Ind Index of modulator 1 when m1IndEnv = 1.0; synonym for m1Ind.
m1IndAtt[0.0, ∞]m1IndEnv attack duration in seconds.
m1IndEnvMKEnvelope object Index Envelope for modulator 1.
m1IndRel[0.0, ∞] m1IndEnv release duration in seconds.
m1Phase[-180.0, 180] Initial phase of modulator 1.
m1Ratio[0.0, ~10.0] Modulator 1 frequency as a ratio of the fundamental.
m1WaveformMKWaveTable object Waveform of modulator 1.
m2Ind through m2WaveformSame as the similarly named parameters above, applied to modulator 2.Used by the two-modulator MKSynthPatches only (Fm2cvi, Fm2cnvi, Fm2pvi, and Fm2pnvi).
noiseAmp[0.0, 1.0]Amplitude of noise. This parameter and the following noise parameters are used by Fm2cnvi and Fm2pnvi only.
noiseAmp0same as noiseAmpAmplitude of noise when noiseAmpEnv = 0.0.
noiseAmp1same as noiseAmp Amplitude of noise when noiseAmpEnv = 1.0 ; synonym for noiseAmp.
noiseAmpAtt[0.0, ∞] noiseAmpEnv attack duration in seconds.
noiseAmpEnvMKEnvelope object Noise amplitude Envelope.
noiseAmpRel[0.0, ∞] noiseAmpEnv release duration in seconds.
phase[-180.0, 180] Initial phase of the carrier, in degrees.
pitchbend[0,0x3fff] MIDI pitch bend. Default is no bend
pitchbendSensitivity[0,∞] Number of semitones represented by full pitch bend deviation. Default is 3.
portamento[0.0, ∞] Phrase rearticulation time in seconds. Resets the x value of the second point of all Envelopes.
rvibAmp[0.0, 1.0] Random vibrato amplitude; unused by Fm1 and Fm1i.
svibAmp[0.0, 1.0]Sinusoidal vibrato amplitude; see above.
svibFreq[0.0, ~15.0] Sinusoidal vibrato frequency; see above.
waveformMKWaveTable object or database stringWaveform of the carrier (sine wave by default). The database string is used only by DBFm1vi.
waveLenPower of 2 waveform length (optimal value by default).
velocity[0,127]MIDI velocity is a scaling on amplitude. 64 produces no modification. Below produces an attenuation. Above produces an amplification.
velocitySensitivity[0.0, 1.0] Scaling on velocity. If velocitySensitivity is 0, velocity has no effect. If it is 1.0, a velocity of 0 produces silence. Default is 0.5.
vibWaveformMKWaveTable object Specifies shape of vibrato.

Pluck Parameters

There's only one Pluck. An example of physical modeling synthesis, Pluck derives much of its characteristic sound naturally, without requiring much attention. As such, it recognizes fewer parameters than the other MKSynthPatches:

Table A-5. Pluck Parameters

NameValue RangeDescription
amp[0.0, 1.0] or [-∞, 0.0] dBBasic amplitude (but see amp1). The dB (decibel) scaling is obtained through the MKdB() C function; in a scorefile, with the dB postfix operator.
ampRel[0.0, ∞]noteOff release time in seconds (to -60 dB).
bright[0.0, 1.0]Dynamic level (a timbral parameter). 1.0 is the sharpest (brightest).
bearing[-45.0, 45.0]Stereophonic placement in degrees. 0.0 is center, -45.0 is hard left, and 45.0 is hard right.
controlChange[0,127]If controlChange is 7, then controlVal is MIDI volume. Implemented as an attenuation of amplitude. Default is 127 (no attenuation).
controlVal[0,127]See controlChange.
decay[0.0, ∞]Initial decay in seconds (to -60 dB). 0.0 means no decay.
freq[~15.0, ~1300 or ~2600, depending on sampling rate]Fundamental frequency or pitch variable NOTE LOW UPPER LIMIT! ALSO NOTE THAT VERY LOW FREQUENCIES MAY CAUSE YOU TO RUN OUT OF DSP MEMORY!
keyNum[0, 127] or key numberSpecifies pitch as an index into the default TuningSystem, an array of frequencies. Used only in the absence of freq.
lowestFreqsame as freq Lowest frequency among subsequent noteUpdates.
pickNoise[0.0, ~0.06]Duration of initial noise burst in seconds.
pitchbend[0,0x3fff]MIDI pitch bend. Default is no bend
pitchbendSensitivity[0,∞] Number of semitones represented by full pitch bend deviation. Default is 3.
sustain[0.0, 1.0] Level of sustain.
velocity[0,127]MIDI velocity is a scaling on amplitude. 64 produces no modification. Below produces an attenuation. Above produces an amplification.
velocitySensitivity[0.0, 1.0]Scaling on velocity. If velocitySensitivity is 0, velocity has no effect. If it is 1.0, a velocity of 0 produces silence. Default is 0.5.