Commit Graph

30938 Commits

Author SHA1 Message Date
Jeff Epler
bc7feb30a5
synthio: implement FIR filtering
A 37-tap filter worked fine on RP2040 (prop maker) at 48kHz, so
you can probably pretty much go nuts on M7.
2023-05-11 19:00:44 -05:00
Jeff Epler
f52bb65da6
synthio: add some new manual tests 2023-05-11 18:59:06 -05:00
Jeff Epler
62e6de8ed5
synthio: Factor out synth_note_into_buffer, start adding filter buffer 2023-05-11 18:59:05 -05:00
Jeff Epler
9d8dcf7d33
synthio: endorse new test result 2023-05-11 18:59:02 -05:00
Jeff Epler
7845a1b13b
synthio: Add filter boolean property to Note objects 2023-05-11 17:58:09 -05:00
Jeff Epler
33fb771b76
synthio: Add filter argument to Synthesizer constructor
as step 1/n of adding FIR filtering
2023-05-11 17:56:11 -05:00
Jeff Epler
d3eda0ad52
synthio: fix a typing error 2023-05-11 17:32:42 -05:00
Jeff Epler
53e13f15a3
synthio: Finish ading SWEEP_IN 2023-05-11 16:53:40 -05:00
Jeff Epler
17df238145
synthio: doc fixes, rename BendType to BendMode 2023-05-11 15:23:54 -05:00
Jeff Epler
23baf02399
synthio: disable on a few boards where it doesn't fit 2023-05-11 15:22:48 -05:00
Jeff Epler
cbd02b74df
synthio: endorse updated test result 2023-05-11 10:22:55 -05:00
Jeff Epler
ec30963731
synthio: fix a -Warray-parameter diagnostic 2023-05-11 10:21:56 -05:00
Jeff Epler
89080564b4
synthio: Fix release time of zero-sustain envelopes
When there's no sustain, the release step needs to be calculated from
the attack level, not the sustain level. Otherwise, contrary to intent,
this leads to the actual release taking a loooonnngg time.
2023-05-11 10:19:48 -05:00
Jeff Epler
095e020809
synthio: Add ring modulation 2023-05-11 09:31:18 -05:00
Jeff Epler
e87e7ee54f
synthio: add stereo & Note.panning
A note can be placed in the center (panning=0) or moved to just the left
(panning=1) or right (panning=-1) channels. Fractional panning values
place it partially in both channels.
2023-05-11 09:31:18 -05:00
Jeff Epler
2062b2bfb7
synthio: add a noise program to the manual tests 2023-05-11 09:31:08 -05:00
Jeff Epler
1d1907b98b
synthio: Generalize vibrato into bend
bend can be static, sweep, or vibrato
2023-05-11 09:31:07 -05:00
Jeff Epler
c48d385e94
synthio: Add synthio.BendType 2023-05-11 09:31:07 -05:00
Jeff Epler
91978522c5
synthio: Add adafruit_wave and use it in the manual test 2023-05-11 09:31:07 -05:00
Scott Shawcroft
93b0e5b746
Merge pull request #7958 from ajs256/add-display-sprig
Add board.DISPLAY to hack_club_sprig
2023-05-10 11:45:19 -07:00
Alex Sirota
55d8f0db4e Add board.DISPLAY to hack_club_sprig 2023-05-10 11:24:26 -07:00
Scott Shawcroft
08874af0e8
Merge pull request #7957 from tekktrik/dev/stubs-building
Updated how stubs are built
2023-05-10 11:20:24 -07:00
Tekktrik
57cd451245 Add build to pio install command 2023-05-09 22:31:24 -04:00
Tekktrik
6f8670a284 Updated how stubs are built 2023-05-09 22:01:24 -04:00
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
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
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
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