Commit graph

27 commits

Author SHA1 Message Date
dcooperdalrymple
e049337147 Allow variable mix down sample scale. 2025-01-17 18:24:18 -06:00
dcooperdalrymple
99b4fae790 Remove unnecessary copies of mix_down_sample. 2025-01-17 17:04:03 -06:00
dcooperdalrymple
48f272e667 Fix build errors. 2025-01-17 17:01:59 -06:00
dcooperdalrymple
ec5b1e8f7a Add mix_down_sample to echo output. 2025-01-17 16:54:50 -06:00
dcooperdalrymple
05db339c95 Remove truncation of delay_ms within buffer processing loop. 2025-01-17 16:52:19 -06:00
dcooperdalrymple
5fbbeed716 Call shared_bindings_synthio_lfo_tick on audioeffects in SYNTHIO_MAX_DUR intervals. 2024-12-12 11:45:54 -06:00
dcooperdalrymple
0e64e1cf75 Implement block ticking within audio effects. 2024-12-12 11:01:30 -06:00
dcooperdalrymple
222ce2c782 Apply similar updates to audiofilters.Filter and audiodelays.Echo: MICROPY_FLOAT_CONST, MP_ROM_INT, and synthio_block_slot_get_limited. 2024-12-10 09:33:35 -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
dcooperdalrymple
0aab00d7e5 Fix 16-bit unsigned integer silence within audio effects. 2024-11-05 08:41:23 -06:00
gamblor21
e3228d00a9 Added frequency shift on echo option from @dcooperdalrymple 2024-10-14 10:00:08 -05: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
cca8d00f6b Doc and error messaging changes 2024-10-05 10:08:42 -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
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
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
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
gamblor21
4da22c5634 Add mix parameter 2024-09-18 20:17:18 -05:00
gamblor21
ac5ccdba7a Renamed module 2024-09-17 17:52:44 -05:00