Macros - Clear All?
-
@d-healey :thumbs_up:
-
@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?
-
@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 ;)
-
@d-healey said in Macros - Clear All?:
BackendComponents.cpp
Isn't that more for Midi Controls? What about MacroControlledComponents.cpp?
Line 193 ish?
-
@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!
-
@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!
-
@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.
-
@d-healey yep I'm searching now, thanks! :)
-
@d-healey Ok so how does one wrap stuff into a script function?! :face_with_tears_of_joy:
-
-
@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); }
-
@DanH said in Macros - Clear All?:
synthChain->clearData(index);
So now you need to dig deeper and find out what the clearData function does.
-
@d-healey Hmmm... need a hint, where to look perhaps? To me it looks like it clears the data collected in the lines above.
-
@DanH Find the function definition and see what it's doing
-
@d-healey I'm getting confused. Is it defined in the the file, or is it a more general c++ thing?
-
@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() { }
-
@d-healey gotcha
-
@d-healey searched the SC for clearData... Nothing pertinent coming up :/
-
@DanH is it this you're looking for?
-
@ulrik Thanks, I honestly don't know :face_with_tears_of_joy:
Does it define the function of clearData