On Dienstag, 19. Mai 2020 10:19:28 CEST rosea.grammostola wrote:
> If you edit a sfz file and load the edited file, LinuxSampler still acts
> on the previous version of the file it seems. Which is a quite
> frustrating workflow.
How exactly do you load the file? If the file is explicitly loaded on a
sampler part by file name AND the file is not already used on another sampler
part then the sampler should really load the latest file version.
Things are different if you have multiple samplers parts which are using the
file, in this case the sampler detects that the file is already in use on
another part and simply uses the one that's already loaded instead of loading
the file again from disk.
The sampler might also behave like that if the file is not directly loaded,
but instead indirectly by MIDI program change and MIDI instrument map. In this
case it depends how the load strategy was defined in the instrument map's
entry by you (e.g. "on demand", "on demand hold", "persistent") and of course
as well whether the instrument is used on another part.
But you are right, that even in such cases (if the file is already loaded and
in use), the sampler should check if there's a new version on disk (e.g. by
comparing the file's mod time). That lacking detection is probably due to my
personal preference of just using the gig engine, in which case Gigedit would
be used for any instrument modifications; Gigedit always informs the sampler
explicitly in real-time that certain parts of the file (and which parts
exactly) had been changed and that the sampler should reload these parts.
> Same for the database update wait time. I've to restart Linuxsampler and
> Fantasia every time I update the database. :-\
Yes, that's currently definitely the case. The sampler currently does not
automatically refresh the instruments DB automatically on external changes to
files.
The sad truth is, there's currently no one actively taking care about the
sampler's sfz engine. And that situation persists for several years now.
I am personally just using the gig engine and hence my entire focus is on this
part of the sampler. I basically only handle odd fixes on sfz engine side. The
only new features on sfz side usually appear these days if they are added to
the common code shared by all 3 engines (gig, sfz, sf2) in which case they
"popup for free" in all other engines.
On Montag, 18. Mai 2020 12:11:28 CEST rosea.grammostola wrote:
> Hi,
>
> I've two sfz files. Both with a default_path. In the first Linuxsampler
> is totally okay with the file. In the second it says:
>
>
> Scheduling
> '/home/debian/linuxaudio/SFZ/kicks_pljones_D/bop/kd14_bop_snare_off_cls-D.sf
> z' (Index=0) to be loaded in background (if not loaded yet).
> Loading sfz instrument
> ('/home/debian/linuxaudio/SFZ/kicks_pljones_D/bop/kd14_bop_snare_off_cls-D.s
> fz',0)...OK Caching initial samples...sfz::Engine error: Failed to load
> instrument, cause:
> /home/debian/linuxaudio/SFZ/kicks_pljones_D/bop/~/linuxaudio/NDK/samples/kic
> ks/kd14bop/snare_off/cls/kd14bop_cls_001.wav: Can't get sample info: System
> error : No such file or directory.
>
>
> It seems to search for a relative path, even if default_path is set.
If there's really a problem in detecting relative vs absolute path here, then
it should be easy to fix. The relevant code that handles this is exclusively
in src/engines/sfz/sfz.cpp and there are just 2 small code sections which
handle this:
1. [line 1414]
else if (token == "<control>")
{
_current_section = CONTROL;
default_path = "";
octave_offset = 0;
note_offset = 0;
}
2. [line 1480]
// sample definition
if ("sample" == key)
{
// handle built-in sample types ...
if (value == "*silence") {
pCurDef->sample = value;
return;
} else if (value.length() >= 1 && value[0] == '*') {
std::cerr << "Unknown or unsupported built-in sample type '"
<< value << "'!" << std::endl;
return;
}
// handle external samples ...
std::string path = default_path + value;
#ifndef WIN32
for (int i = 0; i < path.length(); i++) if (path[i] == '\\')
path[i] = '/';
bool absolute = path[0] == '/';
#else
bool absolute = path[0] == '/' || path[0] == '\\' ||
(path.length() >= 2 && isalpha(path[0]) && path[1] == ':');
#endif
if (!absolute) path = currentDir +
LinuxSampler::File::DirSeparator + path;
if(pCurDef) pCurDef->sample = path;
return;
}
// control header directives
else if ("default_path" == key)
{
switch (_current_section)
{
case CONTROL:
default_path = value;
break;
default:
; // noop
}
return;
}
So you can easily add debug messages to find out what's going on.
CU
Christian
_______________________________________________
Linuxsampler-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel