Commit graph

105 commits

Author SHA1 Message Date
f83212314e
synthio: Add LFOs 2023-05-15 21:15:39 -05:00
9d8dcf7d33
synthio: endorse new test result 2023-05-11 18:59:02 -05:00
17df238145
synthio: doc fixes, rename BendType to BendMode 2023-05-11 15:23:54 -05:00
cbd02b74df
synthio: endorse updated test result 2023-05-11 10:22:55 -05:00
1d1907b98b
synthio: Generalize vibrato into bend
bend can be static, sweep, or vibrato
2023-05-11 09:31:07 -05:00
c031bda5dd
synthio: implement a range compressor with hard knee
This really improves the loudness of the output with multiple notes
while being a nice simple algorithm to implement.
2023-05-08 09:22:42 -05:00
a53c0ed066
synthio: add onevo_to_hz, implement midi_to_hz in terms of it
this has the side effect of making some notes more accurate, the new
frequency= value in the test is closer to the true midi frequency of
830.609...Hz.
2023-05-06 21:35:19 -05:00
a7da245ad0
synthio: Add synthio.Note
This class allows much more expressive sound synthesis:
 * tremolo & vibrato
 * arbitrary frequency
 * different evelope & waveform per note
 * all properties dynamically settable from Python code
2023-05-04 07:23:49 -05:00
d8550f4e7c
synthio: fix offset in default square waveform 2023-05-03 09:37:02 -05:00
12c1a72f03
synthio: implement envelope
This works for me (tested playing midi to raw files on host computer, as
well as a variant of the nunchuk instrument on pygamer)

it has to re-factor how/when MIDI reading occurs, because reasons.

endorse new test results

.. and allow `-1` to specify a note with no sustain (plucked)
2023-04-25 12:05:53 -05:00
Scott Shawcroft
e0a7edbe54
Merge pull request #7838 from jepler/more-aes-vectors
add more test vectors for aes
2023-04-06 09:54:57 -07:00
8c8ca3b810
endorse new test outputs 2023-04-06 10:21:27 -05:00
09bc8fbdc0
add more test vectors for aes 2023-04-05 14:55:41 -05:00
14637cd75a
update tests with new expected results 2023-04-05 12:00:05 -05:00
b011468251
Add synthio.Synthesizer
In contrast to MidiTrack, this can be controlled from Python code,
turning notes on/off as desired.

Not tested on real HW yet, just the acceptance test based on checking
which notes it thinks are held internally.
2023-04-02 20:37:23 -05:00
7bbb2ed898
add a basic acceptance test of MidiTrack 2023-04-02 13:48:23 -05:00
349dedca54
struct: Check that argument counts match, similar to cpython3
.. and test our struct module during the build-time tests

Closes #7771
2023-03-22 09:35:09 -05:00
cc16bd3d53
do not chain exceptions to themselves
cpython actually makes sure the newly chained exception doesn't create
a cycle (even indirectly); see _PyErr_SetObject use of "Floyd's cycle
detection algo". We'll go for the simpler solution of just checking
one level deep until it's clear we need to do more.

Closes: #7414
2023-01-04 08:40:20 -06:00
2c46e785f6
update test results 2022-12-28 12:38:07 -06:00
83bbfd1815
Allow the tests to directly call the non-heap using _int and _str variants
.. of getenv. These can have their own special bugs.
2022-12-28 12:36:58 -06:00
edcb832661
These need to be double-blackslashed 2022-12-28 12:35:48 -06:00
337b1da143
Explicitly test \n and \r\n files
\r\n files must be working due to micropython's built in handling of
text-mode files, I didn't implement it.

\r-only (old mac text-mode files) are explicitly not supported by
the toml format.
2022-12-26 10:53:58 -06:00
f6b69cf5e3
Allow settings.toml to end without a newline 2022-12-26 10:53:58 -06:00
6426ddb73b
Rename test and add some additional cases
While working on adding 0o and 0b literals (which aren't added yet and
may not be) I realized that my approach would likely cause a problem
for the value "0"
2022-12-12 08:22:54 -06:00
dd6dd5df21
rework the getenv test again
* use a virtual fat filesystem during the test
 * this makes the file I/O part more closely patch runtime which is nice
 * side-steps the need to add a special function for testing
   * but test still can't be run on a device, because the vfs calls
     are incompatible, and you intentionally can't remount "/" anyway
 * and side-steps problems with storing 'bad' toml files
2022-12-10 12:58:08 -06:00
3ab71d7448
Rename test function, make 'bad' files binary & add another test 2022-12-09 15:23:56 -06:00
6dca9db225
Rename test function & fix a bug with default value handling 2022-12-09 14:35:50 -06:00
3459fe322b
Withdraw the _environ module
This existed solely for testing, so expose it a different way during
the unix coverage build

Also turn off os.getenv support on samd21.
2022-12-08 15:33:10 -06:00
ef2bfdb5db
dotenv becomes settings.toml 2022-12-08 12:44:20 -06:00
b83c42e41a
Implement the chain= argument of traceback.print_exception 2022-12-02 10:50:31 -06:00
dd443bacb8
Chain exceptions while unwinding 2022-11-13 19:53:23 -06:00
b6f86e1e73
Recursively print chained exceptions 2022-11-13 19:53:21 -06:00
55519670a8
Fix parsing long dotenv values
Values that exceeded the stack buffer of 64 bytes were incorrectly
handled.

A new test is added.
2022-10-13 16:41:30 -05:00
febc7a8514
format_traceback: Return list, as documented, and compatible with CPython 2022-10-13 09:38:43 -05:00
9ecb905061
Test new-style exception printing 2022-10-13 09:38:43 -05:00
c6bbb0e4f6
test format_exception too 2022-10-13 09:38:41 -05:00
27e6623657
Add unicode support to dotenv
Newly passing tests:
```
aa🐍bb=key with emoji
value_with_emoji=aa🐍bb
```
2022-10-05 18:18:07 -05:00
Dan Halbert
91079279da Allow spaces before = in dotenv 2022-10-05 15:50:53 -04:00
718b8e706e
disable test e15 for now 2022-10-04 10:54:22 -05:00
52bca95208
Refactor dotenv module so that it can be tested on host
.. it needs to operate on a FILE* rather than FIL depending on
the build.

Note that this is comparing output to expected, not to cpython dotenv
package. Because run-tests.py starts the CPython interpreter with the
'-S' (skip site initialization) flag, pip-installed packages are
not available for import inside a test file. Instead, the exp
file is generated manually:
```
circuitpython/tests$ python3 circuitpython/dotenv_test.py > circuitpython/dotenv_test.py.exp
```

Unfortunately, the test fails on test e15:
```diff
FAILURE /home/jepler/src/circuitpython/tests/results/circuitpython_dotenv_test.py
--- /home/jepler/src/circuitpython/tests/results/circuitpython_dotenv_test.py.exp	2022-10-04 09:48:16.307703128 -0500
+++ /home/jepler/src/circuitpython/tests/results/circuitpython_dotenv_test.py.out	2022-10-04 09:48:16.307703128 -0500
@@ -14,7 +14,7 @@
 line
 e13 e13value
 e14 None
-e15 e15value
+e15 None
 e16 #
 e17 def
 e18 #has a hash
```
2022-10-04 09:51:27 -05:00
Mark
8ed7b114cd
Merge branch 'main' into uzlib-module 2022-04-03 11:48:37 -05:00
gamblor21
0d3f45bef8 Remove move DecompIO files 2022-03-27 16:18:56 -05:00
gamblor21
ce4a0806b3 Added test coverage 2022-02-21 10:24:13 -06:00
34d71097ff
Fix import ulab.foo 2022-02-19 09:32:51 -06:00
microDev
7e46387196
add non-native exception in traceback_test
Co-authored-by: Dan Halbert <halbert@adafruit.com>
2021-12-15 20:48:33 +05:30
microDev
69faaa52b8
run test for traceback module 2021-12-02 14:55:02 +05:30
1654f5fb58
add an aes test
This combines some test vectors from the implementation & a NIST
standards document, plus the code from the docstring.

The test vectors were eyeball-verified.
2021-11-30 15:26:32 -06:00
d4dd06904a
add a test of rainbows 2021-11-12 17:31:14 -06:00
1c73e2e466
tests: Remove a non-useful test 2021-11-12 17:31:13 -06:00
microDev
7dbf750dd0
add test for traceback module 2021-09-03 20:52:30 +05:30
microDev
1c4a6c3667
atexit module refinements
- add test for atexit module
- add callback to gc collection
- fix callback memory allocation
- execute callback on both code and repl exit
2021-08-16 21:37:32 +05:30
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Scott Shawcroft
99153569f4 tests: Fixup tests for 3.x on Rosie 2017-11-16 10:56:20 -08:00
Scott Shawcroft
266be30777 atmel-samd: Introduce a nvm module for non-volatile byte-level memory access. (#203)
* atmel-samd: Introduce a nvm module for non-volatile byte-level memory access.

This allows for persisting small configuration values even when the file system
is read-only from CircuitPython.

Fixes #160

* Review feedback:
* Add tests.
* Fix non-zero index.
* Fix len()
2017-08-25 16:00:27 -04:00
Scott Shawcroft
fab634e3ee Turn on Rosie CI testing to test new builds on real hardware.
This introduces a skip_if module that can be used by tests to
determine when they should be skipped due to the environment.

Some tests have been split in order to have finer grained skip
control.
2017-08-11 17:16:13 -07:00