From 1d61bfa33fa2f5541de9ef863fc540a062cca0b5 Mon Sep 17 00:00:00 2001 From: Kuba <132459354+KubaPro010@users.noreply.github.com> Date: Fri, 8 Aug 2025 22:13:57 +0200 Subject: [PATCH] better tilt correction --- src/fm95.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fm95.c b/src/fm95.c index e004338..ccc31c2 100644 --- a/src/fm95.c +++ b/src/fm95.c @@ -51,7 +51,7 @@ typedef struct float clipper_threshold; uint8_t preemphasis; - int8_t tilt; + float tilt; uint8_t calibration; float mpx_power; float mpx_deviation; @@ -329,7 +329,7 @@ static int config_handler(void* user, const char* section, const char* name, con } else if (MATCH("fm95", "deviation")) { pconfig->audio_deviation = strtof(value, NULL); } else if(MATCH("fm95", "tilt")) { - pconfig->tilt = strtof(value, NULL) * 127.0f; + pconfig->tilt = strtof(value, NULL); } else if(MATCH("fm95", "bs412_max")) { pconfig->bs412_max = strtof(value, NULL); } else if(MATCH("fm95", "agc_target")) { @@ -459,7 +459,7 @@ void init_runtime(FM95_Runtime* runtime, const FM95_Config config) { init_bs412(&runtime->bs412, config.mpx_deviation, config.mpx_power, config.bs412_attack, config.bs412_release, config.bs412_max, config.sample_rate); runtime->bs412.gain = last_gain; - if(config.tilt != 0) tilt_init(&runtime->tilter, (float)config.tilt / 127.0f); + if(config.tilt != 0) tilt_init(&runtime->tilter, config.tilt, config.sample_rate); init_stereo_encoder(&runtime->stencode, 4.0f, &runtime->osc, config.volumes.audio, config.volumes.pilot); @@ -589,4 +589,4 @@ int main(int argc, char **argv) { break; } return ret; -} \ No newline at end of file +}