-
Notifications
You must be signed in to change notification settings - Fork 270
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
AudioProcessorParameter raw_value Setter Problem #243
Comments
I was able to reproduce your issue and I have also been attempting to use I used the
Where the first two values are the min and max respectively. Then I added these two helpers:
Where
Output:
And to confirm, applying this effect over an input signal does work as expected with the correct updated mix value. |
Thanks for the suggestion. Unfortunately I need to set the raw value to avoid the quantization. Any how, adding the following method to AudioProcessorParameter achieves what I wanted.
It is probably still worth refactoring how the quantitation is achieved. It seems inefficient to populate a dictionary with probes of raw values at 1000 points and determining a minimum/maximum and step from this as shown here. |
Thanks @kleblackford! It seems like there are two bugs here:
I agree, but given that Pedalboard only has access to the VST3 (and similar Audio Unit) API, I'm not sure of a better way to do this. VST3 only provides a floating-point parameter value (between |
No worries. My use case is quite far from typical plugin applications so I have encountered a fair few problems (with JUCE also) so far :D
Yes, I think I have an idea of how this could be done: The maximum, minimum and the type of a parameter can easily be obtained by asking the plugin for the string representations of the raw values 0 and 1 (we should probably add specific int support also). Then we need to get directly the count to use in the quantisation. In the VST3 API there is stepCount which is exactly what is needed. We can use this to map values between the minimum and maximum. The JUCE equivalent of this is AudioProcessorParameter::getNumSteps (as used here). Unfortunately this does not seem to be working as intended with pedalboard. See the attached JUCE project test plugin with the following example:
This could be a JUCE problem rather than a pedalboard problem. For example, with the AudioParameterInt, it seems that the getNumSteps method should return the correct number of steps (see here). If we can work out how to get the actual number of steps for the different parameter types then I would be happy to attempt a refactor of the current implementation. |
One more question regarding:
I was able to get some initial tests working, using OSC Receiver to send OSC messages with python-osc to my plugin. However when I load the plugin into pedalboard and try the same thing, the oscMessageReceived method only is called once I reach a debug point or the end of my code. Is there something inherent in the way pedalboard loads a plugin which causes the message manager not to process a message until a breakpoint (or end of the code). Perhaps it is something to do with using the plugin in a non-realtime capacity... |
I figured it out. I fixed the problem by using OSCReceiver::RealtimeCallback instead of OSCReceiver::MessageLoopCallback . I suppose that loading the plugin in non-realtime deprioritizes the message thread, causing the message to be held. :) |
Back to the original issue... The source of the problem is in WeakTypeWrapper and I was able to solve it by defining setattr of WeakTypeWrapper after here as the following:
The tests seem to be passing with this change! :) |
@kleblackford Curious, did you ever raise this fix as a PR? And if not, is that something you might be able to do? Would be awesome to see this land! |
Yeah, I fixed it with this. Never created a merge request with the changes though as I was working on a branch with some additional hacky fixes... |
@kleblackford True true.. would you be open to separating them to a new branch and raising a merge request? Would be awesome to see the investigation/bugfix work you did get merged in for everyone's benefit! |
@kleblackford If I have your permission I could take care of opening a pull request with your proposed changes. I don't want to take credit for it though, I would just be happy to have this in a release. Let me know what you think. |
Go ahead - sorry I was too lazy to get round to it! Thanks :) |
Setting the raw_value attribute of an AudioProcessorParameter object does not work. I was attempting this (suggested here) as a workaround for the fact that resolution is usually lost when setting a parameter (should values really always be mapped between the minimum and maximum with a step count of 1000?)
Expected behaviour
Setting the raw_value attribute changes the plugin parameter value directly.
Actual behaviour
Nothing happens.
Steps to reproduce the behaviour
The following code with the attached VST plugin demonstrates this problem.
Amplifier.zip
Output:
The text was updated successfully, but these errors were encountered: