Commit Graph

2252 Commits

Author SHA1 Message Date
Dan Halbert
5cc42d5041
Merge pull request #8126 from jepler/update-ulab-6.3.2
update ulab to 6.3.2
2023-07-26 11:54:42 -04:00
Jeff Epler
60b233f160
document EnvelopeState 2023-07-20 16:26:07 -05:00
Jeff Epler
f71831dea9
skip all the byecode hex data, it's adequately checked
... by the disassembly just below

This was tripped up because in exactly the right conditions some qstr
could be of the form 'xx 63' and make the expression `\.\+63` match
something other than what was intended.

This test was re-worked upstream for mpy version 6 so it'll be a conflict
to resolve when we get to that. :-/
2023-07-20 14:10:44 -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
KB Sriram
03e93f8e6c py/objdict: Fix fromkeys to return the right type.
Fixes https://github.com/adafruit/circuitpython/issues/8173

It looks like a small fix, and mostly independent of upstream
plans around https://github.com/micropython/micropython/pull/6173

I also filed an issue upstream
https://github.com/micropython/micropython/issues/12011
2023-07-14 22:03:06 -07:00
Jeff Epler
164fcb22c2
Enable "from __future__ import annotations" on unix build 2023-07-10 13:53:26 -05:00
Jeff Epler
e8c7b4a9f4
test a zero-byte environment file 2023-07-07 11:28:42 -05:00
Jeff Epler
b5ad7f91a3
update expected data for test
skip all the byecode hex data, it's adequately checked
by the disassembly just below

This was tripped up because in exactly the right conditions some qstr
could be of the form 'xx 63' and make the expression `\.\+63` match
something other than what was intended.

This test was re-worked upstream for mpy version 6 so it'll be a conflict
to resolve when we get to that. :-/
2023-06-27 11:16:12 -05:00
Jeff Epler
a9c987d3ce
Add expected-output file for this test
.. because the first test is actually accepted on python 3.10 and newer.
2023-06-27 10:43:14 -05:00
Jeff Epler
bfcb967edd
Add expected-output file for this test
.. because the first test is actually accepted on python 3.10 and newer.
2023-06-27 10:41:02 -05:00
Jeff Epler
a999e40935 synthio: reorganize the order of operations
Apply envelope & panning after biquad filtering.

This may fix the weird popping problem. It also reduces the number
of operations that are done "in stereo", so it could help performance.

It also fixes a previously unnoticed problem where a ring-modulated
waveform had 2x the amplitude of an un-modulated waveform.

The test differences look large but it's because some values got changed
in the LSB after the mathematical divisions were moved around.
2023-05-31 14:22:43 -05:00
Jeff Epler
30b69a821e
synthio: update ring mod manual test 2023-05-30 19:32:24 -05:00
Jeff Epler
8a564602a1
synthio: this modified biquad test lets me hear what I'm hunting 2023-05-30 19:21:13 -05:00
Jeff Epler
f5388e12af
synthio: add manual filter frequency sweeping to standalone test
.. by assigning a new band pass filter to the note every 2 frames
2023-05-29 11:23:45 -05:00
Jeff Epler
51027974e5
synthio: apply biquad filters during synthesis 2023-05-29 10:53:48 -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
eda43d7474
Add some more Note tests 2023-05-24 10:00:12 -05:00
Jeff Epler
1059c99f6e
synthio: Add tests of each varying lfo input
I looked at all the results and they pleased me
2023-05-22 10:45:28 -05:00
Jeff Epler
3790fd4117
synthio: Add tests of all synthio math blocks
I plotted and eyeballed these and they all looked plausible
2023-05-22 10:45:21 -05:00
Jeff Epler
78e75f6977
synthio: enable additional LFO test cases 2023-05-21 13:22:49 -05:00
Jeff Epler
823a02c0b7
synthio: Add a new test of synthio.LFO 2023-05-21 13:22:49 -05:00
Jeff Epler
4da32a7b86
Merge remote-tracking branch 'origin/main' into synthio-lfo-dag 2023-05-19 11:56:13 -05:00
Scott Shawcroft
9d11bda9e8
Fix memoryview.cast over sliced memoryview
Fixes #4758
2023-05-18 13:26:50 -07:00
Jeff Epler
c435c469f4
synthio: simplify block logic a bit by converting from float just once 2023-05-18 11:55:01 -05:00
Jeff Epler
391438102b
synthio: Finish implementing Math blocks 2023-05-17 16:32:20 -05:00
Jeff Epler
a682b42180
fir filtering demo 2023-05-17 11:13:15 -05:00
Jeff Epler
f83212314e
synthio: Add LFOs 2023-05-15 21:15:39 -05:00
Jeff Epler
91a5103910
synthio: add a host demo of all major features 2023-05-12 14:00:33 -05:00
Jeff Epler
f52bb65da6
synthio: add some new manual tests 2023-05-11 18:59:06 -05:00
Jeff Epler
9d8dcf7d33
synthio: endorse new test result 2023-05-11 18:59:02 -05:00
Jeff Epler
17df238145
synthio: doc fixes, rename BendType to BendMode 2023-05-11 15:23:54 -05:00
Jeff Epler
cbd02b74df
synthio: endorse updated test result 2023-05-11 10:22:55 -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
91978522c5
synthio: Add adafruit_wave and use it in the manual test 2023-05-11 09:31:07 -05: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
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
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
b33c9f6b4b
synthio: put license notice on copied files 2023-05-03 09:37:12 -05:00
Jeff Epler
d8550f4e7c
synthio: fix offset in default square waveform 2023-05-03 09:37:02 -05:00
Jeff Epler
b5c33a4c03
Add a manual test of synthio
this allows to test how the midi synthesizer is working, without access
to hardware. Run `micropython-coverage midi2wav.py` and it will create
`tune.wav` as an output.
2023-04-25 12:05:53 -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
Scott Shawcroft
e0a7edbe54
Merge pull request #7838 from jepler/more-aes-vectors
add more test vectors for aes
2023-04-06 09:54:57 -07:00
Jeff Epler
8c8ca3b810
endorse new test outputs 2023-04-06 10:21:27 -05:00
Jeff Epler
09bc8fbdc0
add more test vectors for aes 2023-04-05 14:55:41 -05:00
Jeff Epler
14637cd75a
update tests with new expected results 2023-04-05 12:00:05 -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
7bbb2ed898
add a basic acceptance test of MidiTrack 2023-04-02 13:48:23 -05:00
Jeff Epler
736af5b0c8
update expected result 2023-04-01 13:12:00 -05:00
Dan Halbert
b947605ab7
Touch up 2023-03-23 09:24:11 -04:00