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: next round of features #7959

Merged
merged 20 commits into from
May 12, 2023
Merged

Conversation

jepler
Copy link
Member

@jepler jepler commented May 11, 2023

  • Stereo output. A synthio.Synthesizer may be constructed with channel_count=2. The synthio.Note.panning property controls whether it appears in the left, right, or both channels.
  • Vibrato was generalized to support two additional modes: Sweep out, sweep in, and bend. vibrato_rate and vibrato_depth properties are removed, with new bend_rate, bend_depth and bend_mode properties added. The default bend_mode is VIBRATO, so migrate existing code just by search&replace. SWEEP does a sweep up or down starting from the note's base frequency. ``SWEEP_OUT does a sweep that ends at the note's base frequency. STATIC just lets the value be set dynamically from python code.
  • Ring modulation added. If a note has a ring_waveform, then this waveform is used (at ring_frequency) to modulate the main note waveform.
  • FIR filtering added. A 37-tap filter is OK on RP2040 (Prop Maker) at 48kHz mono, so you can probably go nuts on M7
  • Fix a problem with release time calculation for notes with 0 sustain level.
  • give BendMode.STATIC a better name naming things is hard
  • Add BendMode.SWEEP_IN to start from the detuned note and arrive at the tuned note? [added, not tested]
  • Fix sweep bend modes, I broke them

bend can be static, sweep, or vibrato
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.
When there's no sustain, the release step needs to be calculated from
the attack level, not the sustain level. Otherwise, contrary to intent,
this leads to the actual release taking a loooonnngg time.
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo and some builds that are too big. Good otherwise!

shared-bindings/synthio/Note.c Outdated Show resolved Hide resolved
The accumulator saturate logic was wrong, and the sweep was never restarted
either
@jepler jepler requested a review from tannewt May 12, 2023 01:09
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't force push after a review has started. If that is done, then the reviewer will see all of the changes again.

@tannewt tannewt merged commit 0a3faf8 into adafruit:main May 12, 2023
304 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants