CanParameterBeAutomated

Topics: 64 bit, VST.NET Core
Oct 19, 2015 at 7:09 AM
Edited Oct 19, 2015 at 7:10 AM
In one VST (using Jacobi.Vst.Core), I've been experimenting with automation of my parameters.
Basically working ok, although it took a while to figure out that your parameter values have to be converted to a value between 0.0 and 1.0F.
(and then back again).
But it works.

Problem is, I have some parameters that should never be automated, so I'm trying to set them in the "CanParameterBeAutomated" Function, based on the index.
(Actually based on (index mod 3), because only every third parameter should be automated. If (index mod 3) = 2, then I return true else I return false.)
However, my host DAW always shows all of the parameters as available and allows them to be automated. Automating some of these will produce fatal errors which is not good :)
Is this an issue with the host, or is there something else I have to update?
Oct 19, 2015 at 7:14 AM
The Mod function is VB.net, i believe that's a percent (%) sign in C#...
Oct 25, 2015 at 1:26 AM
Hmm...

I may simply be the case that the DAW is ignoring the CanParameterBeAutomated method. The first question I guess, is is the DAW ever calling this method? If you put a breakpoint there, does it get hit? Secondly, is it perhaps buffering the value from before? I mean perhaps the DAW asked for that value at one point, and then the index of the parameter changed?

I guess, I would say that if automating some parameter causes a fatal error, you should separate the value of the parameter in to a separate local variable. If the parameter has been automated through the DAW, perhaps just ignore the change and keep the value of the local variable.
Oct 25, 2015 at 8:35 AM
Kruddler wrote:
Hmm...

I may simply be the case that the DAW is ignoring the CanParameterBeAutomated method. The first question I guess, is is the DAW ever calling this method? If you put a breakpoint there, does it get hit? Secondly, is it perhaps buffering the value from before? I mean perhaps the DAW asked for that value at one point, and then the index of the parameter changed?

I guess, I would say that if automating some parameter causes a fatal error, you should separate the value of the parameter in to a separate local variable. If the parameter has been automated through the DAW, perhaps just ignore the change and keep the value of the local variable.
I thought it might be ignoring it so I used simple msgbox flags and it is getting called.
Maybe it's just my DAW that doesn't distinguish between can be/can't be automated (just treats all parameters the same).
Buffering... maybe so, I'll think about that one.^^

Yes, good idea, and I have tried to implement some failsafe routines in my code so that even if those parameters get automated to problem values they won't be fatal. Still, would hope that having CanParameterBeAutomated set to false would just not make them available at all to the user....
Oct 28, 2015 at 12:26 AM
Edited Oct 28, 2015 at 12:28 AM
Yeah that's a gotcha, have to keep a mental note to use that CanDo in my host.
Actually that gave me an idea... I should also make those settings overridable by a user settings in the host.
Because ya might just have that Vst plugin that says no can do on every automation settings and users will complain that it works fine in other hosts.
Coordinator
Oct 28, 2015 at 10:38 AM
Yeah, don't expect every host to call that GetParameterProperties method. Some do, most don't.

Another option is to not make it a parameter. If you do that, you probably also have to save your own state (chunks)...