Setting(flag) to not have the plugin start the sample install process when the link file is missing
-
@virtuscapeaudio As far as I know
//
doesn't create comments in a bash script. -
@d-healey gotcha! i changed the comments from # to // because when i submit the forum post they were HUGE and underlined fonts lol and my adhd said...I need symmetry
-
@virtuscapeaudio this script is for making the link file which I just said you donβt need to do .
But you could just let users choose where to store the samples and use this script after all.
Better you try and understand what the scripts doing and how it works - itβs not too tricky.
Did you find any other scripts for packages on the forum?
-
@DanH OOOohhhh... my mistake.. so If im understanding this correctly, the process goes:
Packages project:
-
place plug-in files and ch1 files
-
Include a LinkOSX file and place it ... where exactly?
-
-
@virtuscapeaudio have you made the plugin yet? Exported and tested in a DAW?
-
@DanH yes we are quietly live ;)
I'm just trying to get this together before make a huge announcement, etc
-
@virtuscapeaudio well you must know where the link file is that tells the plugin where the samples are? Right? That's where you'll need to install the link file on other people's systems.
-
@DanH not enough coffee apparently haha. Thanks so much for taking the time to help!
-
@virtuscapeaudio have a look through this thread, I think I got most of my script from here:
-
@DanH here's where I'm at with this...I'm manually copying the Samples folder and testing on my system before packaging everything up
With HISE I set the Redirect Sample Folder to: /Libary/Application Support/Virtuscape Audio/Rhodecase88/Samples
When I open the either AU/VST3 version it creates a NEW LinkOSX file at ~/Library/Application Support/Virtuscape Audio/Rhodecase88 (perhaps this is from linking previous versions from testing where i indeed was using ~/Library
I'm struggling to see where I place a LinkOSX as Packages can only go to one location.
...trying this approach as most plug-ins by default are in /Library and not ~/Library
OSMonterey 12.2.1
-
@virtuscapeaudio could I perhaps define a set location for the Samples that I place in /Library in packages?
//Set Default Sample Location
const defaultSampleLocation = "/Library/Application Support/Virtuscape Audio/Rhodecase88/Samples";?
-
@virtuscapeaudio I see this but nothing in the documentation about it...Any ideas?
@d-healeyWould that be relevant to this situation at all?
-
@virtuscapeaudio I haven't seen setSampleFolder API before - have you tried it? Looks promising because then you just have one line of script in your onInit and you're done (I'm assuming it would create / amend the link file in the plugin's system folder).
Otherwise....
HISE plugins will always have their system folder in ~/Library/Application Support/DevName. Other devs do it in ~/Library too, and some use /Library - there's no right or wrong. (Perhaps @Christoph could introduce a flag so we can choose /Library because the ~/Library is a pain ).
So when you open a HISE plugin for the first time in your DAW it will create a folder inside ~/Library/Application Support/DevName, and within that plugin folder it will then create a link file (if it's an instrument with a sampler inside), an Expansions folder, General Settings.xml and a User Presets Folder. The link file will probably be a generic path like User/Shared/Music/PluginName/Samples or something.
If you don't want to use the HISE sample installer system (which installs the samples at a User defined location and creates the link file in the plugin system folder) then you have to roll your own.
Currently the options for OSX are (afaik):
-
Create an App in HISE which can download, and install the samples anywhere the user likes, and write the link file (you could also get your plugin to do this when opened for the first time - but normally a poor user experience),
-
Write a .sh shell post install script for Packages which, after the samples have been installed, either creates a link file (for user defined) or copies a premade link file (pre-defined) into the Plugin's system folder. The two scripts are quite different.
For Pre-Defined you set the Packages payload to deliver the files (or just the pre-made LinkFile) to the /Library/Application Support/DevName/PluginName location - Basically you create the Plugin's system folder in the wrong library (because Packages cannot access ~/Library). The post install script then copies that folder to the correct ~/Library location, and then deletes the now defunct /Library folder you just installed. Now, this method is useful for including other data sets, like LFO presets, Arp presets, audio files etc, as well as pre-defined Link files, because before the User even opens the plugin, all the data is positioned in the plugin's system folder, ready to go (which is what you want with the samples).
For User-Defined the shell script will take the path / location that the User chose during the install process (obviously set up the Packages project to allow the User to change install location), and then use that path to create the Link file (and the Plugin's system folder if necessary) in the ~/Library location. The MAJOR caveat with this method (at least for me because I haven't come across a way to get around this) is that you will need to define a default location for the samples within the shell script, and that if the User defines a different location for the samples then that path (let's say they chose an external drive called Audio) will always begin with the default location. So, for example, the default location has to be somewhere on the User's main hard drive, so lets say User/Shared/Music/DevName/PluginName/Samples - now when you install the samples to the Audio drive, rather than just having the location as Audio/PluginName/Samples it's actually the full default path on top of Audio, so, Audio/User/Shared/Music/DevName/PluginName/Samples, which makes little sense. IF SOMEONE KNOWS HOW TO GET AROUND THIS PLEASE SHARE!
So a Pre-Defined shell script will look something like this (where you set the payload with the link file and anything else to install in /Library then copy to ~/Library):
#!/bin/sh sudo -u $USER mkdir -p $HOME/Library/Application\ Support/DevName/PluginName/ /usr/bin/rsync -avurpE --remove-source-files /Library/Application\ Support/DevName/PluginName/ $HOME/Library/Application\ Support/DevName/PluginName/ sudo find $HOME/Library/Application\ Support/DevName/PluginName/ -type d -user root -exec sudo chown -R $USER: {} + rm -rf /Library/Application\ Support/DevName/PluginName exit 0
(Note the \ character is used when there is a 'space' in the path name.)
A User-Defined shell script (which takes the location set during the install) looks more like this:
#!/bin/sh # Write sample location selected by user to LinkOSX for HISE # First, remove LinkOSX file if it's already there instrumentname="PluginName" devname="DevName" FILE="$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX" if test -n "$FILE"; then rm -R "$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX" fi # Second, use the environment variable from WhiteBox Packages to write the destination to a file destfile=/Users/${USER}/Library/Application\ Support/${devname}/${instrumentname}/LinkOSX printf "${DSTROOT}/Users/Shared/DevName/PluginName/Samples" > "$destfile" exit 0
-
-
@DanH Thank you, Dan!!!! I have a "great success!!" (-Borat voice) on my hands thanks to you!
I had some initial trouble, but ChatGPT helped me correct it.
I'm posting here incase it's useful to anyone at all