HISE Logo Forum
    • Categories
    • Register
    • Login

    Changing the filter mode from a ComboBox

    Scheduled Pinned Locked Moved General Questions
    12 Posts 5 Posters 1.5k 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.
    • d.healeyD
      d.healey
      last edited by

      This was brought up some months ago. There is a mismatch between the indexes which I believe was caused by new filter types being added and Christoph trying to avoid causing backwards compatibility issues. The current work-around is to do it via a custom callback.

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - Public HISE tutorials
      My Patreon - HISE tutorials

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @d.healey
        last edited by

        @d-healey ok so what are the values I need ot set, and where do I put this "custom callback"?

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon

          Ok well I found this:

          https://forum.hise.audio/topic/74/how-to-control-modules-with-scripts

          Which is helpful, in some ways. It tells you how to set a value IF you know what the "magic numbers" are - sadly it is not uncommonly pretty poor at telling you how to find these magic numbers.

          oit says this:

          "But there is no need for magic numbers, there are several ways to obtain the index:

          In the development tools area, there is a searchable list with all modules. You can right click on a module and a popup with all parameter names and their respective index should popup."

          but of course the world moved on and there is no "searchable list" that I can find. In tools menus or in the UI...

          So for those of you wanting to set the mode of a filter here's the code you will need:

          const var yourFilterName= Synth.getEffect("yourFilterName");
          
          inline function onButton1Control(component, value)
          {
          	//Add your custom logic here...
          	yourFilterName.setAttribute(yourFilterName.Mode, <a magic number>);
          };
          
          Content.getComponent("Button1").setControlCallback(onButton1Control);
          

          The magic numbers seem to be:

          0 = Biquad LP
          1 = Biquad HP
          2 = Lo Shelf EQ
          3 = Hi Shelf EQ
          4 = Peak EQ
          5 = Biquad LP Rez
          6 =SVF LP
          7 =SVF HP
          8 =Moog LP
          9 =1 Pole LP
          10 =1 Pole HP
          11 = not assigned
          12 = SVF Notch
          13 = SVF BP
          14 = Allpass
          15 = Ladder 4 Pole

          -- who knows where Ring Mod is, anything above 15 seems to be unasigned , anything below 0 crashes HISE -- you were warned.

          HISE Development for hire.
          www.channelrobot.com

          orangeO 1 Reply Last reply Reply Quote 0
          • orangeO
            orange @Lindon
            last edited by

            @Lindon Ringmod Filter is 17 ;)

            develop Branch / XCode 13.1
            macOS Monterey / M1 Max

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

              @orange thanks mate - I tried 17 and it didnt seem to work - but clearly I didnt cause its working now...

              HISE Development for hire.
              www.channelrobot.com

              1 Reply Last reply Reply Quote 1
              • Christoph HartC
                Christoph Hart
                last edited by

                const var list = Engine.getFilterModeList();
                

                the object returned from this method contains all filter indexes as constants. You can use it in a combobox in conjunction with an array of string like this:

                const var list = Engine.getFilterModeList();
                
                const var myIndexes = [ list.LowPass, list.RingMod, list.Peak ];
                const var myNames = ["Fnky VA LopazZ", "Ringmod", "Ultra clean super analog style peak PULTEC Simulation"];
                
                1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey
                  last edited by

                  Oh I was late getting back to this post tonight. Seems a solution has been provided. For reference though I will include a link to the related thread - https://forum.hise.audio/topic/877/filter-mode-dropdown-bug/6

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

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

                    @Christoph-Hart It seems the getFilterModeList() function isn't working properly

                    This gives a no iterable type error.

                    const var indexes = Engine.getFilterModeList();
                    
                    for (k in indexes)
                    {
                        Console.print(k);
                    }
                    

                    Free HISE Bootcamp Full Course for beginners.
                    YouTube Channel - Public HISE tutorials
                    My Patreon - HISE tutorials

                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by

                      The object that is returned from this function is not a standard Javascript object, but a special object with read only properties.

                      I didn't add iterator support for it because it would defeat the entire purpose of the object which is selecting a few filter types that you want to show. Relying on the order and how many filter types I have added to HISE is the exactly why there is this object :)

                      d.healeyD 1 Reply Last reply Reply Quote 2
                      • d.healeyD
                        d.healey @Christoph Hart
                        last edited by

                        @Christoph-Hart Ah gotcha, I understand now.

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - Public HISE tutorials
                        My Patreon - HISE tutorials

                        1 Reply Last reply Reply Quote 0
                        • J
                          Jerems134
                          last edited by

                          i want assign Biquad Lp Rez & Biquad HP mono filter mode on button.
                          see my code :

                          Content.makeFrontInterface(600, 600);
                          
                          const var list = Engine.getFilterModeList();
                          
                          const var BqLPR = list.BiquadLpRez;
                          const var BqHP = list.BiquadHp;
                          
                          const var Button1 = Content.addButton("Button1", BqLPR, BqHP);
                              if (Button1 == 0)    
                          {
                                  Synth.getEffect(BqLPR);
                             }
                             else (Button1 == 1)  
                          {
                               Synth.getEffect(BqHP);
                          }
                          
                          const var Filter1 = Synth.getEffect("Filter1");
                          

                          For now button switch with Biquad LP & Biquad HP (no Biquad LP Rez)

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

                          31

                          Online

                          2.0k

                          Users

                          12.6k

                          Topics

                          109.8k

                          Posts