-
Notifications
You must be signed in to change notification settings - Fork 55
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
Trouble using preset_save #18
Comments
preset_save takes a bundle and filename, but preset_load takes a URI. the new preset is not automatically added to the lv2 world, as you can save it in any random location for any reason. |
Ah, ok. File-url works for loading (thought I tried that before) but bundle_add doesn't help. The path itself is already found at start since it's within ~/.lv2 but adding it again with bundle_add should re-read the files? It does not seem to have any effect. |
The presets are likely cached in mod-host. |
Oh I sure can load the preset, but I wan't to overwrite previous presets and reload them (hence "re-read"). But the values as you say seem to be cached, so I always get the first set of parameters even if the preset has been saved again with different values. How is that handled for mod-ui, as the use case should be the same? |
mod-ui does not use mod-host for getting plugin data. |
Ah, ok. I saw that in mod-ui/host.py preset_load and preset_save is called, maybe that is not what I thought. Can you be a bit more specific on how I can invalidate preset data? I'm obviously calling preset_save already to save the preset. A subsequent load does not load the previously saved values. I can also see in host.py (preset_save_replace()) that the previous preset is removed, the lilv function rescan_plugin_presets is called and then after saving, the bundle is added again. Is that what you mean? |
invalidate preset data by modifying mod-host code so it deletes the old presets when you save a new one. in mod-ui's case, it never asks mod-host about parameters or presets. |
Hm, I'd consider it the job of mod-host to be able to save and load parameters without restarting, don't you agree? Also I would prefer not to run a modified version of mod-host. Otherwise I could also read the file directly and set the parameter values using param_set, but thats equally ugly. For mod-ui, I didn't talk about asking about parameters or presets (I don't need that either), just about calling preset_load and save so that a previously saved state becomes active again. Without using those you'd have to set each parameter separately which apparently is not being done. |
but mod-host can save and load presets without restarting. mod-ui managing it is the proof of that. not sure what's the best solution for this. either presets_reload command or automatically delete cached content... or perhaps a new argument to preset_save... |
Well, but the problem I experience is exactly this: I can't make mod-host save a preset a) (lets say it already existed), change some parameters and load preset a) again obtaining the previously saved values. What I get instead is the values that preset a) had at the time of starting mod-host. The files are saved fine and after restart, I get the values that were saved last. I have never intended to read a list of preset names, I don't need that. |
As per your previous comment, I should not have any issues but I do. Actually, it seems as if the preset itself is cached since I can save to a preset, change some values and then load the new one again if I didn't load this preset name before. After it was loaded once, I can not save new values to it and then load these again, it will always give the values of the initially loaded one. |
Did you use bundle_remove + bundle_add when you re-saved a preset? |
I guess I misunderstood you previously (I tried it) but it works fine now. First bundle_remove, then bundle_add then preset_load. Thanks! |
Ok, taking back what I said, I got confused a bit about sometimes working, sometimes not. |
I've run into a few issues using preset_save and consecutive preset_load:
Saving the current state into a new preset using
preset_save 0 "Preset Name" <home>/.lv2/helm.lv2 preset_name.ttl
successfully creates files. But in manifest.ttl, the tag is<preset_name.ttl>
instead of e.g.<http://url#preset_name>
. In preset_name.ttl, the tag is empty<>
. If I want to load this preset, I didn't succeed using something likepreset_load 0 preset_name
orpreset_load 0 http://url#preset_name
like it works for the factory presets of the synth. I can load the preset if I manually change the titles to the url form.The other big issue is that I can't read a preset I just saved unless I restart mod-host as it seems to have cached the values/files. It also takes a bit of time to load the first preset, so it appears to get everything once when the first preset_load is called? I'd be ok if it could at least re-read the values from the file every time (with cached preset names).
The text was updated successfully, but these errors were encountered: