^ programmer's guide | std libraries | std uana

ChucK Synthesis Toolkit (STK)

instruments | fm synths | envelopes
delay | reverbs | components
file i/o

stk - instruments


StkInstrument

StkInstrument Base class for STK instruments.

StkInstrument.functions Description
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)
void controlChange(int number, float value) assert control change - numbers are instrument specific, value range: [0.0 - 128.0]

BandedWG

BandedWG Banded waveguide modeling class. This class uses banded waveguide techniques to model a variety of sounds, including bowed bars, glasses, and bowls. For more information, see Essl, G. and Cook, P. "Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference.

Control Change Numbers:

by Georg Essl, 1999 - 2002. Modified for Stk 4.0 by Gary Scavone.

BandedWG.functions Description
float bowPressure(), bowPressure(float) get/set bow pressure [0.0 - 1.0]
float bowMotion(), bowMotion(float) get/set bow motion [0.0 - 1.0]
float bowRate(), bowRate(float) get/set bow attack rate (sec)
float strikePosition(), strikePosition(float) get/set strike position [0.0 - 1.0]
float vibratoFreq(), vibratoFreq(float) get/set vibrato frequency
float modesGain(), modesGain(float) get/set amplitude for modes [0.0 - 1.0]
int preset(), preset(int) get/set instrument presets (0 - 3, see above)
void pluck(float) set pluck instrument [0.0 - 1.0]
void startBowing(float) set start bowing [0.0 - 1.0]
void stopBowing(float) set stop bowing [0.0 - 1.0]
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)
void controlChange(int number, float value) assert control change - numbers are instrument specific, value range: [0.0 - 128.0]

see band-o-matics.ck bandedwg.ck bandedwg2.ck

BlowBotl

BlowBotl STK blown bottle instrument class. This class implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook).

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

BlowBotl.functions Description
float noiseGain(), noiseGain(float) get/set noise component gain [0.0 - 1.0]
float vibratoFreq(), vibratoFreq(float) get/set vibrato frequency (Hz)
float vibratoGain(), vibratoGain(float) get/set vibrato gain [0.0 - 1.0]
float volume(), volume(float) get/set yet another volume knob [0.0 - 1.0]
float rate(), rate(float) get/set rate of attack (sec)
void startBlowing(float) set start blowing [0.0 - 1.0]
void stopBlowing(float) set stop blowing [0.0 - 1.0]
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)
void controlChange(int number, float value) assert control change - numbers are instrument specific, value range: [0.0 - 128.0]

BlowHole

BlowHole STK blowhole physical model with one register hole and one tonehole.

This class is based on the clarinet model, with the addition of a two-port register hole and a three-port dynamic tonehole implementation, as discussed by Scavone and Cook (1998).

In this implementation, the distances between the reed/register hole and tonehole/bell are fixed. As a result, both the tonehole and register hole will have variable influence on the playing frequency, which is dependent on the length of the air column.
In addition, the highest playing freqeuency is limited by these fixed lengths. This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

BlowHole.functions Description
float reed(), reed(float) get/set reed stiffness [0.0 - 1.0]
float noiseGain(), noiseGain(float) get/set noise component gain [0.0 - 1.0]
float tonehole(), tonehole(float) get/set tonehole size [0.0 - 1.0]
float vent(), vent(float) get/set vent frequency [0.0 - 1.0]
float pressure(), pressure(float) get/set pressure [0.0 - 1.0]
void startBlowing(float) set start blowing [0.0 - 1.0]
void stopBlowing(float) set stop blowing [0.0 - 1.0]
float rate(), rate(float) get/set rate of attack (sec)
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)
void controlChange(int number, float value) assert control change - numbers are instrument specific, value range: [0.0 - 128.0]

Bowed

Bowed STK bowed string instrument class. This class implements a bowed string model, a la Smith (1986), after McIntyre, Schumacher, Woodhouse (1983).

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Bowed.functions Description
float bowPressure(), bowPressure(float) get/set bow pressure [0.0 - 1.0]
float bowPosition(), bowPosition(float) get/set bow position [0.0 - 1.0]
float vibratoFreq(), vibratoFreq(float) get/set vibrato frequency (Hz)
float vibratoGain(), vibratoGain(float) get/set vibrato gain [0.0 - 1.0]
float volume(), volume(float) get/set volume [0.0 - 1.0]
void startBowing(float) set start bowing [0.0 - 1.0]
void stopBowing(float) set stop bowing [0.0 - 1.0]
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)

Brass

Brass STK simple brass instrument class. This class implements a simple brass instrument waveguide model, a la Cook (TBone, HosePlayer).

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Brass Description
float lip(), lip(float) get/set lip tension [0.0 - 1.0]
float slide(), slide(float) get/set slide length [0.0 - 1.0]
float vibratoFreq(), vibratoFreq(float) get/set vibrato frequency (Hz)
float vibratoGain(), vibratoGain(float) get/set vibrato gain [0.0 - 1.0]
float volume(), volume(float) get/set volume [0.0 - 1.0]
void clear(float) clear instrument
void startBlowing(float) start blowing [0.0 - 1.0]
void stopBlowing(float) stop blowing [0.0 - 1.0]
float rate(), rate(float) get/set rate of attack (sec)
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)

Clarinet

Clarinet STK clarinet physical model class. This class implements a simple clarinet physical model, as discussed by Smith (1986), McIntyre, Schumacher, Woodhouse (1983), and others.

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Clarinet.functions Description
float reed(), reed(float) reed stiffness [0.0 - 1.0]
float noiseGain(), noiseGain(float) noise component gain [0.0 - 1.0]
void clear() clear instrument
float vibratoFreq(), vibratoFreq(float) vibrato frequency (Hz)
float vibratoGain(), vibratoGain(float) vibrato gain [0.0 - 1.0]
float pressure(), pressure(float) pressure/volume [0.0 - 1.0]
void startBlowing(float) start blowing [0.0 - 1.0]
void stopBlowing(float) stop blowing [0.0 - 1.0]
float rate(), rate(float) rate of attack (sec)
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)

Flute

Flute STK flute physical model class. This class implements a simple flute physical model, as discussed by Karjalainen, Smith, Waryznyk, etc. The jet model uses a polynomial, a la Cook.

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Flute.functions Description
float jetDelay(), jetDelay(float) get/set jet delay […]
float jetReflection(), jetReflection(float) get/set jet reflection […]
float endReflection(), endReflection(float) get/set end delay […]
float noiseGain(), noiseGain(float) get/set noise component gain [0.0 - 1.0]
float vibratoFreq(), vibratoFreq(float) get/set vibrato frequency (Hz)
float vibratoGain(), vibratoGain(float) get/set vibrato gain [0.0 - 1.0]
float pressure (float, R+W) get/set pressure/volume [0.0 - 1.0]
void clear() clear instrument
float startBlowing(float) start blowing [0.0 - 1.0]
float stopBlowing(float) stop blowing [0.0 - 1.0]
float rate(float) rate of attack (sec)
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)

Mandolin

Mandolin STK mandolin instrument model class. This class inherits from PluckTwo and uses "commuted synthesis" techniques to model a mandolin instrument.

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others. Commuted Synthesis, in particular, is covered by patents, granted, pending, and/or applied-for. All are assigned to the Board of Trustees, Stanford University. For information, contact the Office of Technology Licensing, Stanford University.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Mandolin.functions Description
float bodySize(), bodySize(float) body size (percentage)
float pluckPos(), pluckPos(float) pluck position [0.0 - 1.0]
float stringDamping(), stringDamping(float) string damping [0.0 - 1.0]
float stringDetune(), stringDetune(float) detuning of string pair [0.0 - 1.0]
void afterTouch(float) aftertouch (currently unsupported)
void pluck(float) pluck instrument [0.0 - 1.0]
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)

see mand-o-matic.ck

ModalBar

ModalBar STK resonant bar instrument class. This class implements a number of different struck bar instruments. It inherits from the Modal class.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

ModalBar.functions Descriptions
float stickHardness(), stickHardness(float) get/set stick hardness [0.0 - 1.0]
float strikePosition(), strikePosition(float) get/set strike position [0.0 - 1.0]
float vibratoFreq(), vibratoFreq(float) get/set vibrato frequency (Hz)
float vibratoGain(), vibratoGain(float) get/set vibrato gain [0.0 - 1.0]
float directGain(), directGain(float) get/set direct gain [0.0 - 1.0]
float masterGain(), masterGain(float) get/set master gain [0.0 - 1.0]
float volume(), volume(float) get/set volume [0.0 - 1.0]
int preset(), preset(int) get/set preset (see above)
void strike(float) strike bar [0.0 - 1.0]
void damp(float) damp bar [0.0 - 1.0]
void clear() reset [none]
int mode(), mode(int)
float modeRatio(), modeRatio(float) get/set selected mode ratio […]
float modeRadius(), modeRadius(float) get/set selected mode radius [0.0 - 1.0]
float modeGain(), modeGain(float) get/set selected mode gain [0.0 - 1.0]
inherited from StkInstrument:
void noteOn(float velocity) trigger note on
void noteOff(float velocity) trigger note off
float freq(), freq(float v) set/get frequency (Hz)

see mod-o-matic.ck

Moog

Moog STK moog-like swept filter sampling synthesis class.

This instrument uses one attack wave, one looped wave, and an ADSR envelope (inherited from the Sampler class) and adds two sweepable formant (FormSwep) filters.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Moog.functions Description
.filterQ (float, R+W) filter Q value [0.0 - 1.0]
.filterSweepRate (float, R+W) filter sweep rate [0.0 - 1.0]
.vibratoFreq (float, R+W) vibrato frequency (Hz)
.vibratoGain (float, R+W) vibrato gain [0.0 - 1.0]
.afterTouch (float, WRITE only) aftertouch [0.0 - 1.0]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change
see moogie.ck

Saxofony

Saxofony STK faux conical bore reed instrument class. This class implements a "hybrid" digital waveguide instrument that can generate a variety of wind-like sounds. It has also been referred to as the "blowed string" model. The waveguide section is essentially that of a string, with one rigid and one lossy termination. The non-linear function is a reed table.
The string can be "blown" at any point between the terminations, though just as with strings, it is impossible to excite the system at either end. If the excitation is placed at the string mid-point, the sound is that of a clarinet. At points closer to the "bridge", the sound is closer to that of a saxophone.
See Scavone (2002) for more details.

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Saxofony.functions Description
.stiffness (float, R+W) reed stiffness [0.0 - 1.0]
.aperture (float, R+W) reed aperture [0.0 - 1.0]
.pressure (float, R+W) pressure/volume [0.0 - 1.0]
.vibratoFreq (float, R+W) vibrato frequency (Hz)
.vibratoGain (float, R+W) vibrato gain [0.0 - 1.0]
.noiseGain (float, R+W) noise component gain [0.0 - 1.0]
.blowPosition (float, R+W) lip stiffness [0.0 - 1.0]
.clear ( ) clear instrument
.startBlowing (float, WRITE only) start blowing [0.0 - 1.0]
.stopBlowing (float, WRITE only) stop blowing [0.0 - 1.0]
.rate (float, R+W) rate of attack (sec)
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

Shakers

Shakers PhISEM and PhOLIES class. PhISEM (Physically Informed Stochastic Event Modeling) is an algorithmic approach for simulating collisions of multiple independent sound producing objects. This class is a meta-model that can simulate a Maraca, Sekere, Cabasa, Bamboo Wind Chimes, Water Drops, Tambourine, Sleighbells, and a Guiro.

PhOLIES (Physically-Oriented Library of Imitated Environmental Sounds) is a similar approach for the synthesis of environmental sounds.
This class implements simulations of breaking sticks, crunchy snow (or not), a wrench, sandpaper, and more.

Control Change Numbers:

by Perry R. Cook, 1996 - 1999.

Shakers.functions Description
.preset (int, R+W) select instrument (0 - 22; see above)
.energy (float, R+W) shake energy [0.0 - 1.0]
.decay (float, R+W) system decay [0.0 - 1.0]
.objects (float, R+W) number of objects [0.0 - 128.0]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

see shake-o-matic.ck

Sitar

Sitar STK sitar string model class. This class implements a sitar plucked string physical model based on the Karplus-Strong algorithm.

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others. There exist at least two patents, assigned to Stanford, bearing the names of Karplus and/or Strong.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Sitar.functions Description
.pluck (float, WRITE only) pluck string [0.0 - 1.0]
.clear ( ) reset
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

StifKarp

StifKarp STK plucked stiff string instrument. This class implements a simple plucked string algorithm (Karplus Strong) with enhancements (Jaffe-Smith, Smith, and others), including string stiffness and pluck position controls. The stiffness is modeled with allpass filters.

This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.

Control Change Numbers:

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

StifKarp Description
.pickupPosition (float, R+W) pickup position [0.0 - 1.0]
.sustain (float, R+W) string sustain [0.0 - 1.0]
.stretch (float, R+W) string stretch [0.0 - 1.0]
.pluck (float, WRITE only) pluck string [0.0 - 1.0]
.baseLoopGain (float, R+W) ?? [0.0 - 1.0]
.clear ( ) reset instrument
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

see stifkarp.ck

VoicForm

VoicForm Four formant synthesis instrument. This instrument contains an excitation singing wavetable (looping wave with random and periodic vibrato, smoothing on frequency, etc.), excitation noise, and four sweepable complex resonances.

Measured formant data is included, and enough data is there to support either parallel or cascade synthesis. In the floating point case cascade synthesis is the most natural so that's what you'll find here.

Control Change Numbers:

Phoneme Names:

"eee" "ihh" "ehh" "aaa"
"ahh" "aww" "ohh" "uhh"
"uuu" "ooo" "rrr" "lll"
"mmm" "nnn" "nng" "ngg"
"fff" "sss" "thh" "shh"
"xxx" "hee" "hoo" "hah"
"bbb" "ddd" "jjj" "ggg"
"vvv" "zzz" "thz" "zhh"

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

VoicForm Description
.phoneme (string, R+W) select phoneme (see above )
.phonemeNum (int, R+W) select phoneme by number [0.0 - 128.0]
.speak (float, WRITE only) start singing [0.0 - 1.0]
.quiet (float, WRITE only) stop singing [0.0 - 1.0]
.voiced (float, R+W) set mix for voiced component [0.0 - 1.0]
.unVoiced (float, R+W) set mix for unvoiced component [0.0 - 1.0]
.pitchSweepRate (float, R+W) pitch sweep [0.0 - 1.0]
.voiceMix (float, R+W) voiced/unvoiced mix [0.0 - 1.0]
.vibratoFreq (float, R+W) vibrato frequency (Hz)
.vibratoGain (float, R+W) vibrato gain [0.0 - 1.0]
.loudness (float, R+W) 'loudness' of voice [0.0 - 1.0]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

see voic-o-form.ck

stk - fm synths


FM

FM STK abstract FM synthesis base class. This class controls an arbitrary number of waves and envelopes, determined via a constructor argument.

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

FM.functions Description
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

BeeThree

BeeThree STK Hammond-oid organ FM synthesis instrument.

This class implements a simple 4 operator topology, also referred to as algorithm 8 of the TX81Z.

Algorithm 8 is :

1 --.
2 -\|
    +-> Out
3 -/|
4 --

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

BeeThree.functions Description
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

FMVoices

FMVoices STK singing FM synthesis instrument.

This class implements 3 carriers and a common modulator, also referred to as algorithm 6 of the TX81Z.

Algorithm 6 is :

    /->1 -\
 4-|-->2 - +-> Out
    \->3 -/

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

FMVoices.functions Description
.vowel (float, WRITE only) select vowel [0.0 - 1.0]
.spectralTilt (float, WRITE only) spectral tilt [0.0 - 1.0]
.adsrTarget (float, WRITE only) adsr targets [0.0 - 1.0]
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

FrencHrn

FrencHrn STK-style French Horn FM synthesis instrument

This class implements 3 cascade operators and a 4th modulator with feedback modulation, also referred to as algorithm 2 of the TX81Z.

Algorithm 2 is

4--\
3---+-->>2-->1-->Out

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.";

HevyMetl

HevyMetl STK heavy metal FM synthesis instrument.

This class implements 3 cascade operators with feedback modulation, also referred to as algorithm 3 of the TX81Z.

Algorithm 3 is :

    4--\
3-->2-- + -->1-->Out

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

HevyMetl.functions Description
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

HnkyTonk

HnkyTonk is STK-style Honkey Tonk Piano FM synthesis instrument.

This class implements 4 cascade operators with feedback modulation, also referred to as algorithm 1 of the TX81Z.

Algorithm 1 is :

4-->3-->2-->1-->Out

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

KrstlChr

KrstlChr STK-style "Crystal Choir" FM synthesis instrument.

This class implements 3 parallel operators with being modulated (feedback modulation), also referred to as algorithm 7 of the TX81Z.

Algorithm 7 is :

1 - \
2 -- +-> Out
4-->3 -/ 

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.";

PercFlut

PercFlut STK percussive flute FM synthesis instrument.

This class implements algorithm 4 of the TX81Z.

Algorithm 4 is

4->3--\
   2-- + -->1-->Out

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

PercFlut Description
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

Rhodey

Rhodey STK Fender Rhodes-like electric piano FM

This class implements two simple FM Pairs summed together, also referred to as algorithm 5 of the TX81Z.

Algorithm 5 is :

4->3--\
       + --> Out
2->1--/

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Rhodey Description
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

see rhodey.ck

TubeBell

TubeBell STK tubular bell (orchestral chime) FM.

TubeBell.functions Description
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

This class implements two simple FM Pairs summed together, also referred to as algorithm 5 of the TX81Z.

Algorithm 5 is :

4->3--\
       + --> Out
2->1--/

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Wurley

Wurley STK Wurlitzer electric piano FM.

This class implements two simple FM Pairs summed together, also referred to as algorithm 5 of the TX81Z.

Algorithm 5 is

4->3--\
       + --> Out
2->1--/

Control Change Numbers:

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Wurley.functions Description
inherited from FM:
.lfoSpeed (float, R+W) modulation Speed (Hz)
.lfoDepth (float, R+W) modulation Depth [0.0 - 1.0]
.afterTouch (float, R+W) aftertouch [0.0 - 1.0]
.controlOne (float, R+W) control one [instrument specific]
.controlTwo (float, R+W) control two [instrument specific]
inherited from StkInstrument:
.noteOn (float velocity) trigger note on
.noteOff (float velocity) trigger note off
.freq (float frequency) set/get frequency (Hz)
.controlChange (int number, float value) assert control change

see wurley.ck

stk - delay


Delay

Delay STK non-interpolating delay line class.

This protected Filter subclass implements a non-interpolating digital delay-line. A fixed maximum length of 4095 and a delay of zero is set using the default constructor. Alternatively, the delay and maximum length can be set during instantiation with an overloaded constructor.

A non-interpolating delay line is typically used in fixed delay-length applications, such as for reverberation.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Delay.functions Description
.delay (dur, R+W) length of delay
.max (dur, R+W) max delay (buffer size)

see comb.ck

DelayA

DelayA STK allpass interpolating delay line class.

This Delay subclass implements a fractional- length digital delay-line using a first-order allpass filter. A fixed maximum length of 4095 and a delay of 0.5 is set using the default constructor. Alternatively, the delay and maximum length can be set during instantiation with an overloaded constructor.

An allpass filter has unity magnitude gain but variable phase delay properties, making it useful in achieving fractional delays without affecting a signal's frequency magnitude response. In order to achieve a maximally flat phase delay response, the minimum delay possible in this implementation is limited to a value of 0.5.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

DelayA.functions Description
.delay (dur, R+W) length of delay
.max (dur, R+W) max delay ( buffer size )

DelayL

DelayL STK linear interpolating delay line class.

This Delay subclass implements a fractional- length digital delay-line using first-order linear interpolation. A fixed maximum length of 4095 and a delay of zero is set using the default constructor. Alternatively, the delay and maximum length can be set during instantiation with an overloaded constructor.

Linear interpolation is an efficient technique for achieving fractional delay lengths, though it does introduce high-frequency signal attenuation to varying degrees depending on the fractional delay setting. The use of higher order Lagrange interpolators can typically improve (minimize) this attenuation characteristic.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

DelayL.functions Description
.delay (dur, R+W) length of delay
.max (dur, R+W) max delay ( buffer size )

see i-robot.ck

Echo

Echo STK echo effect class.

Echo.functions Description
.delay (dur, R+W) length of echo
.max (dur, R+W) max delay
.mix (float, R+W) mix level (wet/dry)

stk - envelopes


Envelope

Envelope STK envelope base class.

This class implements a simple envelope generator which is capable of ramping to a target value by a specified rate. It also responds to simple keyOn and keyOff messages, ramping to 1.0 on keyOn and to 0.0 on keyOff.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Envelope.functions Description
.keyOn (int, WRITE only) ramp to 1.0
.keyOff (int, WRITE only) ramp to 0.0
.target (float, R+W) ramp to arbitrary value.
.time (float, R+W) time to reach target (in seconds)
.duration (dur, R+W) duration to reach target
.rate (float, R+W) rate of change
.value (float, R+W) set immediate value

see envelop.ck

ADSR

ADSR STK ADSR envelope base class.

This Envelope subclass implements a traditional ADSR (Attack, Decay, Sustain, Release) envelope. It responds to simple keyOn and keyOff messages, keeping track of its state. The state == ADSR::DONE after the envelope value reaches 0.0 in the ADSR::RELEASE state.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

ADSR.functions Description
.keyOn (int, WRITE only) start the attack for non-zero values
.keyOff (int, WRITE only) start release for non-zero values
.attackTime (dur, R+W) attack time
.attackRate (float, R+W) attack rate
.decayTime (dur, R+W) decay time
.decayRate (float, R+W) decay rate
.sustainLevel (float, R+W) sustain level
.releaseTime (dur, R+W) release time
.releaseRate (float, R+W) release rate
.state (int, READ only) attack=0, decay=1 , sustain=2, release=3, done=4
.set (dur, dur, float, dur) set A, D, S, and R all at once

see adsr.ck

stk - reverbs


JCRev

JCRev John Chowning's reverberator class.

This class is derived from the CLM JCRev function, which is based on the use of networks of simple allpass and comb delay filters.
This class implements three series allpass units, followed by four parallel comb filters, and two decorrelation delay lines in parallel at the output.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

JCRev.functions Description
.mix (float, R+W) mix level

NRev

NRev CCRMA's NRev reverberator class.

This class is derived from the CLM NRev function, which is based on the use of networks of simple allpass and comb delay filters. This particular arrangement consists of 6 comb filters in parallel, followed by 3 allpass filters, a lowpass filter, and another allpass in series, followed by two allpass filters in parallel with corresponding right and left outputs.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

NRev.functions Description
.mix (float, R+W)

PRCRev

PRCRev Perry's simple reverberator class.

This class is based on some of the famous Stanford/CCRMA reverbs (NRev, KipRev), which were based on the Chowning/Moorer/Schroeder reverberators using networks of simple allpass and comb delay filters. This class implements two series allpass units and two parallel comb filters.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

PRCRev.functions Description
.mix (float, R+W) mix level

stk - components


Chorus

Chorus STK chorus effect class.

Chorus Description
.modFreq (float, R+W) modulation frequency
.modDepth (float, R+W) modulation depth
.mix (float, R+W) effect mix

Modulate

Modulate STK periodic/random modulator. This class combines random and periodic modulations to give a nice, natural human modulation function.

Modulate.functions Description
.vibratoRate (float, R+W) set rate of vibrato
.vibratoGain (float, R+W) gain for vibrato
.randomGain (float, R+W) gain for random contribution

PitShift

PitShift STK simple pitch shifter effect class. Implemented using delay lines.

PitShift.functions Description
.mix (float, R+W) effect dry/web mix level
.shift (float, R+W) degree of pitch shifting

SubNoise

SubNoise STK sub-sampled noise generator. Generates a new random number every "rate" ticks using the C rand() function. The quality of the rand() function varies from one OS to another.

SubNoise.functions Description
.rate (int, R+W) subsampling rate

Blit

Blit STK band-limited impulse train.

This class generates a band-limited impulse train using a closed-form algorithm reported by Stilson and Smith in "Alias-Free Digital Synthesis of Classic Analog Waveforms", 1996. The user can specify both the fundamental frequency of the impulse train and the number of harmonics contained in the resulting signal.

The signal is normalized so that the peak value is +/-1.0.

If nHarmonics is 0, then the signal will contain all harmonics up to half the sample rate. Note, however, that this setting may produce aliasing in the signal when the frequency is changing (no automatic modification of the number of harmonics is performed by the setFrequency() function).

Original code by Robin Davies, 2005. Revisions by Gary Scavone for STK, 2005.

Blit.functions Description
.freq (float, R+W) base frequency (hz)
.harmonics (int, R+W) number of harmonics in pass band
.phase (float, R+W) phase of the the signal

BlitSaw

BlitSaw STK band-limited sawtooth wave.

This class generates a band-limited sawtooth waveform using a closed-form algorithm reported by Stilson and Smith in "Alias-Free Digital Synthesis of Classic Analog Waveforms", 1996. The user can specify both the fundamental frequency of the sawtooth and the number of harmonics contained in the resulting signal.

If nHarmonics is 0, then the signal will contain all harmonics up to half the sample rate. Note, however, that this setting may produce aliasing in the signal when the frequency is changing (no automatic modification of the number of harmonics is performed by the setFrequency() function).

Based on initial code of Robin Davies, 2005. Modified algorithm code by Gary Scavone, 2005.

BlitSaw.functions Description
.freq (float, R+W) base frequency (hz)
.harmonics (int, R+W) number of harmonics in pass band
.phase (float, R+W) phase of the the signal

BlitSquare

BlitSquare STK band-limited square wave.

This class generates a band-limited square wave signal. It is derived in part from the approach reported by Stilson and Smith in "Alias-Free Digital Synthesis of Classic Analog Waveforms", 1996. The algorithm implemented in this class uses a SincM function with an even M value to achieve a bipolar bandlimited impulse train. This signal is then integrated to achieve a square waveform. The integration process has an associated DC offset but that is subtracted off the output signal.

The user can specify both the fundamental frequency of the waveform and the number of harmonics contained in the resulting signal.

If nHarmonics is 0, then the signal will contain all harmonics up to half the sample rate. Note, however, that this setting may produce aliasing in the signal when the frequency is changing (no automatic modification of the number of harmonics is performed by the setFrequency() function).

Based on initial code of Robin Davies, 2005. Modified algorithm code by Gary Scavone, 2005.

BlitSquare.functions Description
.freq (float, R+W) base frequency (hz)
.harmonics (int, R+W) number of harmonics in pass band
.phase (float, R+W) phase of the the signal

stk - file i/o


WvIn

WvIn STK audio data input base class.

This class provides input support for various audio file formats.
It also serves as a base class for "realtime" streaming subclasses.

WvIn loads the contents of an audio file for subsequent output.
Linear interpolation is used for fractional "read rates".

WvIn supports multi-channel data in interleaved format. It is important to distinguish the tick() methods, which return samples produced by averaging across sample frames, from the tickFrame() methods, which return pointers to multi-channel sample frames.
For single-channel data, these methods return equivalent values.

Small files are completely read into local memory during instantiation. Large files are read incrementally from disk. The file size threshold and the increment size values are defined in WvIn.h.

WvIn currently supports WAV, AIFF, SND (AU), MAT-file (Matlab), and STK RAW file formats. Signed integer (8-, 16-, and 32-bit) and floating-point (32 and 64-bit) data types are supported. Uncompressed data types are not supported. If using MAT-files, data should be saved in an array with each data channel filling a matrix row.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

WvIn.functions Description
.rate (float, R+W) playback rate
.path (string, R+W) specifies file to be played

WaveLoop

WaveLoop STK waveform oscillator class.

This class inherits from WvIn and provides audio file looping functionality.

WaveLoop supports multi-channel data in interleaved format. It is important to distinguish the tick() methods, which return samples produced by averaging across sample frames, from the tickFrame() methods, which return pointers to multi-channel sample frames. For single-channel data, these methods return equivalent values.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

WaveLoop.functions Description
.freq (float, R+W) set frequency of playback ( loops / second )
.addPhase (float, R+W) offset by phase
.addPhaseOffset (float, R+W) set phase offset
inherited from WavIn
.rate (float, R+W) playback rate
.path (string, R+W) specifies file to be played

WvOut

WvOut and WvOut2 STK audio data output classes.

These classes provide output support for various audio file formats.
They also serves as a base class for "realtime" streaming subclasses.

WvOut writes single-channel samples to an audio file. WvOut2 supports multi-channel data in interleaved format. It is important to distinguish the tick() methods, which output single samples to all channels in a sample frame, from the tickFrame() method, which takes a pointer to multi-channel sample frame data.

WvOut currently supports WAV, AIFF, AIFC, SND (AU), MAT-file (Matlab), and STK RAW file formats. Signed integer (8-, 16-, and 32-bit) and floating-point (32- and 64-bit) data types are supported. STK RAW files use 16-bit integers by definition. MAT-files will always be written as 64-bit floats. If a data type specification does not match the specified file type, the data type will automatically be modified. Uncompressed data types are not supported.

Currently, WvOut is non-interpolating and the output rate is always Stk::sampleRate().

WvOut supports automatic filename generation by setting the filename to "special:auto". Now, the autoPrefix parameter, if provided, will be prepended to the filename. Do this if you want the automatically named file to appear in a directory other than chuck's working directory. When auto-naming is enabled, the output file name will include a timestamp.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

WvOut.functions Description
.matFilename (string, WRITE only) open matlab file for writing
.sndFilename (string, WRITE only) open snd file for writing
.wavFilename (string, WRITE only) open WAVE file for writing
.rawFilename (string, WRITE only) open raw file for writing
.aifFilename (string, WRITE only) open AIFF file for writing
.autoPrefix (string, R+W) get/set the prefix
.record (int, R+W) start/stop output.
.closeFile (string, WRITE only) close file properly
home .. language .. program .. examples