Forum
    • Categories
    • Register
    • Login

    Expansion encode error

    Scheduled Pinned Locked Moved General Questions
    51 Posts 2 Posters 2.4k 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.
    • DanHD
      DanH @DanH
      last edited by

      @danh I thought I'd try it in New Laypout branch but I can't see anywhere to encode the expansion - it doesn't appear to be in the sampler window as before

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @DanH
        last edited by

        @danh https://forum.hise.audio/topic/4915/invalid-hxi/4?_=1636737817041

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        DanHD 2 Replies Last reply Reply Quote 0
        • DanHD
          DanH @David Healey
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • DanHD
            DanH @David Healey
            last edited by

            @d-healey Thanks, no joy with NL. So strange. I'll try recompiling HISE. Am I missing something? I've followed the script from the docs.... I mean it's worked fine for weeks. 😢

            David HealeyD 1 Reply Last reply Reply Quote 0
            • David HealeyD
              David Healey @DanH
              last edited by

              @danh What method are you using to install the expansion?

              Free HISE Bootcamp Full Course for beginners.
              YouTube Channel - Public HISE tutorials
              My Patreon - HISE tutorials

              DanHD 1 Reply Last reply Reply Quote 0
              • DanHD
                DanH @David Healey
                last edited by

                @d-healey Rebuilt HISE and it began to work as expected again.

                One question though - When installing an expansion, it takes a few moments for the samples to install themselves. It's possible to close the plugin / standalone prior to all samples installing, leading to errors upon startup. Have you come across this? A bar showing progress would be useful!

                David HealeyD 1 Reply Last reply Reply Quote 0
                • David HealeyD
                  David Healey @DanH
                  last edited by

                  @danh said in Expansion encode error:

                  It's possible to close the plugin / standalone prior to all samples installing, leading to errors upon startup. Have you come across this?

                  Sounds like a bug, I think HISE should recover from where it left off. I haven't tested this myself.

                  @danh said in Expansion encode error:

                  A bar showing progress would be useful!

                  You can implement this yourself with a timer and the expansion install callback.

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

                  DanHD 1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @David Healey
                    last edited by

                    @d-healey oh yes, completely missed those API's, silly me.

                    I believe you made a progress bar video a few months ago too

                    Second thing, when you install an expansion and the first window opens to select the .hr1 file, and then the second to choose where to install the .ch1 files, is there a way to add dialog to those windows to act as a guide for the user?

                    David HealeyD 1 Reply Last reply Reply Quote 0
                    • David HealeyD
                      David Healey @DanH
                      last edited by David Healey

                      @danh This is how I'm doing it.

                      inline function manualInstall() {
                        local msg = "Please select the .hr1 file";
                      
                        Engine.showYesNoWindow("Select .hr1", msg, function(response)
                        {
                          if (response)
                          {
                            FileSystem.browse(FileSystem.Downloads, false, "*.hr1", function(hr)
                            {
                              if (hr.toString(2) == ".hr1")
                              {
                                local origin = hr; // Scoped copy
                                msg = "Please select the folder to install the instrument's samples";
                      
                                Engine.showYesNoWindow("Install Location", msg, function(response)
                                {
                                  if (response)
                                  {
                                    FileSystem.browseForDirectory(FileSystem.Samples, function(dir)
                                    {
                                       expHandler.installExpansionFromPackage(origin, dir);�
                                    });
                                  }
                                });
                              }
                            });
                          }
                        });
                      }
                      

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      DanHD 1 Reply Last reply Reply Quote 0
                      • DanHD
                        DanH @David Healey
                        last edited by

                        @d-healey very kind, thank you

                        DanHD 1 Reply Last reply Reply Quote 0
                        • DanHD
                          DanH @DanH
                          last edited by

                          @d-healey do you have to restart your plugin to load the new expansion after installation? Or can it be loaded right away?

                          David HealeyD 1 Reply Last reply Reply Quote 0
                          • David HealeyD
                            David Healey @DanH
                            last edited by

                            @danh Should be available right away - https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html#refreshexpansions

                            Free HISE Bootcamp Full Course for beginners.
                            YouTube Channel - Public HISE tutorials
                            My Patreon - HISE tutorials

                            DanHD 1 Reply Last reply Reply Quote 1
                            • DanHD
                              DanH @David Healey
                              last edited by

                              @d-healey Thanks, I think I had trouble getting this to work in master before but will try again!

                              So just tying the script above - I stuck it into a button callback. I'm getting an error on this line (Unknown function 'toString'):

                              if (hr.toString(2) == ".hr1")
                              

                              I'm not sure what the '2' is referencing?

                              David HealeyD 1 Reply Last reply Reply Quote 0
                              • David HealeyD
                                David Healey @DanH
                                last edited by David Healey

                                @danh

                                I'm getting an error on this line (Unknown function 'toString'):

                                Do you get that error on compile or when running the function?

                                I'm not sure what the '2' is referencing

                                https://docs.hise.audio/scripting/scripting-api/file/index.html#tostring

                                2 = OnlyExtension

                                There was some problem where the enums weren't working correctly so I had to use magic numbers. Not sure if that problem was fixed.

                                Free HISE Bootcamp Full Course for beginners.
                                YouTube Channel - Public HISE tutorials
                                My Patreon - HISE tutorials

                                DanHD 3 Replies Last reply Reply Quote 0
                                • DanHD
                                  DanH @David Healey
                                  last edited by

                                  @d-healey just when using the function. I can select the .hr1 file ok, and then this error pops up. Maybe I should compile the plugin - I'm doing this in HISE and obviously the actions can't be completed in HISE (I don't think?!)

                                  1 Reply Last reply Reply Quote 0
                                  • DanHD
                                    DanH @David Healey
                                    last edited by

                                    @d-healey Nope compiled plugin doesn't go any further than that. So what do you mean by using magic numbers?!

                                    1 Reply Last reply Reply Quote 0
                                    • DanHD
                                      DanH @David Healey
                                      last edited by DanH

                                      @d-healey oh wait, I haven't defined hr.... what should I use? var / reg?

                                      Oh I have and it's for something else lol

                                      Yup that was it :)

                                      David HealeyD 1 Reply Last reply Reply Quote 0
                                      • David HealeyD
                                        David Healey @DanH
                                        last edited by David Healey

                                        @danh said in Expansion encode error:

                                        oh wait, I haven't defined hr..

                                        It's the callback parameter FileSystem.browse(FileSystem.Downloads, false, "*.hr1", function(hr) you don't need to define it, but if you have the same name used somewhere else globally it will cause issues.

                                        So what do you mean by using magic numbers?!

                                        https://en.wikipedia.org/wiki/Magic_number_(programming)

                                        Free HISE Bootcamp Full Course for beginners.
                                        YouTube Channel - Public HISE tutorials
                                        My Patreon - HISE tutorials

                                        1 Reply Last reply Reply Quote 0
                                        • DanHD
                                          DanH
                                          last edited by

                                          @d-healey Thanks, yes the hr was being used by my previous expansion install button ha

                                          So I'm looking into the progress bar - I don't know if you've used the expansion obj.Progress API or not. I'm trying to get it's value into a variable so I can refer to it for the progress bar, not very well 😂

                                          const var pnlProgress = Content.getComponent("pnlProgress");
                                          var expProgress;
                                          
                                          function installCallback(obj)
                                          {
                                              pnlProgress.setValue(0);
                                              //local x = obj.Progress
                                              
                                              if (obj.Progress)
                                              {
                                                  expProgress = this.data.progress;
                                                  pnlProgress.showControl(1);
                                                  pnlProgress.startTimer(30);
                                              }
                                              if (obj.Status == 2 && isDefined(obj.Expansion))
                                              {
                                                  // make sure the user presets are updated
                                                  obj.Expansion.rebuildUserPresets();
                                          
                                                  Engine.showYesNoWindow("INSTALL COMPLETE",
                                                                         "ENJOY!",
                                                  function(ok)
                                                  {
                                                      if(ok)
                                                           expHandler.refreshExpansions();
                                                           pnlProgress.showControl(0);
                                                  });
                                              }
                                          };
                                          
                                          expHandler.setInstallCallback(installCallback);
                                          
                                          pnlProgress.setTimerCallback(function()
                                                                       {
                                                                       //var x = this.getValue();
                                                                       var x = expProgress;
                                                                       //x = x + 0.1;
                                                                       this.setValue(x);
                                                                       
                                                                       Console.print(x);
                                                                       if (x >= 0.9)
                                                                       this.stopTimer();
                                                                       
                                                                       this.repaint();
                                                                       });
                                          
                                          //pnlProgress.startTimer(30);
                                          
                                          pnlProgress.setPaintRoutine(function(g)
                                                                      {
                                                                      g.fillAll(0x00000000);
                                                                      
                                                                      var a = [this.getWidth() / 2 - 400 / 2, this.getHeight() / 2 - 20 / 2, 400, 10];
                                                                      
                                                                      g.setColour(Colours.darkgrey);
                                                                      g.fillRoundedRectangle(a, 5);
                                                                      
                                                                      var v = this.getValue;
                                                                      g.setColour(0xFF7B026B);
                                                                      g.fillRoundedRectangle([a[0], a[1], a[2] * expProgress, a[3]], 5);
                                                                      
                                                                      });
                                          
                                          David HealeyD 1 Reply Last reply Reply Quote 0
                                          • David HealeyD
                                            David Healey @DanH
                                            last edited by

                                            @danh Here is the most basic progress indicator ever.

                                            expHandler.setInstallCallback(function(obj)
                                            {
                                            	Console.print(Math.ceil(obj.Progress * 100) + "%");
                                            });
                                            

                                            Now instead of outputting obj.Progress to the console, set it as the panel's value and then repaint the panel.

                                            Free HISE Bootcamp Full Course for beginners.
                                            YouTube Channel - Public HISE tutorials
                                            My Patreon - HISE tutorials

                                            DanHD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            22

                                            Online

                                            2.1k

                                            Users

                                            13.1k

                                            Topics

                                            113.3k

                                            Posts