Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synthio: Add LFOs #7985

Merged
merged 36 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f832123
synthio: Add LFOs
jepler May 15, 2023
b2c6f9b
synthio: add Synthesizer.lfo, retrigger option
jepler May 16, 2023
e6c5e83
synthio: remove more dead code
jepler May 16, 2023
0b926f8
synthio: improve release/press/change
jepler May 16, 2023
d4294de
synthio: Allow bends of more than one octave
jepler May 16, 2023
32e5d9e
update ulab to 6.0.12 w/sinc function
jepler May 17, 2023
a682b42
fir filtering demo
jepler May 17, 2023
3d2db5d
synthio: improve documentation, simplify synthio_lfo_obj_tick_scaled
jepler May 17, 2023
5de4d19
synthio: start generalizing LFO to Block
jepler May 17, 2023
3914381
synthio: Finish implementing Math blocks
jepler May 17, 2023
bd2a153
synthio: there is a midi note 0
jepler May 17, 2023
4901bdc
synthio: disable on more boards where it stopped fitting
jepler May 17, 2023
c435c46
synthio: simplify block logic a bit by converting from float just once
jepler May 18, 2023
4da32a7
Merge remote-tracking branch 'origin/main' into synthio-lfo-dag
jepler May 19, 2023
e259f8d
synthio: Move some divide-by-twos to get_buffer
jepler May 20, 2023
e0cfae1
synthio: add (untested) phase offset
jepler May 21, 2023
e6c4d12
synthio: doc improvement
jepler May 21, 2023
4ff08e0
synthio: lfo: bugfixes & improvements
jepler May 21, 2023
76101c0
core: Allow `enum` types to specify additional fields in the object
jepler May 21, 2023
c084ab9
synthio: Enable `synthio.MathOperation.SUM(3,4,5)`
jepler May 21, 2023
11c110e
synthio: remove 'none' case from lfo_tick
jepler May 21, 2023
823a02c
synthio: Add a new test of synthio.LFO
jepler May 21, 2023
c561599
synthio: fix docstring
jepler May 21, 2023
78e75f6
synthio: enable additional LFO test cases
jepler May 21, 2023
ac02a26
synthio: avoid exceptions inside get_buffer
jepler May 21, 2023
4d60c46
synthio: doc fixes
jepler May 21, 2023
4f671da
synthio: one more doc fix
jepler May 22, 2023
3790fd4
synthio: Add tests of all synthio math blocks
jepler May 22, 2023
1059c99
synthio: Add tests of each varying lfo input
jepler May 22, 2023
8626130
synthio: Add default triangle waveform to LFO, improve docs
jepler May 22, 2023
167aa30
synthio: remove if0'd code
jepler May 23, 2023
5b4d621
synthio: explicitly cast away const to satisfy compiler
jepler May 23, 2023
1b174f8
synthio: remove "1-octave" caveat, is false now
jepler May 23, 2023
af40a17
synthio: midi_to_hz: remove arbitrary note number limitation
jepler May 23, 2023
122e00b
document ring arguments to constructor
jepler May 23, 2023
2b42783
Apply suggestions from code review
jepler May 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ msgstr ""
msgid "%q must be of type %q or %q, not %q"
msgstr ""

#: py/argcheck.c py/obj.c py/objstrunicode.c
#: py/argcheck.c py/obj.c py/objstrunicode.c shared-module/synthio/__init__.c
msgid "%q must be of type %q, not %q"
msgstr ""

Expand Down Expand Up @@ -2470,6 +2470,10 @@ msgstr ""
msgid "annotation must be an identifier"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "arange: cannot compute length"
msgstr ""

#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
Expand Down Expand Up @@ -2642,6 +2646,10 @@ msgstr ""
msgid "can only have up to 4 parameters to Xtensa assembly"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "can only specify one unknown dimension"
msgstr ""

#: py/objtype.c
msgid "can't add special method to already-subclassed class"
msgstr ""
Expand Down Expand Up @@ -2793,6 +2801,10 @@ msgstr ""
msgid "cannot import name %q"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "cannot reshape array"
msgstr ""

#: extmod/moductypes.c
msgid "cannot unambiguously get sizeof scalar"
msgstr ""
Expand Down Expand Up @@ -3242,10 +3254,6 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "input and output shapes are not compatible"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "input argument must be an integer, a tuple, or a list"
msgstr ""
Expand Down Expand Up @@ -3959,7 +3967,7 @@ msgid "set unsupported"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "shape must be a tuple"
msgid "shape must be integer or tuple of integers"
msgstr ""

#: shared-module/msgpack/__init__.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ

CIRCUITPY_PS2IO = 1
CIRCUITPY_SYNTHIO = 0
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ, S25FL064L"
LONGINT_IMPL = MPZ

CIRCUITPY_PS2IO = 1
CIRCUITPY_SYNTHIO = 0
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JVxQ, W25Q16JVxM"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ

CIRCUITPY_KEYPAD = 1
CIRCUITPY_SYNTHIO = 0
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
3 changes: 2 additions & 1 deletion ports/stm/boards/thunderpack_v12/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ LONGINT_IMPL = NONE
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C

CIRCUITPY_NVM = 1
CIRCUITPY_BITMAPTOOLS = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_NVM = 1
CIRCUITPY_SYNTHIO = 0
CIRCUITPY_ZLIB = 0

MCU_SERIES = F4
Expand Down
4 changes: 4 additions & 0 deletions ports/unix/variants/coverage/mpconfigvariant.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ SRC_BITMAP := \
shared-bindings/rainbowio/__init__.c \
shared-bindings/struct/__init__.c \
shared-bindings/synthio/__init__.c \
shared-bindings/synthio/Math.c \
shared-bindings/synthio/MidiTrack.c \
shared-bindings/synthio/LFO.c \
shared-bindings/synthio/Note.c \
shared-bindings/synthio/Synthesizer.c \
shared-bindings/traceback/__init__.c \
Expand All @@ -64,7 +66,9 @@ SRC_BITMAP := \
shared-module/rainbowio/__init__.c \
shared-module/struct/__init__.c \
shared-module/synthio/__init__.c \
shared-module/synthio/Math.c \
shared-module/synthio/MidiTrack.c \
shared-module/synthio/LFO.c \
shared-module/synthio/Note.c \
shared-module/synthio/Synthesizer.c \
shared-module/traceback/__init__.c \
Expand Down
2 changes: 2 additions & 0 deletions py/circuitpy_defns.mk
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ SRC_SHARED_MODULE_ALL = \
struct/__init__.c \
supervisor/__init__.c \
supervisor/StatusBar.c \
synthio/LFO.c \
synthio/Math.c \
synthio/MidiTrack.c \
synthio/Note.c \
synthio/Synthesizer.c \
Expand Down
3 changes: 2 additions & 1 deletion py/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ typedef struct {
cp_enum_obj_print_helper(MP_QSTR_##module, print, self_in, kind); \
}

#define MAKE_ENUM_TYPE(module, type, typename) \
#define MAKE_ENUM_TYPE(module, type, typename, ...) \
const mp_obj_type_t typename##_type = { \
{ &mp_type_type }, \
.name = MP_QSTR_##type, \
.print = typename##_print, \
.locals_dict = (mp_obj_dict_t *)&typename##_locals_dict, \
##__VA_ARGS__ \
}


Expand Down
Loading