Skip to content

Commit 31c9095

Browse files
committed
Implement synthio_block_slot_get_limited.
1 parent 6481b4e commit 31c9095

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shared-module/audiofilters/Distortion.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ audioio_get_buffer_result_t audiofilters_distortion_get_buffer(audiofilters_dist
223223
}
224224

225225
// get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
226-
mp_float_t drive = MIN(MAX(synthio_block_slot_get(&self->drive), 0.0), 1.0);
227-
mp_float_t pre_gain = db_to_linear(MIN(MAX(synthio_block_slot_get(&self->pre_gain), -60.0), 60.0));
228-
mp_float_t post_gain = db_to_linear(MIN(MAX(synthio_block_slot_get(&self->post_gain), -80.0), 24.0));
229-
mp_float_t mix = MIN(MAX(synthio_block_slot_get(&self->mix), 0.0), 1.0);
226+
mp_float_t drive = synthio_block_slot_get_limited(&self->drive, 0.0, 1.0);
227+
mp_float_t pre_gain = db_to_linear(synthio_block_slot_get_limited(&self->pre_gain, -60.0, 60.0));
228+
mp_float_t post_gain = db_to_linear(synthio_block_slot_get_limited(&self->post_gain, -80.0, 24.0));
229+
mp_float_t mix = synthio_block_slot_get_limited(&self->mix, 0.0, 1.0);
230230

231231
// Switch our buffers to the other buffer
232232
self->last_buf_idx = !self->last_buf_idx;

0 commit comments

Comments
 (0)