Hey there! Still with us? I've got news!
1: Yep, that filename being passed to linuxsampler is wrong:
/file:/home/me/.lv2/LinuxSampler_LV2_MyPreset1.lv2/Tic Tok Men Moogdrums1.gig
The "/file:/" part should not be there. Actually the URI being passed to LS is "file:///home..."
but those 3 slashes get messed up by the time LS stores it.
2: Ardour does the same thing. I tested presets using QSampler and sure enough, exact same problem.
So it is definitely
not MusE's fault.
3: A
patch for lilv source code. This took me a long freakin' time to fix!
It's insane traversing all that code in three different domains: MusE, LV2, and LS.
Anyone reading this, please test it if you can.
I'd like independent confirmation before I submit a patch for review to LV2.
I tested the fix with MusE by using QSampler to load different gig files and
creating presets in MusE for each one, then stress-tested by switching among them.
Please stress-test with different gigs and presets. We want to catch any memory errors and so on.
It's kinda cool. Now QSampler shows the proper, absolute gig filename - not the messed up
URI link to the filename. I can select among different gigs that way.
Interesting, it appears LS itself takes the link we pass it and turns it into an absolute filename.
But I must say again, I expected that LV2 plugin to gain a UI and some controls by now
in its history. Is it not possible to just put all of QSampler or Fantasia inside the actual LV2 plugin?
So I can see better now, why built-in host support for LS is so crucial.
We could sure use something in MusE to, at the very least, load the filenames and set up LS channels.
Similar to our FluidSynth MESS plugin having the luxury of working so closely with the file
and being able to garner a lot of information from it, much more than any other plugin
architecture we support.
One last observation:
I believe we are missing two items in our LV2 presets popup menu:
"Remove" and "Modify".
There may need to be a 'current' highlighted preset, simply because
"remove" and "modify" need something to point to! Or else we'll need some
popup list where you choose which one to remove or modify.
Ardour appears to have all three of those above features.
Save this text as a file named [some_path]/lilv_state.pat
Go to the folder where lilv source code is. Type patch -p1 -i [some_path]/lilv_state.pat
Note: After applying this patch to lilv, if you were fooling around with using those gig filename
links as instruments
like I was, those presets may be no good. Use Ardour for now to remove those presets.
Please test, lemme know. Thanks.
Code: Select all
--- a/src/state.c 2018-07-22 14:53:18.000000000 -0400
+++ b/src/state.c 2018-08-09 02:32:26.133966189 -0400
@@ -495,7 +495,12 @@ new_state_from_model(LilvWorld* wo
const SordNode* graph = sord_iter_get_node(i, SORD_GRAPH);
state->plugin_uri = lilv_node_new_from_node(world, object);
if (!state->dir && graph) {
- state->dir = lilv_strdup((const char*)sord_node_get_string(graph));
+ const char *lfp = lilv_file_uri_parse((const char*)sord_node_get_string(graph), NULL);
+ if(lfp)
+ {
+ state->dir = lilv_strdup(lfp);
+ lilv_free((void*)lfp);
+ }
}
sord_iter_free(i);
} else if (sord_ask(model,
@@ -516,7 +521,12 @@ new_state_from_model(LilvWorld* wo
const SordNode* graph = sord_iter_get_node(i, SORD_GRAPH);
state->label = lilv_strdup((const char*)sord_node_get_string(object));
if (!state->dir && graph) {
- state->dir = lilv_strdup((const char*)sord_node_get_string(graph));
+ const char *lfp = lilv_file_uri_parse((const char*)sord_node_get_string(graph), NULL);
+ if(lfp)
+ {
+ state->dir = lilv_strdup(lfp);
+ lilv_free((void*)lfp);
+ }
}
sord_iter_free(i);
}