I'm looking for a way to give the user the ability to save and load patches. Saving isn't a problem really, but when loading I need to overwrite the control-values. For all I know by now I could cache the pointers to every single control and then set the values manually. This seems to be a bit tedious (doable though), is there an easier way to achieve patch saving?
First (for the general population reading this), RAFX has built-in preset (or patch) saving/loading using the toolbar buttons and drop-down list box. Load your plugin and then create patches and hit the button that looks like an old floppy-disc to name and store the presets. When done, re-compile the plugin and the presets will be saved in your plugin object. You can have as many presets as you want in RAFX, however only the first 16 presets will be ported out to VST and AU (as well as RAFX-as-VST-DLL paradigm). I know you have already done this - just wanted to make sure others were aware of this feature.
If you need more than 16 presets, or want to make your own system, then you will need to setup either a file loading/saving mechanism, or store the patches in the plugin object itself, perhaps in preset-structures - it sounds like you have already done this.
In order to update the GUI to match the patch you have loaded, use sendUpdateGUI( ).
When you load the patch, alter the underlying RAFX control variables according to the patch, then call sendUpdateGUI( ) -- you only need to call this update function once after all variables have been set.
See the post here:
You might also want to check out the post here on saving "user variables" in Presets (though this pertains to RAFX and ported project Presets, not your exact situation).
NOTE: if you are using files to load and save presets, then you need to be careful - the MacOS ported projects (VST and AU) will need to use file reading/writing specifically for MacOS. You can do that easily with #defines. See the post here:
I just tried it and it appears to me that sendUpdateGUI() only updates the RAFX prototype controls not the customGUI ones. The values on the customGUI change when I close and open the GUI again. Am I missing something here?
I just found that the GUI-changes work (mostly) fine when loading the plugin in Ableton. So I guess RAFX is updating the GUI differently?
There is one issue though: When having controls that are exponential or logarithmical, calling sendUpdateGUI() will result in the control graphics being set where it would be if it was a linear control. (or at least that's my theory on what's happening)
1. Filter cutoff is 500 Hz, knob is around 12 o'clock
2. call sendUpdateGUI()
3. Filter cutoff is still 500 Hz, but the knob is somewhere around 9 o'clock
Hi Will, sorry it took me so long to answer.
I'm sorry to report that for my case nothing has changed. I'm now on 22.214.171.124 and the result is exactly the same:
- Knobs don't change in RAFX unless you open and close the GUI (I don't know whether this is intended or not)
- in Ableton logarithmic/ exponential control jump when calling sendUpdateGUI (note that this happens even without changing the value manually)
Do you have an idea what I'm missing?
I have a custom preset manager created and it works saving off the values and preset name to a file.
However, when saving a session in a DAW, the DAW will save off the plugin's values and reload them the next time the project is loaded.
The control values are saved and reload fine from the DAW, but how would I get the DAW to save off the preset name? This is using an exported VST project btw.
Found it. For anyone interested:
Inside VSTProcessor save off your preset name in getState(IBStream* fileStream)
after all the other control values are saved off
presetName = ((MyProjectRAFX* )m_pRAFXPlugIn)->GetCurrentPresetName();
if (!s.writeStringUtf8(presetName)) return kResultFalse;
and inside setState(IBStream* fileStream)
after all the other control values are read in
if (!s.readStringUtf8(presetName, 99)) return kResultFalse;
Of course you'll have to write your GetCurrentPresetName / SetCurrentPrestName functions, pass that to your GUI, and handle the TCHAR* format.
Most Users Ever Online: 152
Currently Browsing this Page:
Guest Posters: 1
Moderators: W Pirkle: 689