Commit Graph

17 Commits

Author SHA1 Message Date
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 f83212314e
synthio: Add LFOs 2023-05-15 21:15:39 -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 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 53e13f15a3
synthio: Finish ading SWEEP_IN 2023-05-11 16:53:40 -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 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
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 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 04f4092e11
synthio: support audio outputs that need double buffering
closes #7837

tested on rp2040 pico w on pico dv shield
2023-04-05 11:57:13 -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 e0984fa195
Factor out the synthesizer from midi track 2023-04-02 18:54:07 -05:00
Artyom Skrobov 8056af8648 [synthio] add a simple MidiTrack implementation 2021-03-26 16:38:10 -04:00