Example
-- Load a sub preset from hard disk or VST sound.
-- Find relative path on hard disk.
local info = debug.getinfo(1,'S') -- Function from the Lua debug library.
local source = info.source
local pos = string.find(source, "/library/") -- Assumes the folder "/library/" contains subfolders like "/samples/", "/scripts/", "/VST3 Sub Presets/", etc.
if pos then
contentPath = string.sub(source, 1, pos - 1).."/library/VST3 Sub Presets/" -- The folder on disk with sub presets, for example.
else
-- Extract VST sound GUID, e.g. "vstsound://ABCDEFGHIJKLMNOPQRSTUVWXYZ123456".
-- The GUID of the VST sound can be found in the library creator.
-- "SomeFolderName" is defined in the library creator.
-- The library creator prepends "/.AppData/Steinberg/" when building the library.
-- The content must be in the same VST sound as the script.
contentPath = source:sub(1, 43) .. "/.AppData/Steinberg/SomeFolderName/" -- The location of the sub presets inside the vstsound.
end
-- Load the sub preset from the respective contentPath.
layer = loadPreset(contentPath.."SomePreset.vstpreset")
2 Comments
Matthias Klag
Sabine Pfeifer: Ready for proof-read. Thanks!
Sabine Pfeifer
proofread done