Scriptnode SFZ Dropper
-
Is there a way to access the SFZ importer in scriptnode from the UI?
If so, could someone show me how please? :)
-
@modularsamples This isn't possible at the moment, but you can easily implement a file drop and right-click browse functionality with a ScriptPanel.
Then you just need to format the reference that you pass into the audio file slot so that it detects it's a SFZ file.
-
@Christoph-Hart HISE can play SFZ files now?
-
@d-healey the audio file slot can load single audio files or multisample sets from SFZ or included sample maps.
And the sampler can parse SFZ files and load them as sample map on the compiled plugin too: https://docs.hise.audio/scripting/scripting-api/sampler/index.html#loadsfzfile
-
@Christoph-Hart Oh that's interesting. Is it possible to manually parse the SFZ file so we can implement various opcodes?
-
@d-healey no, it just takes the opcodes that correlate to a sample map property and maps it automatically.
The prime use case are hybrid synths with sample playback that want to allow more than a single custom user sample.
-
@Christoph-Hart Okay, good to know it's possible.. thanks!
-
So I finally got a handle on this. David's video on the File API was super helpful getting started.
Here's how its done:
const var ScriptnodeSyntesiser1 = Synth.getAudioSampleProcessor("Scriptnode Syntesiser1"); const slot = ScriptnodeSyntesiser1.getAudioFile(0); inline function onLoadSFZControl(component, value) { if (value) { FileSystem.browse (FileSystem.Desktop, false, "*.sfz", function (f) { slot.loadFile("{XYZ::SFZ}" + (f.toString(File.FullPath))); }); } }; Content.getComponent("LoadSFZ").setControlCallback(onLoadSFZControl);
Generally speaking it works really well. Some observations:
-
It prefers well formatted files like this to autogenerated messes like this
-
I've not extensively tested this, but it seems the path must be included in the region. Setting it with "default_path" doesn't seem to work
-
It doesn't like .AIF or FLAC files
-
If a file doesn't work, try removing anything that isn't directly related to the mapping of samples (opcodes, comments etc)
-