Home Information Classes Download Usage Mail List Requirements Links Tutorial

# StifKarp Class Reference

STK plucked stiff string instrument. More...

`#include <StifKarp.h>`

Inheritance diagram for StifKarp:

List of all members.

## Public Member Functions

| StifKarp (MY_FLOAT lowestFrequency)
| Class constructor, taking the lowest desired playing frequency.
| ~StifKarp ()
| Class destructor.
void | clear ()
| Reset and clear all internal state.
void | setFrequency (MY_FLOAT frequency)
| Set instrument parameters for a particular frequency.
void | setStretch (MY_FLOAT stretch)
| Set the stretch "factor" of the string (0.0 - 1.0).
void | setPickupPosition (MY_FLOAT position)
| Set the pluck or "excitation" position along the string (0.0 - 1.0).
void | setBaseLoopGain (MY_FLOAT aGain)
| Set the base loop gain.
void | pluck (MY_FLOAT amplitude)
| Pluck the string with the given amplitude using the current frequency.
void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude)
| Start a note with the given frequency and amplitude.
void | noteOff (MY_FLOAT amplitude)
| Stop a note with the given amplitude (speed of decay).
MY_FLOAT | tick ()
| Compute one output sample.
void | controlChange (int number, MY_FLOAT value)
| Perform the control change specified by number and value (0.0 - 128.0).

## Detailed Description

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:

- Pickup Position = 4
- String Sustain = 11
- String Stretch = 1

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

Definition at line 34 of file StifKarp.h.

## Member Function Documentation

void StifKarp::setBaseLoopGain | ( | MY_FLOAT | aGain | ) |

| Set the base loop gain. The actual loop gain is set according to the frequency. Because of high-frequency loop filter roll-off, higher frequency settings have greater loop gains.

The documentation for this class was generated from the following file:

- StifKarp.h

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.