MEAP The Library

MOZZI
MEAP The Class
C++ tips
Mozzi Reworks
mOscil
mSample
Generators
mDust
mNoise
mOperator
mSineLFO
mEnvSection
Effects
mBitcrusher
mChorus
mDigitalDelay
mFlanger
mPlateReverb
mSchroederReverb
DSP
mDelayLine
mFeedbackComb
mFeedforwardComb
mFIR
mIIR
mNaturalComb
mOnePoleLPF
mResonz
mRingz
mSchroederAllpass
mInstruments
mDrumRack
mFM4Instrument
mMarimbaInstrument
mPopInstrument
mRompler
mStringInstrument
mStringSynthInstrument
Composition
mMML
mTransitionTable
Utilities
mEventDelayMicros
mRandomDistribution

class: mStringInstrument


Karplus-Strong string instrument

Description

mStringInstrument is a polyphonic instrument that generates sound through a basic physical model of a plucked vibrating strign. It inherits all functions from the mInstrument parent class and adds the following functionality.

Template Parameters

template <uint16_t mPOLYPHONY = 4>

mPOLYPHONY: number of voices the instrument can play simultaneously

Class Methods

Constructor

mStringInstrument(float lowest_freq, uint_8 *midi_table_name = NULL>

lowest_freq: lowest frequency (in Hz) that you want the instrument to be able to play. Setting lower frequencies requires a longer internal delay line per voice, increasing memory requirements.

midi_table_name: (OPTIONAL) table of MIDI data for the instrument to play.


int32_t next()

Calculates a sample of output. Nominally a 16-bit signal level. MUST BE CALLED IN updateAudio()


void setLoopGain(float loop_gain)

Sets feedback gain within physical model (0 to 1.0). Higher values yield notes with a high sustain.

Example

Relevant Tutorials