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

Add BlockBiquad shelf & peaking, AudioFilter support #9804

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jepler
Copy link
Member

@jepler jepler commented Nov 11, 2024

@relic-se @gamblor21 @todbot for interest.

A potential limitation is:

Using the same LFO as an input to multiple other LFOs or Notes is OK, but the result if an LFO is tied to multiple Synthtesizer[sic, someone should fix that doc typo] objects is undefined.

(besides which, LFOs can now be used with AudioFilters, BlockBiquads, and other types of objects; LFOs, Math blocks and BlockBiquads should in the medium term be moved out of synthio into their own modules and the documentation updated to reflect what they can be used with)

AudioFilter is more likely to be used with AudioMixer. But you can't have one LFO drive the filters of two different AudioFilter objects.

I honestly don't know what the fix for this is. The lfo_tick routine needs to run once every SYNTHIO_MAX_DUR samples, but other parts of the audio pipeline produce or consume in different chunks. Using AudioMixer to gather up multiple chunks of synthio data is a common trick, but you still want the LFOs to tick every 256 samples even if AudioMixer is gathering 1024 samples at a time (ssay) In fact, this is making me doubt that a BlockBiquad with varying inputs is even working right in Filter with a single Filter and no mixer since it is using buffer_size of 512 bytes which might or might not be 256 samples.

This needs more thought, so I'm entering this as a draft.

This is just `Biquad | BlockBiquad` but it's useful shorthand.
& test by filtering some noise with a pair of BlockBiquads
The formulae are untested but taken directly from the Cookbook.

The `sqrt(A)` term is given a quick approximation via the famous
Quake reciprocal square root routine.
@jepler
Copy link
Member Author

jepler commented Nov 12, 2024

[two builds overflowed, looks like]

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.

1 participant