Hi there,
i recently started using Hise to build a little synth. I wanted to add a combobox to switch between three filter modes (LP, BP and HP). my issue here is that i can't get the right filter type. i did some research and found a topic here that talks about the filters indexing.
I found a code snippet to select the right filter type (this thread: https://forum.hise.audio/post/5632). I wrote the same code in the interface script in the onControl tab, but i always get the same error, and i can't figure out what's wrong: "Error at inline function parsing: {SW50ZXJmYWNlfG9uQ29udHJvbCgpfDMyNHwxNnwy}".
Can someone tell me what i did wrong please? Here's my code:
/*function onControl(number, value)
{
}
*/
const var modes = Engine.getFilterModeList();
const var myFilters = [modes.LowPass, modes.HighPass, modes.BandPass];
comboBox.addItem("LowPass");
comboBox.addItem("HighPass");
comboBox.addItem("BandPass");
inline function onComboBoxControl(component, value)
{
local filterIndex = value - 1;
filter.setAttribute(filter.Mode, myFilters[filterIndex]);
}
Oh, and one more thing : does anyone know why my code is always erased when i reopen the project? i have to rewrite it everytime...
Thanks in advance!