HISE Logo Forum
    • Categories
    • Register
    • Login

    Learning scripting

    Scheduled Pinned Locked Moved Scripting
    25 Posts 5 Posters 1.4k 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 @Sawer
      last edited by

      @sawer What did you try?

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

      S 1 Reply Last reply Reply Quote 0
      • S
        Sawer @d.healey
        last edited by Sawer

        @d-healey

        inline function charCount(word)
        {
              Console.print(word.lenght);
        }
        

        Is this Correct?

        ulrikU d.healeyD 2 Replies Last reply Reply Quote 0
        • ulrikU
          ulrik @Sawer
          last edited by

          @sawer said in Learning scripting:

          Console.print(word.lenght);

          it's miss spelled "length"

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

          1 Reply Last reply Reply Quote 3
          • d.healeyD
            d.healey @Sawer
            last edited by

            @sawer

            Is this Correct?

            No. You've spelt it wrong. It's length.

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

            S 1 Reply Last reply Reply Quote 1
            • S
              Sawer @d.healey
              last edited by

              @d-healey @ulrik Thanks so much for the correction

              S 1 Reply Last reply Reply Quote 0
              • S
                Sawer @Sawer
                last edited by

                @sawer Hello everyone.
                I've Created a function that checks the min/max elements in an array and pushes those values into another array that will be then displayed in the console.
                Done almost everything, just want to be able to display the values inside an array.

                inline function minMax(a)
                {
                	var a = [];
                	var minMaxNums =[];
                
                        var min = Math.min(a[i], a[i]);
                	var max = Math.max(a[i], a[i]);
                	
                	minMaxNums.push(min);
                	minMaxNums.push(max);
                	
                	for(i = 1; i <= minMaxNums.length; i++)
                	{
                		Console.print(minMaxNums[i]); //when I put "[I]" next to minMaxNums the Console comes out with "API call with undefined parameter 0". Am I missing something?
                	}
                	
                	
                	
                }
                
                minMax([2, 7]);
                

                Any help is greatly appreciated. thanks.

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

                  @sawer Never use var in an inline function, use local instead. Try and avoid using var whenever possible.

                  To output the contents of an array to the console you can use the trace command - Console.print(trace(myArray));

                  Also you're function parameter is called a but then you are also declaring a variable with the same name inside your function. That's going to cause problems.

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

                  S 1 Reply Last reply Reply Quote 1
                  • S
                    Sawer @d.healey
                    last edited by

                    @d-healey
                    Thanks David.
                    Super clear explanation ✅

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sawer
                      last edited by Sawer

                      Hello Everyone.
                      Simple question.

                      What I'm currently doing is solving JavaScript coding challenges in Hise , but I'm felling a bit overwhelmed of the amount of things to know, secondly, sometimes I'm felling like wasting time on things that I won't really be in need when I'll be developing plugins in Hise, and if I continue follow this it will take me a year maybe before digging into Hise.
                      I Just want to apply the 80/20 rule in other to learn effectively without wasting time on digging to unnecessary challenges/Subjects.

                      Thanks to @Lindon and @d-healey, I got to understand HOW to learn this language, but I don't really know WHAT.
                      Since my purpose of learning is oriented to "audio software development" what are the CORE and important things to learn and grasp about programming in this field?

                      By writing this I'm not saying that Programming shouldn't take long to learn or I that want to learn it in 20 minutes.
                      If it takes 2 years to be proficient, I'll go for it.
                      Just that I wasted too much time digging around tutorials, trials and errors in many languages.
                      It's since 2020 that it's going like this. Just want to learn effectively and efficiently.

                      Hope my question is clear. Thanks

                      S d.healeyD 2 Replies Last reply Reply Quote 0
                      • S
                        Sawer @Sawer
                        last edited by

                        @sawer Ok everyone.
                        Everything is in the Hise docs.
                        Will start by digging there.

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

                          @sawer said in Learning scripting:

                          If it takes 2 years to be proficient, I'll go for it.

                          I've been at it for 20 :)

                          I think the best way to learn is to work on a project that you care about. Start with a simple project though - although you won't know what simple really is until you know what you're doing ;) I think all beginners and non-programmers underestimate the complexity of their projects so really try to make it very very simple.

                          Write a list of 10 features you want your project to have and work on those. Try to avoid adding any new features until you've implemented those 10 and they are fully working the way you want.

                          Once you've finished your project make a new project that's very similar but this time try and write it using fewer lines of code.

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

                          S 1 Reply Last reply Reply Quote 0
                          • S
                            Sawer @d.healey
                            last edited by

                            @d-healey Thanks so much David. Really great explanation!✅

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

                              @sawer If you try to stick to these guidelines you code will be more readable and you'll be following a lot of "best practices" - https://docs.hise.audio/scripting/scripting-in-hise/hise-script-coding-standards.html

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

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                Sawer @d.healey
                                last edited by

                                @d-healey Really helpful, Thanks David.
                                Might get back to the calculator and apply everything stated here, because I really care about it, just that I got a lil discouraged. As you said, I overestimate the Complexity of it.

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

                                34

                                Online

                                1.7k

                                Users

                                11.7k

                                Topics

                                102.0k

                                Posts