From 0cceb2057e382129ae24565fdefff87e91b076ab Mon Sep 17 00:00:00 2001 From: gramanas Date: Sat, 29 Apr 2023 14:34:48 +0300 Subject: self contained adsr --- src/adsr.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/adsr.h (limited to 'src/adsr.h') diff --git a/src/adsr.h b/src/adsr.h new file mode 100644 index 0000000..713c95f --- /dev/null +++ b/src/adsr.h @@ -0,0 +1,15 @@ +#ifndef ADSR_H +#define ADSR_H + +typedef struct adsr_t { + float a; + float peak; + float d; + float s; + float r; + unsigned long long elapsed; +} adsr_t; + +float adsr_amplitude(adsr_t *adsr, float noteOn, float noteOff, unsigned long long elapsed); + +#endif /* ADSR_H */ -- cgit v1.2.3