Commit Graph

2732 Commits

Author SHA1 Message Date
Jeff Epler c5615995d9
synthio: fix docstring 2023-05-21 13:22:49 -05:00
Jeff Epler c084ab92c8
synthio: Enable `synthio.MathOperation.SUM(3,4,5)` 2023-05-21 13:22:48 -05:00
Jeff Epler 4ff08e02eb
synthio: lfo: bugfixes & improvements
LFO waveforms are now linearly interpolated by default, but a new
property (interpolated=False) can disable this.

The 'once' logic was improved
2023-05-21 13:22:47 -05:00
Jeff Epler e6c4d12eaf
synthio: doc improvement 2023-05-21 13:22:47 -05:00
Jeff Epler e0cfae1d05
synthio: add (untested) phase offset 2023-05-21 13:22:46 -05:00
Jeff Epler bd2a153eae
synthio: there is a midi note 0 2023-05-17 16:37:12 -05:00
Jeff Epler 391438102b
synthio: Finish implementing Math blocks 2023-05-17 16:32:20 -05:00
Jeff Epler 5de4d197a2
synthio: start generalizing LFO to Block 2023-05-17 15:05:34 -05:00
Jeff Epler 3d2db5dbe0
synthio: improve documentation, simplify synthio_lfo_obj_tick_scaled 2023-05-17 11:13:15 -05:00
Jeff Epler d4294de62b
synthio: Allow bends of more than one octave
up to +-12 sounds good, right?
2023-05-16 16:58:04 -05:00
Jeff Epler 0b926f8fd4
synthio: improve release/press/change
Semi-incompatible name change: The method `release_then_press`
is now `change`. For now a compatibility alias is supported.

Everywhere a `NoteSequence` was accepted, a single note is now accepted.
So for instance, `synth.press(30)` can be written instead of requiring
``synth.press((30,))`. The same goes for `change.retrigger`, which
will accept a single LFO or a sequence.
2023-05-16 10:26:56 -05:00
Jeff Epler b2c6f9b1a4
synthio: add Synthesizer.lfo, retrigger option 2023-05-16 10:07:07 -05:00
Jeff Epler f83212314e
synthio: Add LFOs 2023-05-15 21:15:39 -05:00
Dan Halbert fe386e7c73 adafruit_bus_device SPIDevice can have None for chip select 2023-05-12 15:29:59 -04:00
Scott Shawcroft 0a3faf8c9d
Merge pull request #7959 from jepler/synthio-bend-pan-ring
Synthio: next round of features
2023-05-12 08:54:49 -07:00
Scott Shawcroft db8bd56c6c
Merge pull request #7946 from anecdata/ap_ipv4
Allow Access Point static IPv4 on the espressif port
2023-05-12 08:47:07 -07: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 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 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
foamyguy c9bb53b48a adding __iter__ stub to displayio.Group 2023-05-11 07:52:03 -05:00
foamyguy 7c685477ba adding __contains__ stub to displayio.Group 2023-05-08 16:41:57 -05: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
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
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 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