Expansion Tutorial
-
@Lindon said in Expansion Tutorial:
ExpansionHandler.getUninitialisedExpansions()
This is only interesting if you use the Encrypted .hxp expansion type as it will wait with the initialisation of encrypted Expansions until you've passed the user credentials to
ExpansionHandler.setCredentials()
(because only then it can decrypt and verify the legitness of the user).The expansion installation procedure is supposed to be as streamlined as possible both for implementation and the end user (granted that you use the glorious .hr1 format and not some weird hacky solution including zipping the ch1 or embedding them in the installer).
var hxiFile = getTheHxiFile(); // ask the user after he clicks on a button or whatever var targetFolder = FileSystem.getFolder(FileSystem.Samples); // Get the folder where all samples are or ask the user again // That's it expHandler.installFromPackage(hxiFile, targetFolder);
So the most simple-to-implement procedure for a user that buys an expansion is:
- User buys the expansion. Gets a link with the download in an email.
- Downloads the .hr1 file directly (no installer required)
- Clicks somewhere on the UI that opens a file dialog
- Points to the downloaded file
- The plugin will extract the samples and copy the expansion to the app data, then does all the encoding (if required) and reinitialises the expansions
There's even a better option available if you use the full force of the Server API and a user model:
- User buys expansion. Gets an email that says "Click refresh in the plugin" (or whatever)
- User clicks refresh in the plugin (or whatever)
- Plugin calls home, queries the list of expansions that the user has bought.
- Notices that there is a new expansion that is not installed on the computer
- Starts downloading the .hr1 file automatically
- When the download is finished, it will extract it automatically (the .hr1 file is the downloaded file and the sample target the default sample folder).
-
@Christoph-Hart damn Android. he did not copy the correct question lol. actually my question was. Since my expansion system is based on importing sample maps from a combobox, I should redo the sample map loading system? and necessarily redo my 250 preset? ^^
-
Well if you move your samplemaps from the factory content to an expansion, then yes, the samplemap ID will change. But it's nothing that isn't solvable with some concentration and a search+replace text editor.
So if you have the samplemap stored in the preset from the factory content there's something in your .preset file that looks like this:
"MySampleMap"
So just replace it with
"{EXP::MyExpansion/MySampleMap}"
in all preset files.
-
@Christoph-Hart alright so i will see this and come back in about 14 years lol
-
Cool let me know how it went... :)
-
@Christoph-Hart I come back from the future. we are at covid 22+, Trump has become president again and Angela is in a relationship with Emmanuel Macron. it's horrible. on the other hand even 14 years later, in fact, my presets of my expansion have already "{EXP :: MyExpansion / MySampleMap}". so i exported my vst, put the hxi in app data ........ but the vst opens empty. Oh, I forgot, Microsoft bought hise for $ 5 million. but say nothing ^^
-
@Christoph-Hart said in Expansion Tutorial:
@Lindon said in Expansion Tutorial:
ExpansionHandler.getUninitialisedExpansions()
This is only interesting if you use the Encrypted .hxp expansion type as it will wait with the initialisation of encrypted Expansions until you've passed the user credentials to
ExpansionHandler.setCredentials()
(because only then it can decrypt and verify the legitness of the user).The expansion installation procedure is supposed to be as streamlined as possible both for implementation and the end user (granted that you use the glorious .hr1 format and not some weird hacky solution including zipping the ch1 or embedding them in the installer).
var hxiFile = getTheHxiFile(); // ask the user after he clicks on a button or whatever var targetFolder = FileSystem.getFolder(FileSystem.Samples); // Get the folder where all samples are or ask the user again // That's it expHandler.installFromPackage(hxiFile, targetFolder);
So the most simple-to-implement procedure for a user that buys an expansion is:
- User buys the expansion. Gets a link with the download in an email.
- Downloads the .hr1 file directly (no installer required)
- Clicks somewhere on the UI that opens a file dialog
- Points to the downloaded file
- The plugin will extract the samples and copy the expansion to the app data, then does all the encoding (if required) and reinitialises the expansions
There's even a better option available if you use the full force of the Server API and a user model:
- User buys expansion. Gets an email that says "Click refresh in the plugin" (or whatever)
- User clicks refresh in the plugin (or whatever)
- Plugin calls home, queries the list of expansions that the user has bought.
- Notices that there is a new expansion that is not installed on the computer
- Starts downloading the .hr1 file automatically
- When the download is finished, it will extract it automatically (the .hr1 file is the downloaded file and the sample target the default sample folder).
--well that's about as sweet as its ever going to get ...nice job (again).
-
@dustbro said in Expansion Tutorial:
That will allow you to load next and previous in the expansion. If set to 0, the presets will get stuck cycling in the UserPreset folder and not find their way out.
@Christoph-Hart Is there any way to take another look at the preset browser in combination with expansions?
I'm experimenting with a project that loads expansions and the preset system is a little buggy. I plan on only using expansions, so the main instrument doesn't contain any presets. I've got a project loaded up (with expansions) . loadNextUserPreset() and loadPreviousUserPreset() don't seem to work at initialization. I'm assuming the instrument is looking in the project User Presets folder and isn't seeing the expansion preset folders. If I load a preset from one of the expansions, Next/Previous works, with one exception:
loadNextUserPreset() and loadPreviousUserPreset() will instantly crash HISE unless stayInDirectory is set to 1.Here's a minimized example:
tinyurl.com/2fy7ycysAlso, sometimes the bank column appears empty.
-
How we can get presets from expansion? Only by FileSystem?
-
-
@dustbro yes I know how to use it in floating tile preset browser but I would like to create custom preset browser.