@@ -71,7 +71,7 @@ void common_hal_audiodelays_echo_construct(audiodelays_echo_obj_t *self, uint32_
7171 synthio_block_assign_slot (delay_ms , & self -> delay_ms , MP_QSTR_delay_ms );
7272
7373 if (mix == MP_OBJ_NULL ) {
74- mix = mp_obj_new_float (MICROPY_FLOAT_CONST (0.5 ));
74+ mix = mp_obj_new_float (MICROPY_FLOAT_CONST (0.25 ));
7575 }
7676 synthio_block_assign_slot (mix , & self -> mix , MP_QSTR_mix );
7777
@@ -268,7 +268,7 @@ audioio_get_buffer_result_t audiodelays_echo_get_buffer(audiodelays_echo_obj_t *
268268
269269 // get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
270270 shared_bindings_synthio_lfo_tick (self -> base .sample_rate , n / self -> base .channel_count );
271- mp_float_t mix = synthio_block_slot_get_limited (& self -> mix , MICROPY_FLOAT_CONST (0.0 ), MICROPY_FLOAT_CONST (1.0 ));
271+ 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 ) ;
272272 mp_float_t decay = synthio_block_slot_get_limited (& self -> decay , MICROPY_FLOAT_CONST (0.0 ), MICROPY_FLOAT_CONST (1.0 ));
273273
274274 mp_float_t f_delay_ms = synthio_block_slot_get (& self -> delay_ms );
@@ -323,7 +323,7 @@ audioio_get_buffer_result_t audiodelays_echo_get_buffer(audiodelays_echo_obj_t *
323323 echo_buffer [self -> echo_buffer_write_pos ++ ] = word ;
324324 }
325325
326- word = (int16_t )(echo * mix );
326+ word = (int16_t )(echo * MIN ( mix , MICROPY_FLOAT_CONST ( 1.0 )) );
327327
328328 if (MP_LIKELY (self -> base .bits_per_sample == 16 )) {
329329 word_buffer [i ] = word ;
@@ -414,16 +414,17 @@ audioio_get_buffer_result_t audiodelays_echo_get_buffer(audiodelays_echo_obj_t *
414414 }
415415 }
416416
417- word = echo + sample_word ;
417+ word = (int32_t )((sample_word * MIN (MICROPY_FLOAT_CONST (2.0 ) - mix , MICROPY_FLOAT_CONST (1.0 )))
418+ + (echo * MIN (mix , MICROPY_FLOAT_CONST (1.0 ))));
418419 word = synthio_mix_down_sample (word , SYNTHIO_MIX_DOWN_SCALE (2 ));
419420
420421 if (MP_LIKELY (self -> base .bits_per_sample == 16 )) {
421- word_buffer [i ] = (int16_t )(( sample_word * ( MICROPY_FLOAT_CONST ( 1.0 ) - mix )) + ( word * mix )) ;
422+ word_buffer [i ] = (int16_t )word ;
422423 if (!self -> base .samples_signed ) {
423424 word_buffer [i ] ^= 0x8000 ;
424425 }
425426 } else {
426- int8_t mixed = (int16_t )(( sample_word * ( MICROPY_FLOAT_CONST ( 1.0 ) - mix )) + ( word * mix )) ;
427+ int8_t mixed = (int16_t )word ;
427428 if (self -> base .samples_signed ) {
428429 hword_buffer [i ] = mixed ;
429430 } else {
0 commit comments