Pluck the string at a normalized position.
- Parameters
-
| position | Normalized position along string (0.0 to 1.0) |
| strength | Excitation amplitude (0.0 to 1.0+) |
Seeds the delay line with a triangle. A string seed has its average removed, because the lumped loop would otherwise hold it as a DC offset. Position affects spectral content: 0.5 = center (warm), near 0/1 = bridge (bright).
Definition at line 303 of file WaveguideNetwork.cpp.
304{
306
308 return;
309
312 if (len < 2)
313 return;
314
315 const auto pluck_sample = std::clamp(
316 static_cast<size_t>(
position *
static_cast<double>(len)),
size_t { 1 }, len - 1);
318 ? std::max(strength, 1.0)
319 : strength;
320
321 seg.p_plus = Memory::HistoryBuffer<double>(seg.p_plus.capacity());
322 seg.p_minus = Memory::HistoryBuffer<double>(seg.p_minus.capacity());
323
324 std::vector<double> shape(len);
325 for (size_t s = 0; s < len; ++s) {
326 if (s <= pluck_sample) {
327 shape[s] = effective_strength * static_cast<double>(s)
328 / static_cast<double>(pluck_sample);
329 } else {
330 shape[s] = effective_strength * static_cast<double>(len - s)
331 / static_cast<double>(len - pluck_sample);
332 }
333 }
334
337 offset = std::accumulate(shape.begin(), shape.end(), 0.0) /
static_cast<double>(len);
338 }
339
340 for (
const double value : shape) {
342 }
343
347 }
348}
std::optional< glm::vec3 > position
size_t m_exciter_samples_remaining
ExciterType m_exciter_type
size_t m_delay_length_integer
@ CONTINUOUS
External node as continuous exciter (bowing)
std::vector< WaveguideSegment > m_segments
@ UNIDIRECTIONAL
Single loop (STRING)
References CONTINUOUS, m_delay_length_integer, m_exciter_active, m_exciter_samples_remaining, m_exciter_type, m_segments, offset, position, MayaFlux::Nodes::Network::WaveguideNetwork::WaveguideSegment::UNIDIRECTIONAL, and value.