HISE Logo Forum
    • Categories
    • Register
    • Login

    Macros - Clear All?

    Scheduled Pinned Locked Moved General Questions
    28 Posts 3 Posters 1.1k 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

      Is there a function to 'clear all macros' does anyone know?

      So if you've assigned a few macros to LFOs or whatever around your UI you can essentially delete them all with the click on a button

      Ta!

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

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

        I don't see such a function in the API. I don't know much about macros, is it possible to clear them individually with scripting?

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

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

          @d-healey mmmmmm. You can assign them via scripting so I assume you can unassign them too. So perhaps my current solution is a global- like button which unassigns every macro control to every knob on the ui. Great! 😂😂 (there are lots of knobs!)

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

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

            @DanH said in Macros - Clear All?:

            (there are lots of knobs!)

            That's what Content.getAllComponents() is for ;)

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

            DanHD 2 Replies Last reply Reply Quote 0
            • DanHD
              DanH @d.healey
              last edited by

              @d-healey :thumbs_up:

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

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

                @d-healey this is the only API I can find for asigning Macros:

                ScriptSliderPack.addToMacroControl(int macroIndex)

                Do you know of a way to invert this?

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

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

                  @DanH I don't think it's possible with scripting. It wouldn't be too hard to add a script wrapper for the clear macro control though. BackendComponents.cpp line 157 is where you should start ;)

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

                  DanHD 2 Replies Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by DanH

                    @d-healey said in Macros - Clear All?:

                    BackendComponents.cpp

                    Isn't that more for Midi Controls? What about MacroControlledComponents.cpp?

                    Line 193 ish?

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

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

                      @DanH When you right-click on one of the macro knobs it says "Clear MacroControls". I searched the source code for that string and it appears in the place I mentioned. So that's where I would start, take the functionality that's already there and wrap it into a script function. If you find another way of doing it then go for it!

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

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

                        @d-healey Interesting, I've found the option you referred to. It clears the assigned controls but also resets the name of the macro which was defined in LAF so.... hmmmm!

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

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

                          @DanH Looking in the source you'll see the control does those things separately, so you don't have to wrap all of the functionality in the scriptable function, just the part you want.

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

                          DanHD 2 Replies Last reply Reply Quote 0
                          • DanHD
                            DanH @d.healey
                            last edited by

                            @d-healey yep I'm searching now, thanks! :) 🤓

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

                            1 Reply Last reply Reply Quote 1
                            • DanHD
                              DanH @d.healey
                              last edited by

                              @d-healey Ok so how does one wrap stuff into a script function?! :face_with_tears_of_joy:

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

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

                                @DanH

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

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

                                  @d-healey Thanks, I had a play with the code and couldn't find a way to prevent the name resetting.

                                  I was commenting out lines from this bit at 206, but it was all or nothing. Perhaps it's elsewhere in the script. The function here is for one Macro at a time, but I guess it could be tweaked to apply to all.

                                  	if(result == -1)
                                  		{
                                  			synthChain->getMainController()->getMacroManager().setMacroControlMidiLearnMode(synthChain, index);
                                  			synthChain->getMainController()->getMacroManager().setMidiControllerForMacro(-1);
                                  
                                  			synthChain->clearData(index);
                                  
                                  			macroNames[index]->setText("Macro " + String(index + 1), dontSendNotification);
                                  
                                  		}
                                  

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

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

                                    @DanH said in Macros - Clear All?:

                                    synthChain->clearData(index);

                                    So now you need to dig deeper and find out what the clearData function does.

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

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

                                      @d-healey Hmmm... need a hint, where to look perhaps? To me it looks like it clears the data collected in the lines above.

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

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

                                        @DanH Find the function definition and see what it's doing

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

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

                                          @d-healey I'm getting confused. Is it defined in the the file, or is it a more general c++ thing?

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

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

                                            @DanH clearData is a function, so somewhere in the HISE sourcecode there must be a place where that function is defined, it will look something like (but not exactly the same as):

                                            function clearData()
                                            {
                                            }
                                            

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

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

                                            17

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.6k

                                            Posts