Commit graph

1701 commits

Author SHA1 Message Date
foamyguy
c63e565334 move 'after' print to cut a duplicate line 2024-12-01 21:42:51 -06:00
foamyguy
a32a318ab3 fix vectorio rotation issue 2024-12-01 20:37:19 -06:00
Hurst, Brandon
e6c4c78813 - Fixed USB endpoint descriptor problems. All USB classes should now be usable. - Had to adjust some shared modules to account for MAX32 devices not supporting IN/OUT endpoints on the same EP # 2024-11-25 15:28:41 -08:00
Dan Halbert
c5a929e51b fix keys.*.reset() behavior to send pressed instead of released events 2024-11-19 17:26:24 -05:00
Mark
92ef41083a
Merge pull request #9756 from jepler/synthio-blockbiquad
synthio: Add a form of biquad filter that uses BlockInputs
2024-11-10 17:43:58 -06:00
de9b0b6b1b
Merge pull request #9772 from relic-se/audiofilters_filterlist 2024-11-10 09:13:34 -06:00
dcooperdalrymple
c96d1428e1 Remove unnecessary m_malloc_fail and deinit from memory allocation routines. 2024-11-07 19:06:25 -06:00
c377123d0b BlockBiquad: Only recalculate when needed. 2024-11-07 14:14:13 -06:00
c06e6ee03e BlockBiquad: Use Q as argument name
Synthesizer.lpf takes `Q` as the argument name, use the same convention
here.
2024-11-07 13:59:23 -06:00
dcooperdalrymple
5f8ec0afc6 Validate type of filter tuple items. 2024-11-07 13:58:01 -06:00
dcooperdalrymple
941e1228f2 Rename filters back to filter and support individual Biquad object and tuple of Biquad objects. 2024-11-07 13:03:59 -06:00
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
14b1383b6b Remove trailing whitespace to fix pre-commit. 2024-11-05 08:47:24 -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
6badb92de8 Add support for list of Biquad objects within audiofilters.Filter. 2024-10-29 12:52:27 -05:00
21ebcad778 Add notch filter to BlockBiquad 2024-10-24 21:02:40 -05:00
e891bce129 Rename FilterType -> FilterMode 2024-10-24 20:53:31 -05:00
1fef6b4105 BlockBiquad: improve docs & make parameter names match old filter methods 2024-10-24 11:40:13 -05:00
ce0c1c77a4 Add BlockBiquad
BlockBiquad takes kind, f0 (center frequency) & Q (sharpness)
block type arguments and calculates the actual filter coefficients
every frame.

This allows the filter characteristics f0 and Q to be changed dynamically
from LFOs & arithmetic blocks.

A new manual test demonstrates this on a host computer, playing a simple
tone that is dynamically filtered.
2024-10-24 11:39:23 -05: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