summaryrefslogtreecommitdiffstats
path: root/lib/volume_oscillator.c
diff options
context:
space:
mode:
authorEthan Werner <mail@ethanwerner.com>2026-08-09 15:02:21 +0400
committerEthan Werner <mail@ethanwerner.com>2026-08-09 15:02:21 +0400
commit3d92926a902017e7cf1f5738e99ff62da596ce12 (patch)
tree2b55422c26a48759d56fa91f06df24449e9dfa88 /lib/volume_oscillator.c
parent07e18043145f3d91c8ea7ec3ad41b3c905585277 (diff)
Diffstat (limited to 'lib/volume_oscillator.c')
-rw-r--r--lib/volume_oscillator.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/volume_oscillator.c b/lib/volume_oscillator.c
index 6aa59f0..37d34c4 100644
--- a/lib/volume_oscillator.c
+++ b/lib/volume_oscillator.c
@@ -23,7 +23,7 @@ ts_parameter_t const ts_volume_oscillator_p = { .n_inputs = 1, .n_outputs = 1, .
uint_t ts_volume_oscillator_offset( ts_constant_t const *c )
{
( void )c;
- return ( c ? ((ts_volume_oscillator_params_t *)c)->slow_k > 0 ? (uint_t)(((ts_volume_oscillator_params_t *)c)->slow_k - 1) : 0 : 0 );
+ return ( c ? ((ts_volume_oscillator_params_t const *)c)->slow_k > 0 ? (uint_t)(((ts_volume_oscillator_params_t const *)c)->slow_k - 1) : 0 : 0 );
}
int ts_volume_oscillator(
@@ -34,10 +34,9 @@ int ts_volume_oscillator(
{
TS_PROLOGUE( ts_volume_oscillator_p );
if ( !c ) return -1;
- fp_t fast_k = ((ts_volume_oscillator_params_t *)c)->fast_k;
- fp_t slow_k = ((ts_volume_oscillator_params_t *)c)->slow_k;
+ fp_t fast_k = ((ts_volume_oscillator_params_t const *)c)->fast_k;
+ fp_t slow_k = ((ts_volume_oscillator_params_t const *)c)->slow_k;
if (fast_k == 0 || slow_k == 0) return -1;
- if (n == 0) return -1;
fp_t fast_a = 2.0 / (fast_k + 1);
fp_t slow_a = 2.0 / (slow_k + 1);