Commit graph

1684 commits

Author SHA1 Message Date
f8afdcb729 Add audiodelays & audioeffects to unix coverage port
.. and add a very basic audioeffects test, showing that it plausibly
is working

I had to address several build errors that occurred in the Unix build,
mostly related to conversion from FP types to integral types (replaced
by explicit casts) and by
accidental mixing of regular & f-suffixed floating constants (replaced
with the MICROPY_FLOAT_CONST macro)

Particularly this change could use consideration:
```diff
-    self->max_echo_buffer_len = self->sample_rate / 1000.0f * max_delay_ms * (self->channel_count * sizeof(uint16_t)); // bytes
+    self->max_echo_buffer_len = (uint32_t)(self->sample_rate / 1000.0f * max_delay_ms) * (self->channel_count * sizeof(uint16_t)); // bytes
```

The buffer length is being calculated in floating point based on the
millisecond delay & the sample rate. The result could then be a fractional
number such as 529.2 for a 12ms delay at 44.1kHz. Multiplying a floating
number by the size required for each echo buffer item
(`(self->channel_count * sizeof(uint16_t))`) could yield a number of bytes
that doesn't correspond to an integral number of buffer items. I grouped
the float->int conversion so that it converts the number of echo buffer
items to an integer and then multiplies by the size of the item.
2024-11-05 09:36:18 -06:00
3a0b97d280
Merge pull request #9787 from relic-se/audiofilters_stopfix 2024-11-05 09:01:11 -06:00
dcooperdalrymple
0aab00d7e5 Fix 16-bit unsigned integer silence within audio effects. 2024-11-05 08:41:23 -06:00
db84e81578
Merge pull request #9786 from bill88t/main 2024-11-04 15:16:00 -06:00
dcooperdalrymple
e7382c2fc4 Make conversion of mp_float_t to uint32_t for waveform_loop values explicit. 2024-11-04 08:13:17 -06:00
dcooperdalrymple
e2a52afa93 Add support for synthio.BlockInput on synthio.Note.waveform_loop_start, synthio.Note.waveform_loop_end, synthio.Note.ring_waveform_loop_start, and synthio.Note.ring_waveform_loop_end. 2024-11-03 20:30:06 -06:00
dcooperdalrymple
aa7d619d55 Fix ring_waveform_loop_start typo in frequency calculation. 2024-11-03 19:57:02 -06:00
dcooperdalrymple
63c3e394d3 Fix error with NULL sample handling in audiofilters.Filter. 2024-11-03 18:30:19 -06:00
Bill Sideris
de20c412b2
Reboot to normal mode upon fs wipe 2024-11-03 19:39:31 +02:00
dcooperdalrymple
c7e87cfae3 Remove unnecessary double buffer on filter_buffer. 2024-10-22 21:33:28 -05:00
dcooperdalrymple
e7c02bd561 Biquad filter processing. 2024-10-22 12:09:28 -05:00
dcooperdalrymple
db540c67ec Avoid processing sample if filter is None. 2024-10-22 12:09:07 -05:00
dcooperdalrymple
1bf400d2dd Rename biquad property to filter. 2024-10-22 12:08:33 -05:00
Cooper Dalrymple
5246053563 Initial structure for biquad filter effect. 2024-10-22 09:17:58 -05:00
32c3d049c0 adafruit_pixelbuf: Allow the buffer to be written in _transmit
This permits modifying the brightness of TM1814 strips at runtime.
2024-10-18 13:01:24 -05:00
Scott Shawcroft
57fa43a4d0
Merge pull request #9640 from gamblor21/audio_effects
Add Audio effects
2024-10-15 10:47:42 -07:00
gamblor21
e3228d00a9 Added frequency shift on echo option from @dcooperdalrymple 2024-10-14 10:00:08 -05:00
Scott Shawcroft
6ca0380d26
Merge pull request #9672 from samblenny/usb-device
Improve usb.core.Device exception handling and reporting
2024-10-08 13:52:52 -07:00
Sola85
af7d8b7d94
epaperdisplay: fix delay when two_byte_sequence_length is true 2024-10-08 09:03:08 +02:00
sam blenny
08bc84b4f4 revert usb.core.Device error message changes
This puts the error messages back like they were, leaving the null
pointer dereference fixes in place.
2024-10-07 17:50:22 +00:00
gamblor21
48e1327c0e Fix about incorrectly recalculating delay 2024-10-06 20:47:13 -05:00
gamblor21
0fa3cd8632 Removed utils.h which was not required 2024-10-05 18:03:03 -05:00
gamblor21
d2e5173e2d Merge remote-tracking branch 'origin/audio_effects' into audio_effects 2024-10-05 10:16:01 -05:00
gamblor21
cca8d00f6b Doc and error messaging changes 2024-10-05 10:08:42 -05:00
Mark
af171dab84
Merge branch 'main' into audio_effects 2024-10-03 20:38:49 -05:00
gamblor21
f5a8e3d138 Calculate current delay for a BlockInput correctly 2024-10-03 20:13:58 -05:00
gamblor21
af9321777d Documentation 2024-10-01 19:44:55 -05:00
gamblor21
3c204608f6 Fixed incorrectly updating sample remaining pointer 2024-09-30 21:23:45 -05:00
gamblor21
00a149a2c1 More comments and cleanup 2024-09-30 14:04:43 -05:00
gamblor21
70c0bf9254 8 bit unsigned samples working 2024-09-30 10:25:59 -05:00
sam blenny
6cc41f0bf9 return early after raising USBError
This commit makes sure that functions in usb.core.Device return as
soon as they raise a MicroPython exception rather than continuing
on with whatever code would normally run. This will hopefully help
to avoid things like dereferencing null pointers.
2024-09-30 01:18:18 +00:00
Dan Halbert
42db18ee51 merge from main 2024-09-29 17:00:02 -04:00
sam blenny
154ef2e36d Change USB NULL errors to short strings
shared-module/usb/core/Device.c had several spots where it would
raise a MicroPython exception with a NULL argument. That made it
very difficult for CircuitPython code to attempt to recover from
fault conditions caused by quirky USB device behavior. This adds
short error strings to distinguish the different types of faults.
2024-09-29 18:20:11 +00:00
gamblor21
bbd3e01665 Comments and couple tweaks 2024-09-28 11:22:05 -05:00
gamblor21
a851f102fe Error message for sample note matching made consistent 2024-09-28 09:38:20 -05:00
Dan Halbert
dc52fe3062
Update KeyMatrix.c: remove trailing spaces 2024-09-26 18:42:35 -04:00
Sean D. Cline
447cd1e02b Add a delay to KeyMatrix scan.
This gives the matrix columns time to discharge and settle down to
their resting state.
2024-09-26 09:27:33 -04:00
gamblor21
98b360a436 Double buffering 2024-09-24 21:25:43 -05:00
gamblor21
01a220af0f Started simplifying getbuffer 2024-09-23 21:24:30 -05:00
Eric Lammerts
ca53f8b390 Fix infinite loop when there's a partial frame at the end of the file. 2024-09-23 16:46:20 -04:00
gamblor21
477480705a Delay and Decay to BlockInput 2024-09-22 13:12:17 -05:00
gamblor21
d88b0c7840 Change mix to BlockInput 2024-09-21 15:51:38 -05:00
Dan Halbert
eff544c16c espressif: get new I2C driver working
- Starts with @tannewt's changes.
- Make sure proper component is being compiled.
- Added `I2C.probe()` as a visible new method. This was a hidden common-hal method, but the C version of adafruit_bus_device could not use it because it needs to call probe via a Python method call. So make it visible. It's useful, and `I2C.scan()` could be phased out, since now `.scan()` can be implemented in Python with `.probe()`.
- set clock-stretching timeout on espressif to a minimum of 1 second. In all impls of busio.I2C()`, the timeout is ignored and is set to a fixed 1 second. @tannewt's new code was using the passed-in value, which was often too short.

To do:
- switch esp-camera to new-driver version. We have to use the same I2C driver everywhere.
- Check about I2CTarget.
2024-09-20 17:48:17 -04:00
Scott Shawcroft
e9f8ed41dc Switch to IDF 5.2 I2C API
Make busio.I2C use finalizers for reset instead of bulk reset. This
makes it easier to track and free the memory that the IDF allocates
internally for its "handle".
2024-09-19 14:47:45 -04:00
gamblor21
4da22c5634 Add mix parameter 2024-09-18 20:17:18 -05:00
RetiredWizard
32537edb09 esp32s3: Implement sdioio 2024-09-18 17:37:59 -04:00
gamblor21
ac5ccdba7a Renamed module 2024-09-17 17:52:44 -05:00
gamblor21
a950349180 Changes to properly handle samples 2024-09-17 17:52:44 -05:00
gamblor21
5e923038f3 Initial audio effects commit 2024-09-17 17:52:44 -05:00
Dan Halbert
1f68fffa13 merge from main 2024-09-10 16:36:32 -04:00