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

I'm updating parameters wrong #100

Open
JoseDiazRohena opened this issue Jan 17, 2024 · 0 comments
Open

I'm updating parameters wrong #100

JoseDiazRohena opened this issue Jan 17, 2024 · 0 comments

Comments

@JoseDiazRohena
Copy link
Contributor

/** Receives a callback when a parameter has been changed.

            IMPORTANT NOTE: This will be called synchronously when a parameter changes, and
            many audio processors will change their parameter during their audio callback.
            This means that not only has your handler code got to be completely thread-safe,
            but it's also got to be VERY fast, and avoid blocking. If you need to handle
            this event on your message thread, use this callback to trigger an AsyncUpdater
            or ChangeBroadcaster which you can respond to on the message thread.
     */
        virtual void parameterValueChanged (int parameterIndex, float newValue) = 0;

from a thread discussing parameter changes in JUCE https://forum.juce.com/t/vst3-wrapper-calls-parameterchanged-from-audio-thread/51589/2

Currently, I'm in violation of this guidance. I change my parameters in parameterValueChanged, which is being called on the message thread. The code is real time safe, but as the comment points out, I should at least be triggering an async updater so we can exit the function as soon as possible.

And for what? I can simply update the processor state by getting parameter values in processBlock

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

No branches or pull requests

1 participant