Content-Length: 364434 | pFad | http://github.com/adafruit/circuitpython/commit/3a16dafef8974b0824b5e19579f87fa48ffcddea

48 Remove `audiofilters.DistortionMode.ATAN` · adafruit/circuitpython@3a16daf · GitHub
Skip to content

Commit 3a16daf

Browse files
committed
Remove audiofilters.DistortionMode.ATAN
1 parent 46ebae1 commit 3a16daf

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

shared-bindings/audiofilters/Distortion.c

-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
//| CLIP: DistortionMode
2323
//| """Digital distortion effect which cuts off peaks at the top and bottom of the waveform."""
2424
//|
25-
//| ATAN: DistortionMode
26-
//| """"""
27-
//|
2825
//| LOFI: DistortionMode
2926
//| """Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the sound of early digital audio devices."""
3027
//|
@@ -36,14 +33,12 @@
3633
//|
3734

3835
MAKE_ENUM_VALUE(audiofilters_distortion_mode_type, distortion_mode, CLIP, DISTORTION_MODE_CLIP);
39-
MAKE_ENUM_VALUE(audiofilters_distortion_mode_type, distortion_mode, ATAN, DISTORTION_MODE_ATAN);
4036
MAKE_ENUM_VALUE(audiofilters_distortion_mode_type, distortion_mode, LOFI, DISTORTION_MODE_LOFI);
4137
MAKE_ENUM_VALUE(audiofilters_distortion_mode_type, distortion_mode, OVERDRIVE, DISTORTION_MODE_OVERDRIVE);
4238
MAKE_ENUM_VALUE(audiofilters_distortion_mode_type, distortion_mode, WAVESHAPE, DISTORTION_MODE_WAVESHAPE);
4339

4440
MAKE_ENUM_MAP(audiofilters_distortion_mode) {
4541
MAKE_ENUM_MAP_ENTRY(distortion_mode, CLIP),
46-
MAKE_ENUM_MAP_ENTRY(distortion_mode, ATAN),
4742
MAKE_ENUM_MAP_ENTRY(distortion_mode, LOFI),
4843
MAKE_ENUM_MAP_ENTRY(distortion_mode, OVERDRIVE),
4944
MAKE_ENUM_MAP_ENTRY(distortion_mode, WAVESHAPE),

shared-module/audiofilters/Distortion.c

-8
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,7 @@ audioio_get_buffer_result_t audiofilters_distortion_get_buffer(audiofilters_dist
276276

277277
// Pre-calculate drive-based constants if needed by effect mode
278278
mp_float_t word_mult = 0;
279-
mp_float_t word_div = 0;
280279
switch (self->mode) {
281-
case DISTORTION_MODE_ATAN:
282-
word_mult = powf(10.0, drive * drive * 3.0) - 1.0 + 0.001;
283-
word_div = 1.0 / (atanf(word_mult) * (1.0 + drive * 8));
284-
break;
285280
case DISTORTION_MODE_LOFI:
286281
word_mult = powf(2.0, 2.0 + (1.0 - drive) * 14); // goes from 16 to 2 bits
287282
break;
@@ -309,9 +304,6 @@ audioio_get_buffer_result_t audiofilters_distortion_get_buffer(audiofilters_dist
309304
word = powf(fabs(word / 32768.0), 1.0001 - drive) * word_sign * 32767.0;
310305
word = MIN(MAX(word, -32767), 32768); // Hard clip
311306
} break;
312-
case DISTORTION_MODE_ATAN: {
313-
word = atanf(word / 32768.0 * word_mult) * word_div * 32767.0;
314-
} break;
315307
case DISTORTION_MODE_LOFI: {
316308
word = floorf(word / 32768.0 * word_mult + 0.5) / word_mult * 32767.0;
317309
} break;

shared-module/audiofilters/Distortion.h

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
typedef enum {
1515
DISTORTION_MODE_CLIP,
16-
DISTORTION_MODE_ATAN,
1716
DISTORTION_MODE_LOFI,
1817
DISTORTION_MODE_OVERDRIVE,
1918
DISTORTION_MODE_WAVESHAPE,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/adafruit/circuitpython/commit/3a16dafef8974b0824b5e19579f87fa48ffcddea

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy