Learning scripting
-
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. -
@nesta99
idx
is an index from the knobs array. It tells you the index of the knob that triggered the callback. Look up theindexOf
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.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. -
@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
-
-
@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.
-
-
@nesta99 and don't try to do everything at once, do it little bits after little bits
-
@matt_sf True. Thanks a lot.
-
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.
-
@sawer Yes. Don't be afraid to just try things for yourself and see if it works or not ;)
-
@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. :) -
@sawer What did you try?
-
-
-
-
-
@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.
-
@sawer Never use
var
in an inline function, uselocal
instead. Try and avoid usingvar
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. -
@d-healey
Thanks David.
Super clear explanation -
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