DaisySP
Public Member Functions | List of all members
daisysp::Pluck Class Reference

#include <pluck.h>

Public Member Functions

void Init (float sample_rate, float *buf, int32_t npt, int32_t mode)
 
float Process (float &trig)
 
void SetAmp (float amp)
 
void SetFreq (float freq)
 
void SetDecay (float decay)
 
void SetDamp (float damp)
 
void SetMode (int32_t mode)
 
float GetAmp ()
 
float GetFreq ()
 
float GetDecay ()
 
float GetDamp ()
 
int32_t GetMode ()
 

Detailed Description

Produces a naturally decaying plucked string or drum sound based on the Karplus-Strong algorithms.

Ported from soundpipe to DaisySP

This code was originally extracted from the Csound opcode "pluck"

Original Author(s): Barry Vercoe, John ffitch Year: 1991

Location: OOps/ugens4.c

Member Function Documentation

◆ GetAmp()

float daisysp::Pluck::GetAmp ( )
inline

Returns the current value for amp.

◆ GetDamp()

float daisysp::Pluck::GetDamp ( )
inline

Returns the current value for damp.

◆ GetDecay()

float daisysp::Pluck::GetDecay ( )
inline

Returns the current value for decay.

◆ GetFreq()

float daisysp::Pluck::GetFreq ( )
inline

Returns the current value for freq.

◆ GetMode()

int32_t daisysp::Pluck::GetMode ( )
inline

Returns the current value for mode.

◆ Init()

void Pluck::Init ( float  sample_rate,
float *  buf,
int32_t  npt,
int32_t  mode 
)

Initializes the Pluck module.

\param sample_rate: Sample rate of the audio engine being run.
\param buf: buffer used as an impulse when triggering the Pluck algorithm
\param npt: number of elementes in buf.
\param mode: Sets the mode of the algorithm.

◆ Process()

float Pluck::Process ( float &  trig)

Processes the waveform to be generated, returning one sample. This should be called once per sample period.

◆ SetAmp()

void daisysp::Pluck::SetAmp ( float  amp)
inline

Sets the amplitude of the output signal. Input range: 0-1?

◆ SetDamp()

void daisysp::Pluck::SetDamp ( float  damp)
inline

Sets the dampening factor applied by the filter (based on PLUCK_MODE) Input range: 0-1

◆ SetDecay()

void daisysp::Pluck::SetDecay ( float  decay)
inline

Sets the time it takes for a triggered note to end in seconds. Input range: 0-1

◆ SetFreq()

void daisysp::Pluck::SetFreq ( float  freq)
inline

Sets the frequency of the output signal in Hz. Input range: Any positive value

◆ SetMode()

void daisysp::Pluck::SetMode ( int32_t  mode)
inline

Sets the mode of the algorithm.


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