From bcead0e0b5034de1d78f9cfa79505815385a473b Mon Sep 17 00:00:00 2001
From: Michael Sippel <micha@fragmental.art>
Date: Sun, 12 Jan 2025 05:07:05 +0100
Subject: [PATCH] expr pedal threshold

---
 guitfx.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/guitfx.c b/guitfx.c
index 052e37a..a512079 100644
--- a/guitfx.c
+++ b/guitfx.c
@@ -87,13 +87,16 @@ static void on_process(void *userdata, struct spa_io_position *position)
 								switch( midi_data[1] ) {
 									case 0x0b:
 									    // expr pedal
-										float val_f = ((float)midi_data[2]) / 128.0;
-										printf("Expr Pedal %f\n", val_f);
-										if ( val_f > 0.1 ) {
-										  data->delay.mix = val_f;
-										} else {
-										  data->delay.mix = 0.0;
-										}
+							      		    float val_f = ((float)midi_data[2]) / 128.0;
+
+									    float thres = 0.4;
+									    
+								            if ( val_f > thres ) {
+									        printf("Expr Pedal %f\n", val_f);
+										data->delay.mix = (val_f - thres) / (1.0-thres);
+									    } else {
+									        data->delay.mix = 0.0;
+								            }
 									    break;
 
 								    case 0x42: