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.
    • S
      Sawer
      last edited by

      Hello everyone!:call_me_hand_medium-dark_skin_tone:
      I tried to create a simple projects with two knobs and a button that links both. I tried to implement it myself but I failed.
      My way of thinking was right, just that I wasn't so fluent in translating what's in my mind into code, So fortunately there was a snippet in the Hise docs.
      I truly Learned a lot from the snippet but I don't understand some coding approaches that I wanna get cleared.
      I the image down here you'll see all the highlights and my questions, hope it's clear.
      Any answer is very appreciated.

      Screenshot 2022-01-12 at 15.04.32.png

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

        @nesta99

        idx is an index from the knobs array. It tells you the index of the knob that triggered the callback. Look up the indexOf function for more detail. I've also used this a lot in my videos.

        0 is bad coding :) it should be using an enum/constant. What it refers to is the property of the effect that is being changed. For example if the effect is a SimpleReverb 0 would refer to the RoomSize. You can check a list of these in the module browser.

        5c329bef-05c3-4784-a160-6e7009e17946-image.png

        control is a reference to the control (in this case a knob) that triggered the callback. Multiple controls can share the same callback, as in your example. In order to determine which of the controls triggered the callback the first argument passed to the callback is a reference to the control.

        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 man. Got it.
          Wanna ask how's the best approach based on your experience in learning scripting ?Or , how to think when coding?
          To be honest, I've been pretty much copy/Paste everything around without really digging and understanding/applying things myself.

          Thanks

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

            @nesta99 said in Learning scripting:

            digging and understanding/applying things

            this.

            HISE Development for hire.
            www.channelrobot.com

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

              @nesta99 said in Learning scripting:

              Wanna ask how's the best approach based on your experience in learning scripting

              Read lots of code, write lots of code, and rewrite lots of code.

              Also read all the documentation, write out the examples yourself, follow tutorials. If you're writing something and don't understand it, stop, and do some research.

              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 @Lindon
                Thanks for the advice.

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

                  @nesta99 and don't try to do everything at once, do it little bits after little bits 😆

                  Develop branch
                  Win10 & VS17 / Ventura & Xcode 14. 3

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

                    @matt_sf True. Thanks a lot.

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

                      Hello Everyone 🤚🏾

                      Is string.lenght working on Hise?

                      I'm currently working on some code challenges to be more proficient in programming and logic. The challenges are on JavaScript but I'm solving the problems thru coding with Hise.
                      So back to the question I'm just wondering a way to figure out the length of an string in Hise.

                      Thanks.

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

                        @sawer Yes. Don't be afraid to just try things for yourself and see if it works or not ;)

                        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
                          Yes I tried, and it said "API call with undefined parameter" , that's why I'm asking, of course I tried, but it's not working.
                          Anyway thanks for the advice, means that might need to try harder then. :)

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • 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
                                            • First post
                                              Last post

                                            50

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.9k

                                            Posts