-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
synthio: Add LFOs #7985
Conversation
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.
up to +-12 sounds good, right?
these are always h-type buffers, so let's make the "len" be the element count, not the byte count.
LFO waveforms are now linearly interpolated by default, but a new property (interpolated=False) can disable this. The 'once' logic was improved
this will be used to make MathOperation enum values callable to construct a Math object with that function
.. in case the items in lfos are not actually LFOs
So far in my testing LFOs are great and work well. |
I plotted and eyeballed these and they all looked plausible
I looked at all the results and they pleased me
I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple documentation comments. The rest looked good to me. Just commenting now pending all the test fixes I know you are aware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing from me. Good otherwise!
thanks tannewt
The underlying routine can return numbers for higher and lower octaves. Other bits of the code might have frequency limitations but that doesn't mean we shouldn't let someone get a ~4Hz "note" by sending in (-12), because that's actually totally plausible as an LFO frequency.
thanks Mark!
Thanks for the review comments, I think I got 'em all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/12 is 0.0833
Co-authored-by: Dan Halbert <halbert@adafruit.com>
A couple of board builds are just stalled for CI reasons. No reason to think they would not complete. I will merge. |
This switches from hard coded tremolo/vibrato, to allowing much more control via nestable LFOs.
The new LFO object's API is like so:
A
Note
object now has several properties that are LFOs, replacing the earlier "depth" and "rate" properties:bend
,amplitude
, andring_bend
.LFOs can refer to other LFOs and most things can be re-assigned dynamically, so for instance this program starts with a simple tone, then modulates the amplitude with a first LFO, and then modulates the rate of the first LFO with a second LFO:
The file doesn't seem to be embeddable here but I put a demo up in mp3 format: https://emergent.unpythonic.net/files/sandbox/lfo_test.mp3
Other API changes:
release_then_press
API becomeschange
and adds an optional list of LFOs to retrigger. It's now documented that this is intended to be atomic with respect to sound generation, though this is only true if the iterable arguments are actually tuples or lists.todo: