summaryrefslogtreecommitdiffstats
path: root/src/synth_math.h
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2025-02-22 02:36:27 +0200
committergrm <grm@eyesin.space>2025-02-22 02:36:27 +0200
commit500b9a07b93d6cd3e771edc5698e06d163da60f1 (patch)
tree08aace91a7ec7600b254b986bf5458362dab33f3 /src/synth_math.h
parent04b3dbe0a339c42d7b2085bcd6149e9277d699a1 (diff)
downloadsynth-project-500b9a07b93d6cd3e771edc5698e06d163da60f1.tar.gz
synth-project-500b9a07b93d6cd3e771edc5698e06d163da60f1.tar.bz2
synth-project-500b9a07b93d6cd3e771edc5698e06d163da60f1.zip
a year of changes (web, better soundcard handling, biquad)
Diffstat (limited to 'src/synth_math.h')
-rw-r--r--src/synth_math.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/synth_math.h b/src/synth_math.h
index 2dd9f83..029ed74 100644
--- a/src/synth_math.h
+++ b/src/synth_math.h
@@ -3,19 +3,23 @@
#include <stddef.h>
-static long long
+// do I really want inline? used to be static
+inline long long
gcd(long long a, long long b)
{
- long long rem;
- rem=a-(a/b*b);
- if(rem==0)
- return b;
- else
- gcd(b,rem);
+ long long rem;
+ rem=a-(a/b*b);
+ if(rem==0)
+ return b;
+ else
+ gcd(b, rem);
+
+ // unreachable
+ return 0;
}
// Function to return LCM of two numbers
-static long long
+inline long long
lcm(long long a, long long b)
{
return (a / gcd(a, b)) * b;
@@ -30,7 +34,7 @@ clamp(float f, int min, int max)
}
/* 1d convolution */
-static void
+inline void
convole(float *signal, float *filter,
size_t signal_size, size_t filter_size, float *out) {
for (size_t i = 0; i < filter_size + signal_size; i++) {