@@ -306,7 +306,7 @@ audioio_get_buffer_result_t audiodelays_echo_get_buffer(audiodelays_echo_obj_t *
306
306
307
307
// get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
308
308
shared_bindings_synthio_lfo_tick (self -> sample_rate , n / self -> channel_count );
309
- mp_float_t mix = synthio_block_slot_get_limited (& self -> mix , MICROPY_FLOAT_CONST (0.0 ), MICROPY_FLOAT_CONST (1.0 ));
309
+ mp_float_t mix = synthio_block_slot_get_limited (& self -> mix , MICROPY_FLOAT_CONST (0.0 ), MICROPY_FLOAT_CONST (1.0 )) * MICROPY_FLOAT_CONST ( 2.0 ) ;
310
310
mp_float_t decay = synthio_block_slot_get_limited (& self -> decay , MICROPY_FLOAT_CONST (0.0 ), MICROPY_FLOAT_CONST (1.0 ));
311
311
312
312
mp_float_t f_delay_ms = synthio_block_slot_get (& self -> delay_ms );
@@ -361,7 +361,7 @@ audioio_get_buffer_result_t audiodelays_echo_get_buffer(audiodelays_echo_obj_t *
361
361
echo_buffer [self -> echo_buffer_write_pos ++ ] = word ;
362
362
}
363
363
364
- word = (int16_t )(echo * mix );
364
+ word = (int16_t )(echo * MIN ( mix , MICROPY_FLOAT_CONST ( 1.0 )) );
365
365
366
366
if (MP_LIKELY (self -> bits_per_sample == 16 )) {
367
367
word_buffer [i ] = word ;
@@ -452,16 +452,17 @@ audioio_get_buffer_result_t audiodelays_echo_get_buffer(audiodelays_echo_obj_t *
452
452
}
453
453
}
454
454
455
- word = echo + sample_word ;
455
+ word = (sample_word * MIN (MICROPY_FLOAT_CONST (2.0 ) - mix , MICROPY_FLOAT_CONST (1.0 )))
456
+ + (echo * MIN (mix , MICROPY_FLOAT_CONST (1.0 )));
456
457
word = synthio_mix_down_sample (word , SYNTHIO_MIX_DOWN_SCALE (2 ));
457
458
458
459
if (MP_LIKELY (self -> bits_per_sample == 16 )) {
459
- word_buffer [i ] = (int16_t )(( sample_word * ( MICROPY_FLOAT_CONST ( 1.0 ) - mix )) + ( word * mix )) ;
460
+ word_buffer [i ] = (int16_t )word ;
460
461
if (!self -> samples_signed ) {
461
462
word_buffer [i ] ^= 0x8000 ;
462
463
}
463
464
} else {
464
- int8_t mixed = (int16_t )(( sample_word * ( MICROPY_FLOAT_CONST ( 1.0 ) - mix )) + ( word * mix )) ;
465
+ int8_t mixed = (int16_t )word ;
465
466
if (self -> samples_signed ) {
466
467
hword_buffer [i ] = mixed ;
467
468
} else {
0 commit comments