Commit Graph

31031 Commits

Author SHA1 Message Date
Scott Shawcroft 7e734df892
Merge pull request #7951 from Neradoc/pystack-doc-and-size
Document CIRCUITPY_PYSTACK_SIZE
2023-05-09 09:14:17 -07:00
Scott Shawcroft f8cbdf88e5
Merge pull request #7947 from FoamyGuy/polygon_point_typecheck
validate point type is tuple in vectorio Polygon
2023-05-09 09:12:17 -07:00
Neradoc bb2af51d25 document CIRCUITPY_PYSTACK_SIZE 2023-05-09 14:30:25 +02:00
anecdata 29bf64decb raspberrypi common-hal f(x)s Not Implemented 2023-05-08 22:41:33 -05:00
foamyguy 7c685477ba adding __contains__ stub to displayio.Group 2023-05-08 16:41:57 -05:00
foamyguy 56d9798b1d validate point type is tuple in vectorio Polygon 2023-05-08 15:39:19 -05:00
Scott Shawcroft 9e4dea7b15
Merge pull request #7933 from jepler/synthio-note
synthio: add 'Note' with arbitrary frequency and more
2023-05-08 13:32:37 -07:00
anecdata 82c173e8cf assuming the answer to that is 'yes' 2023-05-08 14:26:01 -05:00
anecdata d78e5bd64c fix accidental indent 2023-05-08 14:18:06 -05:00
anecdata 7581d3d0b0 Fix docstring 2023-05-08 13:30:32 -05:00
anecdata 2f2a9e7e28 Allow Access Point static IPv4 on the espressif port. 2023-05-08 13:25:52 -05:00
Scott Shawcroft 7cd65ffb40
Merge pull request #7942 from furbrain/main
Add memorymap support to nrf boards
2023-05-08 10:42:29 -07:00
Scott Shawcroft 6c39077616
Merge pull request #7939 from RetiredWizard/silabsrtc
silabs/supervisor/port.c Add call to rtc_reset to prevent crash to safe mode
2023-05-08 10:20:30 -07:00
Jeff Epler 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
Phil Underwood bcd9d6bacc Add memorymap to nrf52840 devices only 2023-05-07 18:21:22 +01:00
Phil Underwood fe90cc759a remove excess line 2023-05-07 16:09:44 +01:00
Phil Underwood a31dc5cc70
Merge branch 'adafruit:main' into main 2023-05-07 16:07:16 +01:00
Phil Underwood 3abcc6a2c3 Add memorymap support for the nRF processors.
This gives very permissive access to the internals of the microprocessor.
It needs the user to be **very** careful that they do not break things
2023-05-07 15:58:25 +01:00
Bill Sideris f63aac9e52
Merge branch 'adafruit:main' into m5timer 2023-05-07 16:49:02 +03:00
Bill Sideris f4079b6799
add preliminary support for m5stack_timer_camera_x 2023-05-07 16:47:57 +03:00
Jeff Epler 9a9f3229fa
synthio: Perform vibrato in pitch, not as frequency ratio
Now the vibrato 'units' are 1.0 = one octave, 1/12 = one semitone,
1/1200 = one cent. Before, the units were somewhat arbitrary and were not
perceptually "symmetrical" around the base frequency.

For vibrato_depth = 1/12 and base frequency of 440,

before: pitch from 403.33 to 476.67Hz, not corresponding to any notes
after: pitch from 415.30 to 466.16Hz, corresponding to G# and A#
2023-05-06 21:35:20 -05:00
Jeff Epler 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
Jeff Epler a854e554f4
synthio: add midi_to_hz to docs 2023-05-06 21:35:16 -05:00
RetiredWizard a52d0c742e Add call to rtc_reset 2023-05-06 03:16:38 -04:00
Kattni 018f15de95
Merge pull request #7938 from jepler/issue5980
Fix crash with fast ping on espressif
2023-05-05 18:52:02 -04:00
Jeff Epler 66411fdd38
espressif: check return value from esp_ping_new_session
esp_ping_new_session can fail, particularly if ping is called quickly
many times in succession.

This is because `esp_ping_new_session` has to do a bunch of stuff
including creating a task and a socket. Calling `esp_ping_delete_session`
doesn't clean up these resources immediately. Instead, it signals the
task to clean up resources and exit 'soon', but 'soon' is defined as 1
second.

When the calls are frequent, the in-use sockets and tasks fill up
available slots—I didn't actually check which resource gets used
up first.

With this change, the ping call will raise an exception instead of
continuing with a call to esp_ping_start that crashes.

Closes #5980 based on my testing on an ESP32S3-N8R2.
2023-05-05 17:11:03 -05:00
Jeff Epler 5c857209fd
Merge pull request #7934 from tekktrik/fix/venv-bug
Fix creating virtual environment for stub creation
2023-05-05 09:29:04 -05:00
Alec Delaney 298bd16529
Fix creating virtual environment for stub creation 2023-05-04 15:55:33 -04:00
Jeff Epler d2aca7eba0
synthio: fix per-note envelope & envelope modification
.. and simplify the envelope advance logic by handling
'instant' values more intelligently.
2023-05-04 12:23:45 -05:00
Scott Shawcroft fa9b59d14c
Merge pull request #7915 from RetiredWizard/picodvi
Add Pimoroni Pico dv Demo Base (pico only)
2023-05-04 10:07:48 -07:00
Jeff Epler eebd4a7f52
synthio: no longer fits on feather m4 can 2023-05-04 10:16:58 -05:00
Jeff Epler a94031d094
synthio: make most Note constructor args kw-only
for similar reasons as Envelope. The mandatory frequency argument can
still be given as a positional argument.
2023-05-04 10:16:19 -05:00
Jeff Epler c839888e28
synthio: rename function that records error position 2023-05-04 08:45:31 -05:00
Jeff Epler a388a59543
rp2040: fix audio glitch at soft-reload
The internal flash cache wasn't being properly used, because
`write_blocks` unconditionally performed the flash write.

Fixing this so that the write's not done until `internal_flash_flush`
fixes the problem in my test program with i2sout & synthio.

as a future optimization, `flash_read_blocks` could learn to read out
of the cache, but that's probably not super important.
2023-05-04 08:41:23 -05:00
Jeff Epler e23e7d3b3f
synthio: get_buffer: return error if object deinited
this may fix a weird crash during shutdown
2023-05-04 07:45:45 -05:00
Jeff Epler 2b0231e9d3
synthio: re-striking a note should re-enter attack
.. without changing the current note amplitude
2023-05-04 07:23:50 -05:00
Jeff Epler 021aaa4599
synthio: remove unused 'phase' from Note objects 2023-05-04 07:23:50 -05:00
Jeff Epler 1701552dec
synthio: make sustain level relative to attack level
and re-vamp overall envelope calculation again.

Now, if you set a low overall attack level like 0.2 this avoids the
"diminishing volume" effect when many notes sound at once. You need
simply choose a maximum attack level that is appropriate for the max
number of voices that will actually be played.
2023-05-04 07:23:50 -05:00
Jeff Epler c06597c07a
synthio: replace the quietest releasing note when over-writing 2023-05-04 07:23:49 -05:00
Jeff Epler 4f56b7646e
synthio: slow ramp overall envelope back up
.. and account releasing notes at their sustain level until they're
done.

this ameliorates the effect where multiple releasing notes
don't seem to actually be releasing, but stay at a constant volume.
2023-05-04 07:23:49 -05:00
Jeff Epler 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
Jeff Epler bc03e03b9e
util: Add properties_print_helper 2023-05-04 07:23:48 -05:00
Jeff Epler c22fd2a18e
runtime: Add mp_arg_validate_float_range 2023-05-04 07:23:48 -05:00
Jeff Epler 5514e3065d
synthio: add midi_to_hz
to convert notes in the MIDI 1-127 note scale to floating point Hz
2023-05-04 07:23:48 -05:00
RetiredWizard 4f7d88676b Remove pico-w version 2023-05-03 17:30:01 -04:00
Jeff Epler bd9aca2526
Merge pull request #7862 from jepler/synthio-envelope
Synthio envelope
2023-05-03 12:42:56 -05:00
Jeff Epler b33c9f6b4b
synthio: put license notice on copied files 2023-05-03 09:37:12 -05:00
Jeff Epler 1fafa4dc24
synthio: improve Envelope constructor 2023-05-03 09:37:04 -05:00
Jeff Epler eea9b62978
synthio: MidiTrack: sample_rate is always available 2023-05-03 09:37:02 -05:00
Jeff Epler dd262258e0
synthio: Add `MidiTrack.error_location` to record errors
.. instead of just printing the unraiseable error on the repl
2023-05-03 09:37:02 -05:00