Commit graph

2751 commits

Author SHA1 Message Date
Dan Halbert
1d90a0ea3e py/objint.c: int.from_bytes and .to_bytes can omit byteorder arg 2025-01-06 11:16:02 -05:00
Damien George
882499569c py/runtime: Fix self arg passed to classmethod when accessed via super.
Thanks to @AJMansfield for the original test case.

Signed-off-by: Damien George <damien@micropython.org>
2024-12-29 13:20:54 -05:00
22abf2df02 MP3Decoder: clear out DSP data when opening a new stream
The new test verifies that the first part of an MP3 decodes as
expected even when the "open" method is used.

Closes: #9705
2024-12-04 13:55:09 -06:00
Hurst, Brandon
ff87a70f9c Updated USB PID for max32690evkit 2024-11-25 15:28:41 -08: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
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
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
f7f471f9de
Merge pull request #9788 from dcooperdalrymple/synthio_waveform_loop_blockinput 2024-11-04 15:11:40 -06:00
dcooperdalrymple
fd24006901 Updated expected results for synthesizer_note test. 2024-11-04 13:33:16 -06:00
a3d7eb6b04 fix tests & add expected results 2024-11-04 12:05:55 -06:00
53bd93c8f6 Add basic block biquad test 2024-11-04 09:56:36 -06:00
9113e171ba Throw TypeError when json-serializing invalid types
This behavior is in line with standard Python

Closes: #9768
2024-11-04 09:16:44 -06: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
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
71eea30639 keep PYTHONPATH when requested
This turns out to be needed by the testsuite of jepler_udecimal, which
needs to add the `jepler_udecimal` directory both to PYTHONPATH and
MICROPYPATH.
2024-09-23 21:02:08 -05:00
Dan Halbert
c0a3e28079 tests/run-natmodtests.py: remove use of zlib examples 2024-09-13 09:26:54 -04:00
Dan Halbert
50f01014b4 revert to using os.mount, etc. instead of vfs.mount 2024-09-10 18:23:39 -04:00
Dan Halbert
483268314b restore tests/unix; deleted by mistake 2024-09-10 17:57:27 -04:00
Dan Halbert
1f68fffa13 merge from main 2024-09-10 16:36:32 -04:00
Dan Halbert
0c26a114a4 fix tests; asyncio: avoid coroutine never awaited 2024-09-10 16:05:21 -04:00
Dan Halbert
02e11a9413 fix compilation issues; remove more uctypes mentions 2024-09-10 16:04:47 -04:00
Dan Halbert
7812695281 non-conflict merge changes 2024-09-05 14:54:18 -04:00
timdechant
da581102f6 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:48:53 -04:00
timdechant
319fb89d31 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:48:33 -04:00
timdechant
67c8b07343 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:47:19 -04:00
timdechant
8b873b65ac shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:47:05 -04:00
timdechant
c6c4c79330 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:41:34 -04:00
Dan Halbert
ac7e15f88a (only) reserve merge conflicts 2024-08-28 16:31:37 -04:00
Dan Halbert
b94815ccc8 tests/extmod/select_poll_fd.py: disable fd limit test 2024-08-20 21:22:10 -04:00
Dan Halbert
342f7a9daa tests/micropython/import_mpy_native_gc.py: update native .mpy 2024-08-19 13:04:06 -04:00
Dan Halbert
29216d7485 asyncio update; set fd max in test 2024-08-17 12:22:03 -04:00
Dan Halbert
4d72d6ad25 update asyncio library and fix tests 2024-08-16 23:46:29 -04:00
Dan Halbert
6f721b3dbe fix more tests; get some tests from v1.23 or later 2024-08-06 22:10:39 -04:00
Dan Halbert
4b0aee4903 fix some tests 2024-08-06 16:23:12 -04:00
Dan Halbert
be6fa2af21 merge from main 2024-07-29 17:41:46 -04:00
Dan Halbert
69b667406b MPy v1.22 merge: initial merge; not compiled yet 2024-07-25 15:16:24 -04:00
Scott Shawcroft
612bf209b5
Merge pull request #9421 from timchinowsky/rawsample-doublebuffer
Add double buffering to RawSample
2024-07-22 13:24:30 -07:00
Tim
e8a7700af4 add looping to rp2040 analogbufio.BufferedIn 2024-07-18 12:03:15 -07:00
Tim
a1fe288ab8 make loop=True required for constant play, add test code 2024-07-16 13:47:09 -07:00
Tim
6c1227efdd add tests of pwm extremes 2024-07-03 10:21:34 -07:00
Tim
8a1b3e7cfc disallow duty cycle rounding to 0 2024-07-03 09:37:55 -07:00
Dan Halbert
d35c2e34b0 tests/circuitpython-manual/pwmio: shrink png images 2024-06-21 14:16:59 -04:00
Tim
59e604c783 move pwm test to tests/circuitpython-manual 2024-06-20 09:58:37 -07:00
2f3d371762 update expected result due to addition of audiomp3 module 2024-05-30 14:49:09 -05:00
Damien George
30a9ccf4ca tests/basics: Move str/bytes tests that give SyntaxWarning to sep file.
In CPython 3.12 these invalid str/bytes/fstring escapes will issue a
SyntaxWarning, and so differ to MicroPython.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:58:37 +10:00
Damien George
dd4767a7d1 tests/basics: Add .exp file for slice_op test.
CPython 3.12 implemented hashing for slices, so now differs to MicroPython.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:50:57 +10:00
Damien George
ad6750b22e tests/float: Use "not" instead of ~ to invert bool value.
Otherwise CPython gives a deprecation warning.

This test is not actually testing inversion of bools, rather that bit of
the test is used to compute the pass/fail result.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:49:22 +10:00
Damien George
a34b5d1b79 tests/net_inet/tls_text_errors.py: Tweak test for newer CPython version.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00
Damien George
e1111d873a tests/net_hosted/ssl_verify_callback.py: Make exp match actual output.
The `cert` argument passed to the verify callback is actually a memoryview.
And the `depth` argument seems to start at 1 for the tested URL.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00