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

Process single sample or block, return or replace inconsistency #59

Open
AvAars opened this issue Jul 14, 2020 · 2 comments
Open

Process single sample or block, return or replace inconsistency #59

AvAars opened this issue Jul 14, 2020 · 2 comments
Labels
polish New feature or request

Comments

@AvAars
Copy link
Contributor

AvAars commented Jul 14, 2020

As I was working on an improvement for the Compressor module, I noticed how some DSP modules have some sort of Process-method to work on a single sample and just return a single output sample. Some use ProcessBlock, some require the input by reference and work directly on the buffer while others work on a given output buffer.
This makes using the library somewhat difficult (sometimes using it inside your input loop in the AudioCallback, sometimes outside)

Now there is something to say for both of these, as processing a block reduces method calls by blocksize (I think? I'm somewhat new to DSP programming) but processing a single sample gives more flexibility.

I would propose adding both options to all modules, if possible. And specifically for the ProcessBlock option: never work directly on the input buffer so that stays clean should the user wish to process that input though another module.

As long as a user doesn't use both single sample- and block-processing in a single AudioCallback, it should be fine, I think.

Would there be any problem with this?

@stephenhensley
Copy link
Collaborator

Agreed. For the most part, nearly all modules have a single-sample Process function, but there are certainly a few earlier additions to the library that do not (NlFilt comes to mind right away).

It would be great to clean this up for consistency, and yeah I think its a great idea for every module to have a ProcessBlock function as well.

@AvAars
Copy link
Contributor Author

AvAars commented Jul 14, 2020

Allright, I'll see if I can find some time to help out on this :)

@stephenhensley stephenhensley added the polish New feature or request label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants