From fb5a321dd7c2848128b04b306f3e1e59c87a3f70 Mon Sep 17 00:00:00 2001 From: Stijn Kuipers Date: Thu, 29 Jun 2023 16:26:07 +0200 Subject: Initial Filedump Tadaaa!! --- sw/Core/Src/lfo.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 sw/Core/Src/lfo.h (limited to 'sw/Core/Src/lfo.h') diff --git a/sw/Core/Src/lfo.h b/sw/Core/Src/lfo.h new file mode 100755 index 0000000..74b4b12 --- /dev/null +++ b/sw/Core/Src/lfo.h @@ -0,0 +1,13 @@ +typedef struct lfo { + float r, i, a; +} lfo; +#define LFOINIT(f) {1.f,0.f,(f)+(f)} +__STATIC_FORCEINLINE void lfo_setfreq(lfo *l, float f) { + l->a = f + f; +} +__STATIC_FORCEINLINE float lfo_next(lfo *l) { + l->r -= l->a * l->i; + l->i += l->a * l->r; + return l->r; +} + -- cgit v1.2.3