Skip to content

daisysp::StringVoice

Extended Karplus-Strong, with all the niceties from Rings. More...

#include <stringvoice.h>

Public Functions

Name
StringVoice()
~StringVoice()
void Init(float sample_rate)
void Reset()
float Process(bool trigger =false)
void SetSustain(bool sustain)
void Trig()
void SetFreq(float freq)
void SetAccent(float accent)
void SetStructure(float structure)
void SetBrightness(float brightness)
void SetDamping(float damping)
float GetAux()

Detailed Description

class daisysp::StringVoice;

Extended Karplus-Strong, with all the niceties from Rings.

Author: Ben Sergentanis

Date: Jan 2021 Ported from pichenettes/eurorack/plaits/dsp/physical_modelling/string_voice.h

and pichenettes/eurorack/plaits/dsp/physical_modelling/string_voice.cc

to an independent module.

Original code written by Emilie Gillet in 2016.

Public Functions Documentation

function StringVoice

inline StringVoice()

function ~StringVoice

inline ~StringVoice()

function Init

void Init(
    float sample_rate
)

Parameters:

  • sample_rate Audio engine sample rate

Initialize the module


function Reset

void Reset()

Reset the string oscillator


function Process

float Process(
    bool trigger =false
)

Parameters:

  • trigger Strike the string. Defaults to false.

Get the next sample


function SetSustain

void SetSustain(
    bool sustain
)

Parameters:

  • sustain True turns on the noise.

Continually excite the string with noise.


function Trig

void Trig()

Strike the string.


function SetFreq

void SetFreq(
    float freq
)

Parameters:

  • freq Frequency in Hz.

Set the string root frequency.


function SetAccent

void SetAccent(
    float accent
)

Parameters:

  • accent Works 0-1.

Hit the string a bit harder. Influences brightness and decay.


function SetStructure

void SetStructure(
    float structure
)

Parameters:

  • structure Works 0-1. 0-.26 is curved bridge, .26-1 is dispersion.

Changes the string's nonlinearity (string type).


function SetBrightness

void SetBrightness(
    float brightness
)

Parameters:

  • brightness Works best 0-1

Set the brighness of the string, and the noise density.


function SetDamping

void SetDamping(
    float damping
)

Parameters:

  • damping Works best 0-1. Full damp is only achieved with full accent.

How long the resonant body takes to decay relative to the accent level.


function GetAux

float GetAux()

Get the raw excitation signal. Must call Process() first.

---

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