21#ifndef __CALF_ENVELOPE_H
22#define __CALF_ENVELOPE_H
80 inline void set(
float a,
float d,
float s,
float r,
float er,
float f = 0.f)
88 fade = 1.0 / (
f * er);
177 if (
value < 0.00001f) {
uint8_t a
Definition Spc_Cpu.h:141
double old_value
Value from the time before advance() was called last time.
Definition envelope.h:59
double release
Definition envelope.h:47
float get_amp_value()
Definition envelope.h:200
double fade
Definition envelope.h:47
double decay
Definition envelope.h:47
void note_off()
Release the envelope.
Definition envelope.h:115
double interpolate(double pos)
Definition envelope.h:196
void advance()
Calculate next envelope value.
Definition envelope.h:137
double thiss
Definition envelope.h:57
adsr()
Definition envelope.h:61
env_state
Definition envelope.h:35
@ LOCKDECAY
locked decay
Definition envelope.h:41
@ SUSTAIN
sustain - remain at sustain level (unless sustain is 0 - then it gets stopped); with fade !...
Definition envelope.h:39
@ ATTACK
attack - rise from 0 to 1
Definition envelope.h:37
@ STOP
envelope is stopped
Definition envelope.h:36
@ DECAY
decay - fall from 1 to sustain level
Definition envelope.h:38
@ RELEASE
release - fall from sustain (or pre-sustain) level to 0
Definition envelope.h:40
double value
Current envelope (output) level.
Definition envelope.h:51
double attack
Definition envelope.h:47
bool released() const
Definition envelope.h:99
void note_on()
Start the envelope.
Definition envelope.h:109
bool stopped() const
Definition envelope.h:104
void set(float a, float d, float s, float r, float er, float f=0.f)
Definition envelope.h:80
double sustain
Definition envelope.h:47
void reset()
Stop (reset) the envelope.
Definition envelope.h:67
double thisrelease
Definition envelope.h:54
double release_time
Requested release time (not the rate!) in frames, used for recalculating the rate if sustain is chang...
Definition envelope.h:49
env_state state
Current envelope stage.
Definition envelope.h:45
unsigned d
Definition inflate.c:940
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned f
Definition inflate.c:1572
T small_value()
'Small value' for integer and other types
Definition primitives.h:201
bool undoing
Definition envelope.h:215
float step
Definition envelope.h:214
fadeout(int steps=256)
Definition envelope.h:217
void reset()
Prepare fade out.
Definition envelope.h:225
float step_orig
Definition envelope.h:214
void reset_soft()
Reset if fully faded out; fade back in if in the middle of fading out.
Definition envelope.h:242
float value
Definition envelope.h:213
void undo()
Fade back in with double speed (to prevent click on note restart).
Definition envelope.h:234
void process(float *buffer, int len)
Definition envelope.h:250
bool done
Definition envelope.h:215
int r
Definition crypt.c:458