expr pedal threshold
This commit is contained in:
parent
c75d61123a
commit
bcead0e0b5
1 changed files with 10 additions and 7 deletions
17
guitfx.c
17
guitfx.c
|
@ -87,13 +87,16 @@ static void on_process(void *userdata, struct spa_io_position *position)
|
||||||
switch( midi_data[1] ) {
|
switch( midi_data[1] ) {
|
||||||
case 0x0b:
|
case 0x0b:
|
||||||
// expr pedal
|
// expr pedal
|
||||||
float val_f = ((float)midi_data[2]) / 128.0;
|
float val_f = ((float)midi_data[2]) / 128.0;
|
||||||
printf("Expr Pedal %f\n", val_f);
|
|
||||||
if ( val_f > 0.1 ) {
|
float thres = 0.4;
|
||||||
data->delay.mix = val_f;
|
|
||||||
} else {
|
if ( val_f > thres ) {
|
||||||
data->delay.mix = 0.0;
|
printf("Expr Pedal %f\n", val_f);
|
||||||
}
|
data->delay.mix = (val_f - thres) / (1.0-thres);
|
||||||
|
} else {
|
||||||
|
data->delay.mix = 0.0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x42:
|
case 0x42:
|
||||||
|
|
Loading…
Reference in a new issue