Issue With Developing Plug In's for FL Studio

Every time I click on the plug in name in the channel window, my plug in resets to default! Going from window to window works fine, it’s only when i click from the channel view. I believe this is because the editorconstructor is called again when this happens.

I am using the basic Juce Audio Plug In preset and have not added any custom methods or classes. I am using only the Processor and the ProcessEditor classes.

So far I have 3 sliders. .setBounds() is in the resized() method, .getValue() (passing information to the processor) is in in sliderChanged() method, and everything else (.setSliderStyle, .setRange, setTextBoxStyle, .setPopupDisplayEnabled, .setTextValueSuffix and .setValue) is in the constructor. Have I placed my Slider information in the wrong methods?

The first thing to check is if you see the same behaviour with JuceDemoPlugin. Then, if the demo works as expected, use the same techniques in your own code.

The demo project works just fine.

I went ahead and made a completely new plug in with just UI copying almost line for line from the tutorial here https://www.juce.com/doc/tutorial_code_basic_plugin and the problem still persists.

The one thing I found is that, using Visual Studio, the problem is that the constructor for my plug in (the one in the tutorial) is being called every time I click on it’s name in the effect slot. And I have either not been able to get Visual Studio’s debugger to work with the Demo, or the constructor is not called at all.

So I believe the problem is the fact that the destructor and constructor are being called several times in the tutorial plug in, and I am not sure how to stop this because I don’t know FL Studio, or any other hosts, code.

After figuring out how to get visual studio to debug the Demo project in Visual Studio, i was wrong. The problem is actually because the tutorial code is constantly resetting the code to the default in the constructor!

Instead of being midiVolume.setValue(1.0); it should be midiVolume.setValue(p.noteOnVel); That way when the constructor is called a second time, nothing is defaulted!