Skip to content

Commit f8647a3

Browse files
committed
Removing extra f float markers
1 parent edb6810 commit f8647a3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

shared-module/audiodelays/Reverb.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self,
139139
}
140140

141141
int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n) {
142-
if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) {
143-
n = MICROPY_FLOAT_CONST(1.0f);
144-
} else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0f)) {
145-
n = MICROPY_FLOAT_CONST(0.0f);
142+
if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0)) {
143+
n = MICROPY_FLOAT_CONST(1.0);
144+
} else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0)) {
145+
n = MICROPY_FLOAT_CONST(0.0);
146146
}
147147

148-
return (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(9175.04f)) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f
148+
return (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(9175.04)) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f
149149
}
150150

151151
mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self) {
@@ -157,13 +157,13 @@ void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_o
157157
}
158158

159159
void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2) {
160-
if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) {
161-
n = MICROPY_FLOAT_CONST(1.0f);
162-
} else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0f)) {
163-
n = MICROPY_FLOAT_CONST(0.0f);
160+
if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0)) {
161+
n = MICROPY_FLOAT_CONST(1.0);
162+
} else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0)) {
163+
n = MICROPY_FLOAT_CONST(0.0);
164164
}
165165

166-
*damp1 = (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(13107.2f)); // 13107.2 = 0.4f scaling factor
166+
*damp1 = (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(13107.2)); // 13107.2 = 0.4f scaling factor
167167
*damp2 = (int16_t)(32768 - *damp1); // inverse of x1 damp2 = 1.0 - damp1
168168
}
169169

@@ -176,9 +176,9 @@ void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_ob
176176
}
177177

178178
void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) {
179-
mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0f);
180-
*mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0f) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) * 32767;
181-
*mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) * 32767;
179+
mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0);
180+
*mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767;
181+
*mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767;
182182
}
183183

184184
void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy