HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.loadUserPreset() doesn't work in Logic

    Scheduled Pinned Locked Moved Bug Reports
    16 Posts 3 Posters 207 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.
    • whoopsydoodleW
      whoopsydoodle @d.healey
      last edited by

      @d-healey

      HiseSnippet 1262.3ocsVEtaaaCDlxIZa1sacEX+dPv+xYvvyR1I1tCa0wI1aFMt0HNsaCECEzRz1bQhTPhJItc4e6gZ.6AXOG6MXuAaGEksjbbV6BV0OrAui2ce7i2c7FGvsIgg7.jVoyV5SPZ2WexRlXwQKvTFZ3wRAmvmSsMNiDJP8V5iCCINHMsc9V4NzJtKJ96udbOrKlYSREgPufSsImP8nhToi69Dpq6.rC4LpWlc2r6PaN6HtKOBPyN50Q9X6ywyIOEK2VAcz2gCWfz9BcqYSssl0pQayNlcZ0rio49sm1rtksy9cZz3fFNyrZiOnMXzGz2gJ3ASDXAIDosaOtyxIK3WxTA3EzP5TWhbgIZBDYk3AbWG4QTJEczBpqy3UzTHB7x3TRaGEo8Y5inNz0xSIuOMVgQpEYIPsB4g2N4fmYV3UOC71Bjzx.ocUP5g5SrCn9hTMR7bO8gLAIXFFtmxBE0dQE9CM8i3vNXhZd3yICBfEqsnxA0qW0.9YuupTo.xbiYTWhwWaL.9axxPAwq1bhHl8BpjQ3g99GiE38jZiwtTWkxOOjD.LCIjHB+RY1U7Ol07iEUVFDJykxHFyhX1BJmYvY8hDBNyTBx.taEatmOmAvspwEX2HxdkdSohkJ1mMGrqlKG6HihJHUjvE750fiWcHkHZkKpTNw4k2qVnTdbHNB65NERDqrYrk3KCvdJWPdFqhB.WWxXSUylsUcINyEXrsoVVhD7uYXEVj2TRPtiOrQHMHetk9smakM02VwKY1HmMjQEOymvtsBBTBYJyCSPErUQbV3mjjENwkBIEHJjr8g5OgwmZhhAb1lEnmOTllrxMfGgn3SBDT4AP6XxEPyDUxcQ8iIgmK39PfVe+AsvxGT08UbPKpmb4gtZcH69ycWlF+uoqfbkP0tC6D2syDEhufLjoReTDzkTGAzDRW6WzPnED57EB4pOG7.ggAFUVueBAGjzhgFNh6AfCGrbE+khW82JIcUV.tLayRnxxeB80qXvt+4q+0Gm022SjzYR46APsffxleFTCDGgGnmUTtH8iYijS20G4eK2QtJrZ57U8quudSylM5zxpw9VHJT0mQgU6VGzwpkkYFEVJ5I4hVcq9.cES2KfeIT0hhyFJ76EzeSICixxbxIv8g5hr7iLDAQjpqzz+JeLKDJMBOLDhPjmbGyvtgoaQ0XZ6lKKQCugOgJH01yoJULTTK6T8HCy5qM5PGmsGhSg7CuaA8GSbIhaQ2DHYxdQObvlJFfufG.Lp7Yyr5FD45NFKVrReXNlH4.MDHKGROd.PI4z+zHOE+IMyJVjZ82KSCNExX3fhWBxMLpWqwFeU+OJGD+Sww3DZn3v.BdMklDgpa6u0VoP1o7KGicbfT42U6Vyo83QLG4I8kJEi3AIWCapIM0aSMq34ansz0vzN23gYXj.tSjKVjeNA4zTIJfr3bONKe.FttDKyNs0+aCO7tBwGpOlJrWrcLVXKXDZj+9.iIib8w58mMiXKRA3t5C9g2OyWgNkGI6TNBKBnPiRcnHYBzDyl.QmwHtxGX0JHeJTsttbsjAlPXNwK9a3KQoobsVhRyUJQdX6.9qrUOfJGp6ihk.XhEO.bQ8Qx0Fa4kSO3MmWYam2U2vPq6pgMtqF17tZ392UCO3tZXq6pgse6FJGI3vHA2SU1fPiF2O9sMMs9wyLDmsh9Gfh5DmO
      

      This one is with the object, the snippet in my first post is with it trying to load from a relative path.

      1 Reply Last reply Reply Quote 0
      • whoopsydoodleW
        whoopsydoodle
        last edited by whoopsydoodle

        I've now gotten further confirmation from someone who is a long time Hise user that this has been a bug for a while and to complicate things further, sometimes it works and sometimes it doesn't. Some users have the issue, others don't.

        I am not sure if it's possibly related to what version of Logic. I have one person who is on the latest version who says they don't have the bug. Another person says they do have the bug. I'm waiting to hear back what version of Logic that second tester is running.

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

          @whoopsydoodle I just made a test project and it's working here.

          It's based on your snippet but I made a couple of adjustments - I don't think any of them will make a functional difference though.

          I use the FileSystem.UserPresets constant.
          I moved the file into the inline function
          I add a check of the button's value so we're not triggering the loadUserPreset call twice

          logicPresetTest.zip

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

          whoopsydoodleW 1 Reply Last reply Reply Quote 0
          • whoopsydoodleW
            whoopsydoodle @d.healey
            last edited by

            @d-healey haha. I don't know why but that project fails AUval here. It won't even load. I even tried changing the 4 letter plugin code and it still fails.

            I tried taking your code and putting it into my original test project and it compiles and loads fine but still doesn't work.

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

              @whoopsydoodle said in Engine.loadUserPreset() doesn't work in Logic:

              I don't know why but that project fails AUval here

              That's a mystery to solve.

              @whoopsydoodle said in Engine.loadUserPreset() doesn't work in Logic:

              my original test project

              Send me your project and your compiled AU

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

              whoopsydoodleW 1 Reply Last reply Reply Quote 0
              • whoopsydoodleW
                whoopsydoodle @d.healey
                last edited by

                @d-healey DM'd

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

                  I've done some extensive testing now.

                  I didn't realise you were exporting as an effect plugin. I was testing an instrument. I tried an effect and I got the same result as you. You should make a bug report on github with a link back to this thread.

                  The script you sent me from that other developer is using a broadcaster with a delayed listener to load the preset. I tried using a timer to see if that helped but it didn't.

                  I recommend you try and copy their setup and see if that solves it.

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

                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @d.healey
                    last edited by

                    Wow, how annoying, apparently it needs to process the audio once before it can load user presets. Can you confirm that?

                    1. Load an instance of your plugin, but don't start the playback
                    2. Try to load the user preset through the button. Doesn't work. Load it through the preset browser => works.
                    3. Start playback (it must have a clip under the transport line so it actually starts processing the plugin
                    4. Stop playback. Press the button. Now the preset loads through the button.

                    The debugger shows me that it gets stuck at an initialization check before executing the script. There are a few safe checks in HISE that handle script execution differently if the audio engine isn't initialized yet (mainly to speed up the loading time when you first run all scripts on a new plugin instance), but Logic seems to mess that up (again).

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

                      Found it, it was actually a failsafe that should guard against recursive loops when you try to load a user preset in the onInit callback, but that caused Logic to skip the preset load when the audio engine isn't initialized:

                      Link Preview Image
                      - fix Logic not loading user presets before the audio engine is initi… · christophhart/HISE@04bf696

                      The open source framework for sample based instruments - - fix Logic not loading user presets before the audio engine is initi… · christophhart/HISE@04bf696

                      favicon

                      GitHub (github.com)

                      It should work now correctly.

                      whoopsydoodleW 1 Reply Last reply Reply Quote 2
                      • whoopsydoodleW
                        whoopsydoodle @Christoph Hart
                        last edited by

                        @Christoph-Hart thanks for tackling this issue so quickly!

                        Tested as working on my end.

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

                        48

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        102.2k

                        Posts