Pluck
SourcespluckLight CPU
Karplus-Strong plucked string / drum — trigger + decay + damp.
What it does
Karplus-Strong plucked-string / drum voice.
Wraps daisysp::Pluck (Csound algorithm). Init takes a file-scope 256-sample impulse buffer; Process(float &trig) re-plucks whenever trig != 0, so a file-scope prev_trig snapshot feeds it a one-sample rising edge via a materialised lvalue. Mode is baked at init.
Parameters
-
Decay
decayHow long the note rings before dying away. ⚠ It also sets the lowest pitch the tile can reach, because the algorithm works from a fixed 256-sample buffer and the decay length is bound up with it — asking for a very low note and a very long decay at once is the case where this tile disappoints. Per-sample, so it can be modulated between plucks.
-
Damp
dampHow much the tone is filtered on each pass around the delay line, which controls how quickly the bright part of the pluck dulls into a soft tail. Low values keep the string bright the whole way through and sound synthetic and buzzy; higher values behave more like a real string, where the attack is bright and the tail mellows. Distinct from Decay, which is how long it lasts rather than how it changes.
-
Amplitude
amplitudeOutput level of the tile, 0 to 1. Because Pluck has a native amplitude control this scales the string itself rather than being a separate VCA stage after it, so it is the right place to set a fixed level. For playing notes with an envelope, wire the envelope in rather than trying to automate this.
-
Decay Mode
modeWhich of the two Karplus-Strong averaging schemes the delay line uses. Recursive is the brighter and more metallic of the two, keeping more high end alive as the note decays. Weighted Average rolls the top off faster, giving a softer, rounder, more nylon-like string. ⚠ Baked at build time, so this is a choice about what the patch is rather than something to sweep.
Wire a pad/gate to Trig — each rising edge re-plucks. Decay sets how long the note rings (also the lowest pitch the 256-sample buffer reaches), Damp the filter dampening, Amplitude the level. Freq / Decay / Damp accept Mod sources; Mode is baked. Recursive = brighter, Weighted Average = softer.
Ports
In
-
Trig
trigger -
Freq
frequency -
Decay
decay -
Damp
damp
Out
-
Audio Out
output
Audio Control
Inputs
- Trig
- Rising edge re-plucks the string.
- Freq
- Pitch in Hz.
- Decay
- Ring time, 0 → 1.
- Damp
- Filter dampening, 0 → 1.
Outputs
- Audio Out
- Plucked-string output.
Rules and gotchas
- Decay Mode is baked at build time.