HISE Logo Forum
    • Categories
    • Register
    • Login

    Getting Filter mode name to use in a label

    Scheduled Pinned Locked Moved General Questions
    9 Posts 4 Posters 327 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rzrsharpeprod
      last edited by

      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
      
      ulrikU 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by d.healey

        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.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        R 1 Reply Last reply Reply Quote 1
        • R
          rzrsharpeprod @d.healey
          last edited by

          @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?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @rzrsharpeprod
            last edited by

            @rzrsharpeprod

            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.];

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            R 1 Reply Last reply Reply Quote 1
            • R
              rzrsharpeprod @d.healey
              last edited by

              @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

              R 1 Reply Last reply Reply Quote 0
              • R
                rzrsharpeprod @rzrsharpeprod
                last edited by

                @rzrsharpeprod

                @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.

                LindonL 1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @rzrsharpeprod
                  last edited by

                  @rzrsharpeprod said in Getting Filter mode name to use in a label:

                  @rzrsharpeprod

                  @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...

                  HISE Development for hire.
                  www.channelrobot.com

                  1 Reply Last reply Reply Quote 1
                  • ulrikU
                    ulrik @rzrsharpeprod
                    last edited by ulrik

                    @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

                    Hise Develop branch
                    MacOs 15.3.1, Xcode 16.2
                    http://musikboden.se

                    R 1 Reply Last reply Reply Quote 1
                    • R
                      rzrsharpeprod @ulrik
                      last edited by

                      Thankyou guys, I should be able to get this to work when I get home and it will be more feature rich than I had originally planned so will end up being better in the long run.

                      Thanks again for your help @d-healey @Lindon @ulrik - it is much appreciated

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      36

                      Online

                      1.7k

                      Users

                      11.8k

                      Topics

                      102.7k

                      Posts