| // 140312 - PAH - slightly faster copy | // 140312 - PAH - slightly faster copy | ||||
| __attribute__((unused)) | |||||
| static void copy_to_fft_buffer(void *destination, const void *source) | static void copy_to_fft_buffer(void *destination, const void *source) | ||||
| { | { | ||||
| const uint16_t *src = (const uint16_t *)source; | const uint16_t *src = (const uint16_t *)source; | ||||
| } | } | ||||
| } | } | ||||
| __attribute__((unused)) | |||||
| static void apply_window_to_fft_buffer(void *buffer, const void *window) | static void apply_window_to_fft_buffer(void *buffer, const void *window) | ||||
| { | { | ||||
| int16_t *buf = (int16_t *)buffer; | int16_t *buf = (int16_t *)buffer; |
| // cleaner sat16 by http://www.moseleyinstruments.com/ | // cleaner sat16 by http://www.moseleyinstruments.com/ | ||||
| __attribute__((unused)) | |||||
| static int16_t sat16(int32_t n, int rshift) { | static int16_t sat16(int32_t n, int rshift) { | ||||
| // we should always round towards 0 | // we should always round towards 0 | ||||
| // to avoid recirculating round-off noise | // to avoid recirculating round-off noise |
| */ | */ | ||||
| #include <Arduino.h> | #include <Arduino.h> | ||||
| #if !defined(KINETISL) | |||||
| #include "effect_midside.h" | #include "effect_midside.h" | ||||
| void AudioEffectMidSide::update(void) | void AudioEffectMidSide::update(void) | ||||
| release(blocka); | release(blocka); | ||||
| release(blockb); | release(blockb); | ||||
| } | } | ||||
| #endif |
| */ | */ | ||||
| #include <Arduino.h> | #include <Arduino.h> | ||||
| #if !defined(KINETISL) | |||||
| #include "output_tdm.h" | #include "output_tdm.h" | ||||
| #include "memcpy_audio.h" | #include "memcpy_audio.h" | ||||
| #include "utility/imxrt_hw.h" | #include "utility/imxrt_hw.h" | ||||
| #endif | #endif | ||||
| } | } | ||||
| #endif |
| audio_block_t *block; | audio_block_t *block; | ||||
| uint32_t *p, *end; | uint32_t *p, *end; | ||||
| int32_t n1, n2, gain; | int32_t n1, n2, gain; | ||||
| uint32_t lo, hi, val1, val2; | |||||
| uint32_t lo, hi; | |||||
| gain = level; | gain = level; | ||||
| if (gain == 0) return; | if (gain == 0) return; | ||||
| lo = seed; | lo = seed; | ||||
| do { | do { | ||||
| #if defined(__ARM_ARCH_7EM__) | #if defined(__ARM_ARCH_7EM__) | ||||
| uint32_t val1, val2; | |||||
| hi = multiply_16bx16t(16807, lo); // 16807 * (lo >> 16) | hi = multiply_16bx16t(16807, lo); // 16807 * (lo >> 16) | ||||
| lo = 16807 * (lo & 0xFFFF); | lo = 16807 * (lo & 0xFFFF); | ||||
| lo += (hi & 0x7FFF) << 16; | lo += (hi & 0x7FFF) << 16; | ||||
| *p++ = val1; | *p++ = val1; | ||||
| *p++ = val2; | *p++ = val2; | ||||
| #elif defined(KINETISL) | #elif defined(KINETISL) | ||||
| uint32_t val1; | |||||
| hi = 16807 * (lo >> 16); | hi = 16807 * (lo >> 16); | ||||
| lo = 16807 * (lo & 0xFFFF); | lo = 16807 * (lo & 0xFFFF); | ||||
| lo += (hi & 0x7FFF) << 16; | lo += (hi & 0x7FFF) << 16; |