Call of getScriptingAudioSampleProcessor() outside of onInit callback
-
Sometimes when I load a preset, HISE prints the following error:
Call of getScriptingAudioSampleProcessor() outside of onInit callback
It points to a line where I'm using Synth.getSlotFX inside an inline function.
It happens once in a while. Why?
-
@bendurso said in Call of getScriptingAudioSampleProcessor() outside of onInit callback:
Synth.getSlotFX
Is your inline function a factory function?
-
@d-healey It's a inline function of a combobox.
inline function onEffectComboboxControl(component, value)
I have a lot of things inside because it's for changing the hardcoded module networks
-
@bendurso I see. When you use functions that create references, like
Synth.getSlotFX
orContent.getComponent()
you should place these inon init
and store the reference in aconst
.Then use that reference throughout the rest of the script, rather than creating a reference each time you want to access the module.
-
@d-healey Oh, but I can't place it on init. Because I have just one inline function for 36 comboboxes. So I'm using getSlotFX depending the selected combobox index.
-
@bendurso Put all your slot fx into an array, and all of your combo box references in another array. Then you can use the index of the combo box that was clicked to select the correct slot fx.
-
@d-healey Oh nice, thanks :)
-
B bendurso marked this topic as a question
-
B bendurso has marked this topic as solved