HISE Logo Forum
    • Categories
    • Register
    • Login

    Type safety!

    Scheduled Pinned Locked Moved Scripting
    31 Posts 7 Posters 1.7k 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 @Christoph Hart
      last edited by

      @Christoph-Hart Thank you

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

      1 Reply Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff
        last edited by Dan Korneff

        This safety check is pretty aggressive. I'm trying to track down some API call with undefined parameter 0 errors, but HISE isn't being helpful at the moment.
        I get an error at a line that doesn't contain code, and if I comment out the ENTIRE script I still get the error 馃し
        The only way to make it clear the error is to restart HISE.

        It seems to be circling around addComboBox, and that combo box initializes with a value of 0.0.

        edit:
        it seems to initialize to 0.0 if "saveInPreset": "0" . Is that by design?

        Dan Korneff - Producer / Mixer / Audio Nerd

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

          @Dan-Korneff said in Type safety!:

          I get an error at a line that doesn't contain code

          I'm seeing this a lot too. However if you look above the Console, on the same line as the Compile button you might get a more helpful message.

          ComboBox values start at 1, so that might be the issue.

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

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

            You guys know you can just change a flag in HISE to restore the old compiler strictness?

            Link Preview Image
            HISE/hi_scripting/hi_scripting.h at d91fb47d5cec35358dbf56235fb412bc931a723e 路 christophhart/HISE

            The open source framework for sample based instruments - HISE/hi_scripting/hi_scripting.h at d91fb47d5cec35358dbf56235fb412bc931a723e 路 christophhart/HISE

            favicon

            GitHub (github.com)

            I really stand by this decision from a language design perspective, undefined as function arguments cause more pain than it is useful, but I understand how annoying it is if you just want to pull the latest changes and find your interface completely broken because of a new restriction.

            Anyways, I've changed the default value here so that old projects load without issues, and you even can deactivate the warning in the Hise preferences (Development -> Warn If Undefined Parameters) if you want to go full on ostrich on your code quality :)

            Dan KorneffD Adam_GA 2 Replies Last reply Reply Quote 3
            • Dan KorneffD
              Dan Korneff @Christoph Hart
              last edited by

              @Christoph-Hart nah, I'd rather know that these issues exist and deal with them. Thankful for the feature, annoyed with debugging 馃

              Dan Korneff - Producer / Mixer / Audio Nerd

              1 Reply Last reply Reply Quote 0
              • Adam_GA
                Adam_G @Christoph Hart
                last edited by

                @Christoph-Hart do we just need to change #define HISE_WARN_UNDEFINED_PARAMETER_CALLS 0 to 1? or is there something else that needs to be changed?

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

                  @Adam_G pull the latest changes, then this flag is set and prints the warning. If you then want to disable the warning, untick the box in the preferences.

                  Adam_GA 1 Reply Last reply Reply Quote 0
                  • Adam_GA
                    Adam_G @Christoph Hart
                    last edited by

                    @Christoph-Hart getting some errors on compiling hise.JPG

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

                      @Adam_G I think that means you are low on RAM. Try closing other programs that you are not using when compiling or reduce the number of threads that VS is using during the compilation.

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

                      LindonL Adam_GA 2 Replies Last reply Reply Quote 0
                      • LindonL
                        Lindon @d.healey
                        last edited by Lindon

                        @d-healey said in Type safety!:

                        @Adam_G I think that means you are low on RAM. Try closing other programs that you are not using when compiling or reduce the number of threads that VS is using during the compilation.

                        • its more likely to mean that the plugin is using too many png's or wav files stored inside the plugin itself - past about 50Mb (if I recall correctly) the compiler runs out of heap space....on Windows only

                        HISE Development for hire.
                        www.channelrobot.com

                        1 Reply Last reply Reply Quote 1
                        • Adam_GA
                          Adam_G @d.healey
                          last edited by

                          @d-healey doh! you were right. too many other programs open

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

                            @Adam_G said in Type safety!:

                            @d-healey doh! you were right. too many other programs open

                            careful --- re-running the compile when th eissue is the one I pointed at can sometimes run successfully...

                            HISE Development for hire.
                            www.channelrobot.com

                            1 Reply Last reply Reply Quote 0
                            • Dan KorneffD
                              Dan Korneff
                              last edited by

                              I'm running into some undefined parameter warnings that I could use a hand with.
                              I have a function that adds a childPanel to an existing panel. The paint routine is triggering Warning: undefined parameter 0 if the panel hasn't been created yet, or if the childPanel has been removed.

                              	inline function addButton(panel)
                              	{
                              	    local button = panel.addChildPanel();
                              	    button.set("allowCallbacks", "Clicks & Hover");
                              	    
                              	    button.setPaintRoutine(function(g)
                              	    {
                              	        g.setColour(this.data.hover ? Colours.red : Colours.blue);
                              		g.fillPath(myPath, [10, 5, 14, 14]);
                              
                              	    });
                              
                              	}
                              

                              Is there a better way to do this that won't throw these warnings?

                              Dan Korneff - Producer / Mixer / Audio Nerd

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

                                @Dan-Korneff

                                	inline function addButton(panel)
                                	{
                                            if (!isDefined(panel))
                                                return;
                                
                                	    local button = panel.addChildPanel();
                                	    button.set("allowCallbacks", "Clicks & Hover");
                                	    
                                	    button.setPaintRoutine(function(g)
                                	    {
                                	        g.setColour(this.data.hover ? Colours.red : Colours.blue);
                                		g.fillPath(myPath, [10, 5, 14, 14]);
                                
                                	    });
                                
                                	}
                                

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

                                Dan KorneffD 1 Reply Last reply Reply Quote 0
                                • Dan KorneffD
                                  Dan Korneff @d.healey
                                  last edited by Dan Korneff

                                  @d-healey Perfect! Simple and effective.
                                  Actually, this method still returns errors

                                  Dan Korneff - Producer / Mixer / Audio Nerd

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

                                    @Dan-Korneff

                                    Actually, this method still returns errors

                                    Explain

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

                                    Dan KorneffD 1 Reply Last reply Reply Quote 0
                                    • Dan KorneffD
                                      Dan Korneff @d.healey
                                      last edited by Dan Korneff

                                      @d-healey I've added this to the childPanel functions:

                                                  if (!isDefined(panel))
                                                      return;
                                      
                                      • Run the function that creates the child panel.
                                      • Close the panel.
                                      • Hit F5 to recompile All Scripts.

                                      Then I get Warning: undefined parameter 0

                                      After closer inspection, the warning is pointing to the line that contains fillPath. I can confirm that this path is being defined. It points to all paint routines

                                      Dan Korneff - Producer / Mixer / Audio Nerd

                                      1 Reply Last reply Reply Quote 0
                                      • Dan KorneffD
                                        Dan Korneff
                                        last edited by Dan Korneff

                                        Here's a basic example:

                                        HiseSnippet 1334.3ocsW0uaaaCDWJIJs1acXEXO.b9OFjA7BrrcbhSPQasSxZ1VRLlSKJvPP.iDsMQjIMjnchQQd+1iydC1tizxRx4i1ZrI.KHd2u63cGu634tQReVbrLxxtv4yFyrr+VmdyDpgcFR4BqiOvx96bNgFqXQDCo1yFSiiYAV11q+KHA6BaXoe96W2lFRE9rTRVVePx8Y+NeDWkRs6a9MdX3Qz.147QYP23MG6KEcjgxIf8rtSUqwT+qoCXmRQXq4XYu4gAbkLpmhpXw.l1xfY8FJuQXv+AdL+pPFtvypGnHCYqNC4gAcS70XKK6M5l54qa77ev4Dd.eA8zHv2qYPRkHaLvdsmxj79JLI6LlzFFS5kN87i3iUobP64abNV.GH8oPnNqoXvZs1O+LmNR.gPs0H50rihfEKjvsY0pUHvqx6WrHDtiUjozHRWpfE5QdEIQRZPfllaICqRUHfbnTIHhYncMlEo3rXXSF8q8N6zLv+TwBktgGnFVZuZ3dBKGx3CFpJsGIg.MLTdSG38UvIcbo8J0IjCeP9Ix6jSY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CSYMqqljC0iIBzK9G3YNSObs8bldILsFQ8ijW5aJEwwcetlBXSB8z8Ef+lArl3YoKOyFmGASeeouedUcOAqspBVeUErwpJ31qpfMWUA2YUEb2Ouf3eN5sSTxQlxFKqS5dntels8gBJjApyVs9W.ObaiA
                                        

                                        Load it up and hit F5

                                        Dan Korneff - Producer / Mixer / Audio Nerd

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

                                          @Dan-Korneff There's something really weird going on there because even if I delete everything in the script I still get the error when hitting F5.

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

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

                                            Oh I found the solution (still not sure why it goes crazy even when the script was cleared though).

                                            Child panels are kept between recompiles, so it's necessary to clear them all out before adding them. Just put this after you create the parent panel.

                                            for (x in Panel1.getChildPanelList())
                                            	x.removeFromParent();
                                            

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

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

                                            20

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.5k

                                            Posts