Skip to content

daisysp::Pluck

More...

#include <pluck.h>

Public Functions

Name
Pluck()
~Pluck()
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

class daisysp::Pluck;

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

Public Functions Documentation

function Pluck

inline Pluck()

function ~Pluck

inline ~Pluck()

function Init

void 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.

function Process

float Process(
    float & trig
)

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


function SetAmp

inline void SetAmp(
    float amp
)

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


function SetFreq

inline void SetFreq(
    float freq
)

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


function SetDecay

inline void SetDecay(
    float decay
)

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


function SetDamp

inline void SetDamp(
    float damp
)

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


function SetMode

inline void SetMode(
    int32_t mode
)

Sets the mode of the algorithm.


function GetAmp

inline float GetAmp()

Returns the current value for amp.


function GetFreq

inline float GetFreq()

Returns the current value for freq.


function GetDecay

inline float GetDecay()

Returns the current value for decay.


function GetDamp

inline float GetDamp()

Returns the current value for damp.


function GetMode

inline int32_t GetMode()

Returns the current value for mode.

---

Updated on 2024-01-03 at 19:38:46 +0000