HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansion Tutorial

    Scheduled Pinned Locked Moved Blog Entries
    133 Posts 16 Posters 11.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yall
      last edited by

      @Christoph-Hart ok great. I get it. in the expansionName folder there must be only the hxi file and the sample folder ok? and if i want to modify my expansion i have to remove the hxi because the expansion becomes unreadable in the sampler is that correct?

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Yes. While you can still load the samplemaps that are embedded in the .hxi file using scripting calls, they will not show up in the sampler's dropdown anymore (because you would be operating on the embedded data and not the actual .xml files which would be terrible annoying to realize later)...

        There's also a quick feature that removes the hxi / hxip files and bumps the "expansion level" back by one using this button on the expansion property popup:

        7e6449f6-4ecf-41a7-9feb-86ad5094cd92-image.png

        Y 1 Reply Last reply Reply Quote 0
        • Y
          yall @Christoph Hart
          last edited by

          @Christoph-Hart ok great. I get it. in the expansionName folder there must be only the hxi file and the sample folder ok? and if i want to modify my expansion i have to remove the hxi because the expansion becomes unreadable in the sampler is that correct?

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by

            Yes. While you can still load the samplemaps that are embedded in the .hxi file using scripting calls, they will not show up in the sampler's dropdown anymore (because you would be operating on the embedded data and not the actual .xml files which would be terrible annoying to realize later)...

            There's also a quick feature that removes the hxi / hxip files and bumps the "expansion level" back by one using this button on the expansion property popup:

            6cf957fd-14c3-4436-a43f-c00dce718499-image.png

            Y 1 Reply Last reply Reply Quote 0
            • Y
              yall @Christoph Hart
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart
                last edited by

                @yall I see that you've pasted your question again and then deleted it :)

                Anyways I've just pushed a few changes to the system that smooth out some edges:

                • you don't have to call ExpansionHandler.setEncryptionKey() anymore. I don't remember exactly why I added it in the first place but I think that it was before I used the project-wide Encryption Key setting in the project settings and I can't think of a scenario where this call isn't 100% redudant.
                • you can now specify the target directory when installing an expansion with ExpansionHandler.installFromPackage(). You also get Expansion.setSampleFolder() and Expansion.getSampleFolder() so you can implement a way that the user can change the folders afterwards.
                • I backrolled the change that David added to FileSystem.browse. Using 5 parameters and remembering their correct order is a bit too much, so I used the old signature for browse and added a browseForDirectory() function to add the other functionality.
                d.healeyD LindonL 2 Replies Last reply Reply Quote 3
                • d.healeyD
                  d.healey @Christoph Hart
                  last edited by

                  @Christoph-Hart Thanks Christoph!

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @Christoph Hart
                    last edited by

                    @Christoph-Hart said in Expansion Tutorial:

                    @yall I see that you've pasted your question again and then deleted it :)

                    Anyways I've just pushed a few changes to the system that smooth out some edges:

                    • you don't have to call ExpansionHandler.setEncryptionKey() anymore. I don't remember exactly why I added it in the first place but I think that it was before I used the project-wide Encryption Key setting in the project settings and I can't think of a scenario where this call isn't 100% redudant.
                    • you can now specify the target directory when installing an expansion with ExpansionHandler.installFromPackage(). You also get Expansion.setSampleFolder() and Expansion.getSampleFolder() so you can implement a way that the user can change the folders afterwards.
                    • I backrolled the change that David added to FileSystem.browse. Using 5 parameters and remembering their correct order is a bit too much, so I used the old signature for browse and added a browseForDirectory() function to add the other functionality.

                    Ok slightly confused about one or two things (likely more than that actually - knowing me).

                    So I have an expansion : which I roll up into "something" (a .hxi file probably) that has everything in it that I need for my expansion(except the samples themselves)...

                    OK so I put this file here:
                    APPDATA/Expansions/ExpansionName/info.hxi

                    where "APPDATA" includes my product name folder...

                    Now I want to know where to put my Samples....

                    So I think the best place is with all the original samples (lets call these the factory samples).

                    So question: How do I get them there?

                    Clearly my installer can take all the individual ch1 files and ask the user where they put the original set, but it might be a lot of files - so its messy, and the user might not recall...

                    For the original install HISE has the hr1 file set and a process of unpacking them - is there a similar (planned) process for expansions? if not can we have one?

                    So user buys expansion, installer puts the .hx1 file where it needs to be , product start - finds an expansion that isnt "configured" asks the user for the hr1 file equivalent for the expansion, and as it already KNOWS the SAMPLES location it unpacks the hr1 equivalent putting the ch1 files in the correct spot...

                    Or can it do all this already?

                    HISE Development for hire.
                    www.channelrobot.com

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @Lindon
                      last edited by

                      @Lindon Allow the user to select the location they want to install the samples and pass this to ExpansionHandler.installFromPackage().

                      For the original install HISE has the hr1 file set and a process of unpacking them

                      That's what ExpansionHandler.installFromPackage() does, you just pass it the .hr1 file (the user can select this with a file browser) and the destination to extract the samples to (user can select this with a directory browser) :)

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      LindonL 1 Reply Last reply Reply Quote 0
                      • LindonL
                        Lindon @d.healey
                        last edited by Lindon

                        @d-healey said in Expansion Tutorial:

                        @Lindon Allow the user to select the location they want to install the samples and pass this to ExpansionHandler.installFromPackage().

                        For the original install HISE has the hr1 file set and a process of unpacking them

                        That's what ExpansionHandler.installFromPackage() does, you just pass it the .hr1 file (the user can select this with a file browser) and the destination to extract the samples to (user can select this with a directory browser) :)

                        OK great - so I check the status of expansions (how would I know if its already been installed?) and if samples not installed then pop a user dialog asking for the location of the hr1 file, when I have that pop another asking for where they want to store the samples..(suggesting SAMPLES as an option) and take their answers as params for ExpansionHandler.installFromPackage()

                        yes?

                        So what is ExpansionHandler.getUninitialisedExpansions() telling me?

                        HISE Development for hire.
                        www.channelrobot.com

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @Lindon
                          last edited by

                          @Lindon said in Expansion Tutorial:

                          (how would I know if its already been installed?

                          You could probably use the File API to check if the expansion folder exists in the app data folder. You could also check the list of available expansions in your script.

                          samples not installed then pop a user dialog asking for the location of the hr1 file, when I have that pop another asking for where they want to store the samples..(suggesting SAMPLES as an option) and take their answers as params for ExpansionHandler.installFromPackage()

                          The samples "should" be installed when they install the expansion, if they move the samples to a different location then you could handle that with the Expansion.setSampleFolder() function.

                          So what is ExpansionHandler.getUninitialisedExpansions() telling me?

                          According to the docs - Returns a list of all expansions that aren't loaded properly yet.

                          So no idea, have a look in the source code and report back :)

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          1 Reply Last reply Reply Quote 1
                          • Christoph HartC
                            Christoph Hart
                            last edited by Christoph Hart

                            @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:

                            1. User buys the expansion. Gets a link with the download in an email.
                            2. Downloads the .hr1 file directly (no installer required)
                            3. Clicks somewhere on the UI that opens a file dialog
                            4. Points to the downloaded file
                            5. 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:

                            1. User buys expansion. Gets an email that says "Click refresh in the plugin" (or whatever)
                            2. User clicks refresh in the plugin (or whatever)
                            3. Plugin calls home, queries the list of expansions that the user has bought.
                            4. Notices that there is a new expansion that is not installed on the computer
                            5. Starts downloading the .hr1 file automatically
                            6. 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).
                            LindonL 1 Reply Last reply Reply Quote 4
                            • Y
                              yall
                              last edited by

                              @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? ^^

                              1 Reply Last reply Reply Quote 0
                              • Christoph HartC
                                Christoph Hart
                                last edited by

                                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.

                                Y 1 Reply Last reply Reply Quote 0
                                • Y
                                  yall @Christoph Hart
                                  last edited by

                                  @Christoph-Hart alright so i will see this and come back in about 14 years lol

                                  1 Reply Last reply Reply Quote 0
                                  • Christoph HartC
                                    Christoph Hart
                                    last edited by

                                    Cool let me know how it went... :)

                                    1 Reply Last reply Reply Quote 1
                                    • Y
                                      yall
                                      last edited by

                                      @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 ^^

                                      1 Reply Last reply Reply Quote 1
                                      • LindonL
                                        Lindon @Christoph Hart
                                        last edited by

                                        @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:

                                        1. User buys the expansion. Gets a link with the download in an email.
                                        2. Downloads the .hr1 file directly (no installer required)
                                        3. Clicks somewhere on the UI that opens a file dialog
                                        4. Points to the downloaded file
                                        5. 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:

                                        1. User buys expansion. Gets an email that says "Click refresh in the plugin" (or whatever)
                                        2. User clicks refresh in the plugin (or whatever)
                                        3. Plugin calls home, queries the list of expansions that the user has bought.
                                        4. Notices that there is a new expansion that is not installed on the computer
                                        5. Starts downloading the .hr1 file automatically
                                        6. 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).

                                        HISE Development for hire.
                                        www.channelrobot.com

                                        1 Reply Last reply Reply Quote 1
                                        • Dan KorneffD
                                          Dan Korneff @Dan Korneff
                                          last edited by Dan Korneff

                                          @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/2fy7ycys

                                          Also, sometimes the bank column appears empty.

                                          bank missing.png

                                          Dan Korneff - Producer / Mixer / Audio Nerd

                                          1 Reply Last reply Reply Quote 0
                                          • A
                                            arminh
                                            last edited by

                                            How we can get presets from expansion? Only by FileSystem?

                                            Dan KorneffD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            14

                                            Online

                                            1.7k

                                            Users

                                            11.9k

                                            Topics

                                            103.4k

                                            Posts