File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
shared-module/audiofilters Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -268,14 +268,14 @@ audioio_get_buffer_result_t audiofilters_distortion_get_buffer(audiofilters_dist
268
268
mp_float_t post_gain = db_to_linear (synthio_block_slot_get_limited (& self -> post_gain , MICROPY_FLOAT_CONST (-80.0 ), MICROPY_FLOAT_CONST (24.0 )));
269
269
mp_float_t mix = synthio_block_slot_get_limited (& self -> mix , MICROPY_FLOAT_CONST (0.0 ), MICROPY_FLOAT_CONST (1.0 ));
270
270
271
- // LOFI mode bit mask
272
- uint32_t word_mask = 0xFFFFFFFF ^ ((1 << (uint32_t )MICROPY_FLOAT_C_FUN (round )(drive * MICROPY_FLOAT_CONST (14.0 ))) - 1 );
273
-
274
271
// Modify drive value depending on mode
272
+ uint32_t word_mask = 0 ;
275
273
if (self -> mode == DISTORTION_MODE_CLIP ) {
276
274
drive = MICROPY_FLOAT_CONST (1.0001 ) - drive ;
277
275
} else if (self -> mode == DISTORTION_MODE_WAVESHAPE ) {
278
276
drive = MICROPY_FLOAT_CONST (2.0 ) * drive / (MICROPY_FLOAT_CONST (1.0001 ) - drive );
277
+ } else if (self -> mode == DISTORTION_MODE_LOFI ) {
278
+ word_mask = 0xFFFFFFFF ^ ((1 << (uint32_t )MICROPY_FLOAT_C_FUN (round )(drive * MICROPY_FLOAT_CONST (14.0 ))) - 1 );
279
279
}
280
280
281
281
if (mix <= MICROPY_FLOAT_CONST (0.01 )) { // if mix is zero pure sample only
You can’t perform that action at this time.
0 commit comments