Getting Filter mode name to use in a label
-
Hi all,
I am struggling trying to get a label to show the current filter mode name.
I have just knocked this snippet up quickly on my break so I think it is missing a timer maybe as I used that method from @d-healey preset name label tutorial.
I should be able to get that working when I get home, but it is more I am not sure how to get the value of the Filter mode name as I am unsure of the required syntax.
Hopefully one of you will be able to look at the snippet and once you have finished laughing at the stupid errors in there, be able to let me know how to reference/call the filter mode name for the label.
Thanks in advance
HiseSnippet 1000.3oc0WE0aaaCDlxwrsVqsnsXXX6Mg7jCPVfbVVaJJFlWbhGLZSpybVvdqfVh1lKTjZTTc0anuu+R6s9eX+Q1+fs6jjsjyryLLv.V7CA43ceG+3wOdmceiNfmjnMDmFWLMlSbtOcvTkcRmILghz6XhyGQeEaHWZ4IVxQSiYII7PhiyVeKFfSi5jrO+4WeDSxTA7xkHjK0h.9qDQBa4p8a+RgT1kExuPDUI5CZ2KPq5nk5TfLaQ8IwrfqXi4mwvvpQIN24jPgUaFXY.YHN0ORGNcvD8Oqxi+RQhXnjiFsHCfDkubWsLDYLtJoyDgLr+rCcBAxR+xRvV4kfOldpHTLe8xRwixb3UhnZ8vo1hzaqEnWqpzyuB8VBkbpPo54T5wzAAFQrszS9USOkkaFwfxdUpjGKo1u6P6ngHT18hXWw6Z.i4HZ9Te+c8f+ryKbcgReh06sLi2KU5gs79JuY.GysczQwZEXzb6LuaCHJAjoNVMhb2HDWWgRJTbuQop.qPq7zpr7g.MZYyfYn1ERrLkui6u51vsQdF1KgCYyxemc6c85J.8no0dmpC439cIFdycfM48uvMKmX3E4sCSJGBZolKtcHipvjyzV9qUMy2y265ccWiFsTeEISxMK0MpwM2DvlpzngbyBmXHP3heQ0Dc0poph8f76fJApU8TB6qi4pU8DfTbwgJuBVAgZyzcOrP2MPJB4Fh.jW2klUEIYDt786m1l788NlYYyRCjQXWh4Fq.O.NGyeKzMHWN2fdLO4JqNFdXOWqPbb+W2z2MeC+v31Smaz9GaGIBCk795DAVfK401fmE5SEwJSBY+1IVd7.wuvqFR7rpSuPjqEpMngjA5EA+Kt7cnn3CKdyo+cyo+CJneltMi82KuE5Jo+GLsGNdVqu6SOX+mcXqm66enOA063dcA18cEzh7OaW7HjboRlcwtWXK6BGXMpZKCrsfBpcSqVGtdKs5qWKsati65R2GS6KrASVNeqsD9BBu+q4aw.hGPOYzHdfsjr0oc+gMcZPq0eZPwL5mP6qkSimnUhfbUPFIJkDqdNMgz0v+oTtJnrx8a+Q6yqdsmIrq7v97Tl7ZU5iDwZIyrV2Ba9Qu9ZJU9D57Ck2sH8Mdyb6gueFs3R2CK12d38Com++.x9c5TqPM9Tl0Hfo.zyRiF.s6C3.QUJtDGw6TCGFma6i1HgFvUgYF+E7ovYKz1ovYqYNIQr.i9MA4ivw2O2KaEfSpruCcC5ons27Y2Tp+d9DXxo3MAAXSrOG39xwr+Ff4K1.LGrAX9xM.yS2.LOaCvb3MhA+4DeSpUGkqMgE5eR12gxw4DECTYYxTxeC0s3o3B
-
This isn't a thing
Filter1.Mode.getValue()
.You just need to add all the names of the filter modes you want to use to an array, and then use the knob's value as the array index.
-
@d-healey I thought that might be the case but tried it and as it didn't break the compile I left it like that for the snippet.
It is just the standard filter I am using, nothing custom.
I am just trying to print the text from the combo box that is in the filter to the label.
Is there a way to call the standard filter modes or is the only way to do that to add them individually into an array? -
Is there a way to call the standard filter modes or is the only way to do that to add them individually into an array?
Search the forum for
Engine.getFilterModeList()
It doesn't work like other objects though so you'll need to play with some of the examples dotted around the forum.The other solution is to just add them to an array.
const modes = ["mode1", "mode2", "mode3", etc.];
-
@d-healey said in Getting Filter mode name to use in a label:
Engine.getFilterModeList()
Thankyou, I'll have a search now and see if I can figure it out
-
@d-healey after searching around the threads and examples, I'm not sure that I am going to be to do exactly what I wanted originally - have the filter type change via the knob and then use the label to dynamically display which filter is currently selected.
Even if I could get it to work I have now realised after some reading that the filter modes aren't sequential, so using a knob as a selector would result in a couple of blank selections so it is probably best to call the ones I want to use and have a combobox to select them.
-
@rzrsharpeprod said in Getting Filter mode name to use in a label:
@d-healey after searching around the threads and examples, I'm not sure that I am going to be to do exactly what I wanted originally - have the filter type change via the knob and then use the label to dynamically display which filter is currently selected.
Even if I could get it to work I have now realised after some reading that the filter modes aren't sequential, so using a knob as a selector would result in a couple of blank selections so it is probably best to call the ones I want to use and have a combobox to select them.
or use an array of names as david suggests...
-
@rzrsharpeprod as David say, put these names in an array, and use the the combobox value to display the right name.
const filterTypes = ["1 Pole LP", "1 Pole HP," "SVF LP", "etc......."]; Label.set("text", filterTypes[FilterCmb.getValue()-1]);
If my memory doesn't fail me you have to set -1 to the combobox value because it starts with value 1 and up, not from 0 as the array index
-