HISE Logo Forum
    • Categories
    • Register
    • Login

    setFrontendMacros

    Scheduled Pinned Locked Moved Bug Reports
    8 Posts 2 Posters 381 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
      last edited by DanH

      @Christoph-Hart - So originally I had 5 macros set up using .setFrontendMacros and everything worked fine - if you right-click a slider / button then the pop menu appears with all 5 Macro options.

      Engine.setFrontendMacros(["LFO1", "LFO2", "STEP", "X", "Y"]);
      

      In an update I added a 6th Macro. This was all working fine in HISE (or so I thought). When I open the project in HISE the new Macro doesn't appear in the pop up menu - however if you select the 4th position (X) in which I put the new Macro in (in-between STEP and X) it links to the new Macro. So it works but it doesn't appear in the list. If I then hit compile the new ENV Macro will finally appear in the menu (and work as intended).

      Engine.setFrontendMacros(["LFO1", "LFO2", "STEP", "ENV", "X", "Y"]);
      

      I did a bit more digging and it seems that it's linked to the preset which is selected. The old presets will only present the old pop menu list (the presets themselves do not contain any save data for the new ENV Macro).

      Screenshot 2024-01-13 at 11.27.42.png

      New presets created after compilation and with ENV appearing in the list will preset the new Pop Up Menu...! (These DO have save data for the new Macro).
      Screenshot 2024-01-13 at 11.27.50.png

      I'd rather not have to try and add in the new Macro into every old preset's save data (there's 100s of them and user's have the option to overwrite presets so this could be a breaking change for many of them).

      Is this a bug or intended behaviour?!

      Many Thanks! :)

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

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

        @Christoph-Hart friendly bump! Any ideas how I can overcome this? 😄

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

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

          @Christoph-Hart Am I doing something silly or...? Have made a simple project here which includes the presets (or can test with snippet below).

          https://www.dropbox.com/scl/fi/i32zpw0dte93syhtzhr71/MACROTEST.zip?rlkey=592prm6vi7rxbzbcipay5q9vb&dl=1

          Screenshot 2024-01-17 at 09.43.49.png Screenshot 2024-01-17 at 09.43.56.png

          HiseSnippet 1136.3ocsV0raaaDDdoroasRZSSQd.H7IG.AGI2fdn8PrkrjgPrrELUbcfQPvZxkRKL4tD6tz1xF4Vd.5SRA5SPeUZeC5sBzKtyPRIRYq5XEfvCjb9c+lcmclouR5wzZohXs5fwwLh0iscGKLiZMhxEjt6fL5scqCOXPa2AMHMGGS0ZlOwxZocQMrVcYR5ye+plzPpviUvhPNRx8X6wi3lBt82507vvNTe1.dTIse4Vc8jhVxPYBflkrqShodmQGx1mhpUwlXsRaetQpbMTCSC5zT5O1cj7BQl9Gw07SCYHQChK3nL1jVi3g98mDoZBwZ49Ew8RYw8yr6w84S4WD+eWp.mBKJuGXU49fTiE.RVkfzxYP5o1tdJdroPBhmGY2UXXp.JrUWFJY5RprqkcKIngvrQD8LVGEPL0h0+w50q4.ud9OWs5KdQawPtfsglYRUiI76Q8TR85mr1dcNnwZ0bvuahecGztO98X70aW6cnC9LLu89GMqWBRDdFtT3HE6KMrCDq+7pWWc0penpysEEDLWYXzpjggL0bEiYYp6yv0EIQmxT0bNmFlvlpHbLL6Y6JOryVurM+RJJEcEbyAwrb5NxPe7LC++tYBj7SOLmHGgfplzLhuMOivMj6yTDN3jux90B4oMHofu7cOxa5tC0Pm3FvivpDyTFNFLV6vNGtalknsp8NL8YFYLbMqkLJVJv025Ql7aFYKZmPI0vECGvgfFW5mXWlUCxkDKaqWBq7X7mQvOWv8MiPh+zhPFw3CGYPp+sHJy.vSr6qXPZTSk7BMDXmNbRcfUWAz8evvgaXQEb+8a90alk6l4Jm9jF4U9XE6qq5.IevYgK8bVyDiQJV6mbLpDVsIRZeYLUngTB81ZvUIQnFAzPcgJomXp4aNlZpuiOgLmL0mQTAaHYFhWPVi5SMZae+4uDGxDPMv4KaGVHy7+HqC8boB1gvBqkkkirtPT6yZJUPrMSHueRT1FAB9MSYkQ+K344gvQtDDbBv2wo9F+vsdpsf7A1uKcM1iqMaqXzo6M4qPs48YpUYH6P4E8o99Pt3C0NWFU4MpIU0TlH7wH8jLA8jp78yaKoHG51RlrSeGoU+.lpO8J0i+j2iub5c3sh2ZbAwUaoMiwpMqjpHIh66Gx5K0brZVo9v+g1vhc4WkVL35m8a69WW8wWEUtUMgDQurbmacRP.+xzdrA7vHsAvV2Hn0Kw56seil43yBnIgFG8YfeB4hyX9Cjo5StaaKngozOIjZlsKJNtPt.DvkacgsmfbQy3xfZAZsV+das9Pg3Ss6yMdilOFqLGLBkV+Rfw7AR9F61AALOSA.W1tywetSe7IV9CkIXc7dT3nGKiCU.bgZpdLX0EBVnFKaWAKamQWGowc.WnoeJwMvStvFHsUtvFSDBIcvrAu2KqkFNxyWmxAvjHcBuUrwgFtaiLHSm+dOuY8yrVs4haENPxhZksML9xhZzR1Gu3l71E0D3p3W.KvIe2NwHixtOPH852Ns0pkUaAERsRSCI+GTTVY4A
          

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

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

            @Christoph-Hart have had a dig in the source code but it's not obvious how the macro right-click pop menu populates itself... any pointers? 😄

            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
            https://dhplugins.com/ | https://dcbreaks.com/
            London, UK

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

              Take a look at the .preset file. At the end of the xml you'll see the macro name data, this will be used to restore the names. If there is a mismatch between the item names and what you're calling with setFrontendMacros(), then it's undefined behaviour and I haven't considered this case, but it shouldn't be too hard to solve it.

              There are multiple ways to solve this, the most easiest one would be to call setFrontendMacros() in a post preset load callback when you load an older preset.

              Take a look at MacroControlledObject::enableMidiLearnWithPopup() in hi_core/hi_core/MacroControlledComponents.cpp`, that's where it populates the menu:

              auto name = macroChain->getMacroControlData(i)->getMacroName();
              
              if (name.isNotEmpty())
              {
                  mToUse->addItem((int)AddMacroControlOffset + i, "Connect to " + name);
              }
              

              so if the macro name is empty (which it will be after the preset load overwrote the macro names), it won't show up.

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

                @Christoph-Hart thank you - didn't think of that! I guess I could just call setFrontendMacros() when I load every preset to be certain...

                Great, cheers :)

                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                https://dhplugins.com/ | https://dcbreaks.com/
                London, UK

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

                  @DanH said in setFrontendMacros:

                  when I load every preset

                  AFTER you load every preset :)

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

                    @Christoph-Hart Yes just made that mistake 😆

                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                    https://dhplugins.com/ | https://dcbreaks.com/
                    London, UK

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

                    20

                    Online

                    1.8k

                    Users

                    12.0k

                    Topics

                    104.5k

                    Posts