Parsing Error
-
it doesn't seem to work.
You've put your code in the on control callback instead of on init.
Is the processor ID the underlined parameter?
Yes, and parameter ID is below it. You need to clear those out so it can use the control callback you've assigned.
-
@d-healey
I now get another error while running the synth: Interface:! Line 16, column 23: Unknown function 'setAttribute'
I also noticed that every filter type is written twice. -
I now get another error while running the synth
You don't have a reference to your filter effect, you have a component reference called
filter
.I also noticed that every filter type is written twice.
Every time you recompile you're script it is running
comboBox.addItem("LowPass"); comboBox.addItem("HighPass"); comboBox.addItem("BandPass");
So you need to clear that out first, otherwise it will just keep adding to the list.
-
@d-healey said in Parsing Error:
You don't have a reference to your filter effect, you have a component reference called
filter
.
How can i add this reference? I thoughtconst var filter = Content.getComponent("MAIN FILTER");
was the way to reference the filter. I'm used to C#, and it worked well there.
-
@Ender
getComponent
is for getting components (UI widgets). You need to get the filter effect. -
@d-healey i tried to reference the filter with this:
const var filter = Synth.addEffect("PolyphonicFilter", "MAIN FILTER", -1);
but i get API call with undefined parameter 1
What should i use for the last parameter in the Synth.addEffect line?
here's my code again,const var filter = Synth.addEffect("PolyphonicFilter", "MAIN FILTER", -1) const var comboBox = Content.getComponent("FilterType"); 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]); } comboBox.setControlCallback(onComboBoxControl);
-
@Ender
addEffect
is for adding an effect. You already have the effect in your module tree, so you just need to get a reference to it. Right-click on the filter in the module tree. -
@d-healey did a right-click on the filter in module tree => create generic script reference.
Then i used the line written in the console to replace the filter const var. i still get the same API call error, and the filter type doesn't change at all. here's a screenshot of what i did
-
@Ender Looks like you've changed
local filterIndex = value - 1;
tolocal filterIndex = value;
Also I just checked in the auto-complete in HISE and there is no BandPass constant. Go through the auto-complete list yourself and see if you can find a suitable alternative.
-
@d-healey said in Parsing Error:
I found what was wrong!
put it back tolocal filterIndex = value - 1;
, but the same message came again. i suddenly thought abput the name i gave to the filter module. I changed it and everything worked well! i maybe got the issue because i left a space in "MAIN FILTER".I'm so glad to see this filter behaving like i want it to do so. Thank you so much for your help, i would probably be mad if you didn't answer to my post :)