MCPcopy Create free account
hub / github.com/VCVRack/Befaco / process

Method process

src/plugin.hpp:344–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342 ADEnvelope() { };
343
344 void process(const float& sampleTime) {
345
346 if (stage == STAGE_OFF) {
347 env = envLinear = 0.0f;
348 }
349 else if (stage == STAGE_ATTACK) {
350 envLinear += sampleTime / attackTime;
351 env = std::pow(envLinear, attackShape);
352 }
353 else if (stage == STAGE_DECAY) {
354 envLinear -= sampleTime / decayTime;
355 env = std::pow(envLinear, decayShape);
356 }
357
358 if (envLinear >= 1.0f) {
359 stage = STAGE_DECAY;
360 env = envLinear = 1.0f;
361 }
362 else if (envLinear <= 0.0f) {
363 stage = STAGE_OFF;
364 env = envLinear = 0.0f;
365 }
366 }
367
368 void trigger() {
369 stage = ADEnvelope::STAGE_ATTACK;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected