Commit Graph

2696 Commits

Author SHA1 Message Date
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 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 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
Jeff Epler bd9aca2526
Merge pull request #7862 from jepler/synthio-envelope
Synthio envelope
2023-05-03 12:42:56 -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
Jeff Epler b2f32a5397
Apply suggestions from code review
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-05-02 19:22:10 -05:00
Jeff Epler c369527ace
remove line added while debugging failed doc builds
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-05-02 19:17:51 -05:00
Scott Shawcroft 750615f2da
Merge pull request #7430 from Lanzaa/rp2040_cpu_frequency
Add frequency setting for RP2040 boards.
2023-05-02 09:52:28 -07:00
Dan Halbert c333e61681
small wording change 2023-04-26 14:58:45 -04:00
anecdata 6e8031faf8
Note limitation of next_stack_limit on espressif boards
Open to better wording.
2023-04-26 13:53:33 -05:00
Dan Halbert 34f565dd89
Merge pull request #7891 from tannewt/fix_epd_uc
Add address_little_endian and fix display memory reuse
2023-04-26 00:27:59 -04:00
Scott Shawcroft 75046b3a58
Save space with consolidated errors 2023-04-25 13:26:48 -07:00
Jeff Epler 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
Jeff Epler 375a9cd4c5
add Synthesizer.release 2023-04-25 12:05:50 -05:00
Dan Halbert abb0d5e620
Merge pull request #7899 from RetiredWizard/displayioDOC
Doc fix for root_group=None behaviour
2023-04-24 18:57:29 -04:00
Scott Shawcroft 3ee8d0b5cb
Merge pull request #7878 from gamblor21/gifio_palettes
Palettes for OnDiskGif
2023-04-24 12:44:53 -07:00
Dan Halbert ac82f8f90b
document displayio.CIRCUITPYTHON_TERMINAL 2023-04-24 13:43:09 -04:00
Dan Halbert 738f626663
Code formatting in doc 2023-04-24 12:54:37 -04:00
RetiredWizard 3cf712556b Add CIRCUITPYTHON_TERMINAL usage description 2023-04-23 01:03:13 -04:00
RetiredWizard 0c00220aa6 Removing unrelated change by local pre-commit 2023-04-23 00:52:48 -04:00
RetiredWizard b2b24231bc local pre-commit changes 2023-04-23 00:45:38 -04:00
RetiredWizard b0ea28a031 Doc fix for root_group=None behaviour 2023-04-23 00:33:14 -04:00
foamyguy 56fd7dcf0a add minimum validation for tilegrid size in terminalio.Terminal 2023-04-21 18:00:16 -05:00
Scott Shawcroft 7089ea4d65
Add address_little_endian for displayio
Add address_little_endian for epaper displays with little endian
(low byte first) addresses.

Also clears allocated display and display bus memory so it has a
known state. The acep member wasn't always set so it varied
accidentally.

Fixes #7560. May fix #7778. Fixes #5119.
2023-04-21 12:19:29 -07:00
Mark ae7303221d
Update doc that Palette may not always be there
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-04-21 11:21:29 -05:00
gamblor21 afae39765f PR review fixups 2023-04-20 18:26:04 -05:00
Dan Halbert 81c5a37e2d
Merge pull request #7867 from RetiredWizard/DispIOSizeValid
displayio arg validation tweaking
2023-04-20 14:52:24 -04:00
Dan Halbert 7d02bff6b8
Merge pull request #7880 from tannewt/feather_dvi
Add PicoDVI support
2023-04-20 14:50:10 -04:00
Dan Halbert 4b41a49200
Merge pull request #7866 from rich123/allow-64-char-wifi-passwords
Allow 64 char WiFi passwords in wifi.radio.connect
2023-04-20 10:22:44 -04:00
Dan Halbert df41bd9ead change hex radio password validation; add password length doc 2023-04-20 09:47:25 -04:00
Scott Shawcroft 0f9fb33371
Merge branch 'main' into rp2040_cpu_frequency 2023-04-19 17:05:58 -07:00
Scott Shawcroft e2ab7a4751
Change voltage. Refine docs 2023-04-19 17:04:54 -07:00
Scott Shawcroft 66edcf5d03
Add PicoDVI support
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.

Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes #7562

Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes #7643

This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
2023-04-19 15:14:02 -07:00
gamblor21 403ea89d57 Initial paletts for OnDiskGif 2023-04-18 19:44:03 -05:00
Debian 304134c6a4 Fixed outdated reference link 2023-04-17 12:54:59 -06:00
RetiredWizard a4cb73a567
Add MAX(0,xxx-1) to prevent potential display wrap 2023-04-16 18:42:00 -04:00
RetiredWizard a8c78d8d2e displayio arg validation tweaking 2023-04-15 23:44:30 -04:00
Richard Ellis ec78a23a56 Code changes to allow 64 character hex WiFi passwords to be used with
wifi.radio.connect.

Fixes adafruit/circuitpython#7677.
2023-04-15 22:54:57 -04:00
applecuckoo add8f06b75
urandom is supported on nRF boards 2023-04-10 15:27:15 +12:00
Jeff Epler 992457c7f7
Improve documentation 2023-04-05 16:53:09 -05:00
Scott Shawcroft 6df88ac948
Merge pull request #7825 from jepler/better-synthio
Better synthio
2023-04-05 12:23:10 -07:00
Jeff Epler 9679aaa0be
Apply suggestions from code review
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-04-05 11:57:06 -05:00
Jeff Epler 3038b9a560
Update shared-bindings/keypad/ShiftRegisterKeys.c
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-04-05 11:56:21 -05:00
Jeff Epler b9dea05dbf
Enable audiomixer on unix port, for testing 2023-04-05 09:02:03 -05:00
Jeff Epler 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
Jeff Epler 975c981e4f
fix some calls that needed to be _varg 2023-04-02 11:55:14 -05:00
Jeff Epler 8b05d11538
save 4 bytes memory since qstr constants are smol 2023-04-01 19:25:30 -05:00