Commit Graph

23 Commits

Author SHA1 Message Date
Scott Shawcroft
e62db5adcd
Fix native property setting from subclass 2023-10-24 16:20:51 -07:00
Dan Halbert
4d175ab41a convert to MP_DEFINED_CONST_OBJ_TYPE() 2023-09-19 21:09:29 -04:00
Dan Halbert
2c0fa0f7dc initial merge from v1.20.0; just satisifying conflicts 2023-09-19 11:10:12 -04:00
Dan Halbert
2171e67c1b merge latest adafruit/main 2023-08-13 19:43:54 -04:00
Dan Halbert
0d2c3c3f08 wip: continuing compilation fixes; mp_obj_alloc everywhere 2023-08-07 20:45:57 -04:00
Jeff Epler
29a4364ba7
fix method signature 2023-07-20 14:05:56 -05:00
Jeff Epler
346f08f8b9
synthio: Add Synthesizer.note_state
This enables the specific use case of checking whether a note's release
phase has ended, but is also potentially useful to implement a sort of
"voice stealing" algorithm in Python code, which can take account of
the note's envelope state as well as other factors specific to the
program.
2023-07-20 13:16:00 -05:00
Jeff Epler
3151656f4b synthio: more fir-filter removal; fix biquad logic errors 2023-05-30 09:24:26 -05:00
Jeff Epler
1d58b550b5
synthio: fix doc build 2023-05-29 13:07:15 -05:00
Jeff Epler
fed8d5825b
synthio: add biquad filter type & basic filter calculations
the filter cannot be applied as yet.
2023-05-29 09:50:18 -05:00
Jeff Epler
9f138dc188
synthio: list filter in the constructor 2023-05-23 19:38:25 -05:00
Jeff Epler
11d8a6ec3a
synthio: rename synthesizer.lfos to .blocks
.. since math blocks can be placed in it too (and that's useful)
2023-05-23 19:38:25 -05:00
Jeff Epler
4d60c4608e
synthio: doc fixes 2023-05-21 17:49:30 -05:00
Jeff Epler
e6c4d12eaf
synthio: doc improvement 2023-05-21 13:22:47 -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
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
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
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
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
Jeff Epler
992457c7f7
Improve documentation 2023-04-05 16:53:09 -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