HISE Logo Forum
    • Categories
    • Register
    • Login

    What do I do now - Compiling on Sonoma

    Scheduled Pinned Locked Moved General Questions
    9 Posts 2 Posters 172 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.
    • F
      Fergler
      last edited by

      The docs say to use 13.1 or below of Xcode but it won't run on my computer.

      Using Xcode 15, my exported AU is instant crashing any DAW it's in, with EXC_BAD_ACCESS (SIGSEGV)

      I don't know where to go from here. Any ideas?

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

        @Fergler If it compiles the problem is probably with your plugin rather than the version of xcode. Make a simple test plugin with just a sinewave generator and see if that works.

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

        1 Reply Last reply Reply Quote 0
        • F
          Fergler
          last edited by Fergler

          So I removed 4/5ths of my UI as a test, and I did get a compile. Interesting though - I have two issues with what remains in AU vs what's in preview.

          1. Combo boxes do not have contents. Their contents should be coming from an array converted to a string with new lines.
          2. Some images I put on the GUI have incorrect X values when they use a global integer in their calculation.

          For 1, here is the code: Anything jump out to anyone?

          const resetJSON = Engine.loadFromJSON("../Reset.json");
          const presetsJSON = Engine.loadFromJSON("../Presets.json");
          
          const jsonObj = { "Reset": resetJSON, "Presets": presetsJSON };
          
          var resetChoices = [];
          var presetsChoices = [];
          
          for (choice in resetJSON) resetChoices.push(choice);
          for (choice in presetsJSON) presetsChoices.push(choice);
          
          resetChoices = resetChoices.join("\n");
          presetsChoices = presetsChoices.join("\n");
          
          const comboH = 22;
          
          const resetCombo = Content.addComboBox("Reset", 10, 4);
          Content.setPropertiesFromJSON("Reset", {
              "width": 60,
              "items": resetChoices,
              "height": comboH,
              "parentComponent": "Header",
              "bgColour": 0,
              "itemColour": defaultColour,
              "itemColour2": 0,
              "textColour": defaultColour,
          });
          
          const presetsCombo = Content.addComboBox("Presets", 76, 4);
          Content.setPropertiesFromJSON("Presets", {
              "width": 68,
              "items": presetsChoices,
              "height": comboH,
              "parentComponent": "Header",
              "bgColour": 0,
              "itemColour": defaultColour,
              "itemColour2": 0,
              "textColour": defaultColour,
          });
          
          inline function setValues(json, c) {
              for (k in json) {
                  if (k.contains("FaderPack")) {
                      Content.getComponent(k).setAllValues(json[k]);
                  } else {
                      Content.getComponent(k).setValue(json[k]);
                  }
              }
              c.setValue(0);
          }
          
          inline function onSetControl(c, value) {
              if (value > 0) {
          	    local id = c.getId();
                  local selection = c.getItemText();
              	local json = jsonObj[id][selection];
                  setValues(json, c);
              }
          }
          Content.getComponent("Reset").setControlCallback(onSetControl);
          Content.getComponent("Presets").setControlCallback(onSetControl);
          
          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Fergler
            last edited by

            @Fergler Use local for your arrays instead of var. Declare them when you populate them.

            If the combo boxes are empty it implies your json isn't loaded correctly in the compiled plugin.

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

            F 1 Reply Last reply Reply Quote 0
            • F
              Fergler @d.healey
              last edited by Fergler

              @d-healey "If the combo boxes are empty it implies your json isn't loaded correctly in the compiled plugin." I mean.. yeah? :D But I need a way to trace why this is.. the issue is really why is it fine in HISE but breaking in compile. I have no way to explore why this is happening except to try different iterations.

              As for local vs var, these are not within an inline function so I can't. Are you then suggesting I move all this into an inline function?

              For my understanding:

              When I declare the const of Engine.loadFromJSON(), I am writing this object into the compiled program, not passing a reference to a real file in the real time code - correct?

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

                @Fergler said in What do I do now - Compiling on Sonoma:

                I have no way to explore why this is happening except to try different iterations.

                Have you placed the json file in the user presets folder in AppData? I assume that's where it's expecting to find it.

                @Fergler said in What do I do now - Compiling on Sonoma:

                As for local vs var, these are not within an inline function so I can't

                Sorry, I meant const not local.

                @Fergler said in What do I do now - Compiling on Sonoma:

                When I declare the const of Engine.loadFromJSON(), I am writing this object into the compiled program, not passing a reference to a real file in the real time code - correct?

                You're loading it in dynamically, it's not embedded.

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

                F 1 Reply Last reply Reply Quote 0
                • F
                  Fergler @d.healey
                  last edited by

                  @d-healey Ah ok. So huge critical misunderstanding about Engine.loadFromJSON then.

                  I guess then all I need to do is add one more step to save the finished .push()'d string to as a const and use that. Not at the computer right now to test butI think that will clear things up.

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

                    @Fergler If you want the json to be part of the plugin and not loaded from outside, you can include it as a .js file.

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

                    F 1 Reply Last reply Reply Quote 0
                    • F
                      Fergler @d.healey
                      last edited by Fergler

                      @d-healey Thanks, simultaneously I just found this thread:
                      https://forum.hise.audio/topic/9830/attaching-text-json-files-to-the-compiled-binary/6

                      I really assumed that I could load data like this but that's ok - I will do the suggestion in there of checking for a file and falling back to a default object if not found, at least for the resets/presets code. The main data I can definitely move to a .js no problem. The main data of my entire script including samplers came from a JSON file and I was tricked into thinking it was working fine because the samplers are created at compile with the correct data, and so I figure the UI was as well. No wonder absolutely nothing has been working correctly.

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

                      18

                      Online

                      1.7k

                      Users

                      11.8k

                      Topics

                      102.7k

                      Posts