HISE Logo Forum
    • Categories
    • Register
    • Login

    Parsing Error

    Scheduled Pinned Locked Moved General Questions
    17 Posts 2 Posters 462 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.
    • E
      Ender
      last edited by

      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!

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

        @Ender It doesn't look like you have a reference to the filter.

        Do you save your project before you close it?

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

        E 1 Reply Last reply Reply Quote 0
        • E
          Ender @d.healey
          last edited by

          @d-healey
          oh yes, i didn't noticed that. I added that line, but it still shows the error:

          const var filter = Content.getComponent("MAIN FILTER");
          

          I called the filter "MAIN FILTER".

          Yes, i save the project. At least, i do a CTRL+Shift+S to save the xml. I don't know if there's something else to do.

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

            @Ender Oh I just noticed you don't have a reference to the combo box either, in which case you probably haven't assigned the control callback to it and are still using processor/parameter ID.

            When you reopen your project are you loading the xml?

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

            E 1 Reply Last reply Reply Quote 0
            • E
              Ender @d.healey
              last edited by

              @d-healey
              I added a reference to the comboBox, but i don't know how to assigne the control callback you talk about. Here's what i got:

               const var filter = Content.getComponent("MAIN FILTER");
               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]);
               }
              

              Did i forget anything?

              I go to the open recent xml tabe and select my project, which is in the case "3xOSC".

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

                @Ender Call comboBox.setControlCallback(onComboBoxControl); (remember to remove the processor/parameter ID assignment in the interface designer).

                I go to the open recent xml tabe and select my project, which is in the case "3xOSC".

                Should work.

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

                E 1 Reply Last reply Reply Quote 0
                • E
                  Ender @d.healey
                  last edited by

                  @d-healey
                  it doesn't seem to work. here's a screenshot. Is the processor ID the underlined parameter? Hise Issue.png

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

                    @Ender

                    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.

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

                    E 1 Reply Last reply Reply Quote 0
                    • E
                      Ender @d.healey
                      last edited by

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

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

                        @Ender

                        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.

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

                        E 1 Reply Last reply Reply Quote 0
                        • E
                          Ender @d.healey
                          last edited by

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

                          const var filter = Content.getComponent("MAIN FILTER");
                          

                          was the way to reference the filter. I'm used to C#, and it worked well there.

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

                            @Ender getComponent is for getting components (UI widgets). You need to get the filter effect.

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

                            E 1 Reply Last reply Reply Quote 0
                            • E
                              Ender @d.healey
                              last edited by

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

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

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

                                E 1 Reply Last reply Reply Quote 0
                                • E
                                  Ender @d.healey
                                  last edited by

                                  @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 didHise Issue.png

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

                                    @Ender Looks like you've changed local filterIndex = value - 1; to local 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.

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

                                    E 1 Reply Last reply Reply Quote 0
                                    • E
                                      Ender @d.healey
                                      last edited by

                                      @d-healey said in Parsing Error:
                                      I found what was wrong!
                                      put it back to local 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 :)

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

                                      64

                                      Online

                                      1.7k

                                      Users

                                      11.8k

                                      Topics

                                      103.0k

                                      Posts