Tipps for learning programming, mathmatics, ...

    Oct 26 2011 | 10:39 am
    Hi folks,
    Every day I have another question and while I am really blown away by this fantastic community, I want to improve my basic knowledge of the foundations needed for this program. Also, I am having so much fun with this, that I might also start programming in the future. My background is years of doing complex stuff in logics enviroment and a little kontakt scripting. So, I know a little bit about the basics, like variables, midi language, OSC, etc., but in most aspects I am only scratching the surface. Hence, my question where to start: I will probably only be using max for a year and focus on midi and OSC. I start getting good results, but with more complexity things start getting messy. Is there any tutroials, books or forums you could recommend for a start? I also need to review my knowledge of mathmatics. Highschool is more than a decade ago.

    • Oct 26 2011 | 4:14 pm
      I am learning programming slowly but what I found so far is the maths is not too complicated. There is a lot of basic maths and a few expressions (which u either look up someplace or it is just a long string of simple math). For me at least high maths is not absolutely necessary - more important for me is logical math like thinking that allows me connect it all up in a way that works(is stable), makes sense and uses less objects or cables.
      Midi and Osc are control protocols so should require a little less - you most likely would not need audio math or jitter matrices - it's more about logical switching, scaling ranges and counting.
      Spend a little time messing around with the zl objects an vexpr and that should pay off pretty quickly.
      Again I am not a real programmer so maybe else will come in and say high math is essential but for where i am I now i don't see too much of it - it's all tidied away in objects.
    • Oct 26 2011 | 9:01 pm
      Yeah, that's how I started and still do it. But wouldn't it be helpfull to have some kind of basics book for a programmer? I guess there isn't some sort of bible for that ... I'll check aut your hints. Thank you!
    • Oct 26 2011 | 10:37 pm
      There are lots of papers online which you can download written by Miller Puckette, which go quite in depth on the audio programming side of things, though the maths can get quite difficult in places. The Theory and Technique of Electronic Music is a good one.
      There is also Curtis Roads' Computer Music Tutorial which is very useful for learning about how various digital audio components work.
    • Oct 27 2011 | 9:02 am
      +1 for both those citations
    • Oct 27 2011 | 3:08 pm
      It sounds silly, but a pen and paper are the best programming tools money can buy. Whether you're writing low-level code or patching away in a high-level visual environment like Max, it really helps to start with some simple logic diagrams or flowcharts.
      Sketch out a step-by-step procedure to achieve your goal (start with small goals!) and visualise the flow of data. Try to spot potential problems early on - if you've got an outline of an algorithm, test it! Feed it a range of inputs to see if and where it breaks.
      Don't worry about maths! Once you get your head around how an algorithm works, and _why_, you won't need to read nightmarish equations to understand what's going on. Invent your own notation if it helps! As long as you take baby steps at every stage, you'll save a lot of time on bug-hunting!
      Don't optimise things prematurely; this can lead to all sorts of nightmares. That said, one thing it's worth being aware of from day one is this: never calculate anything more often than is necessary. If you've calculated a value once, stash it somewhere for safekeeping so you don't waste CPU cycles when you next need it.
      Oh, and play! IMO you learn the most from those "What the!?!?" moments - they keep you on your toes, so keep trying new things. Just don't do too many things at once - try and keep your "What the!?!?"s in single file :)
    • Oct 27 2011 | 10:46 pm
      you don´t need to fully understand (great) books like "elements of computer music" by richard moore to become a good max programmer. but some slightly advanced maths (say functions) comes handy, and if you want to really raise abstraction and efficiency you´ll get deeper into it on the wings of the particular issue (like shorten algos for massive interpolations or high quality timestretching). i agree with the "paper and pen"-idea as clarity is the most important thing in programming, so i use the [comment]-object as a notepad. it´s just so much about getting the logics straight to the point. therefore in most regular cases it is much more useful to really clarify your basic maths/logical understanding than striving towards anything "higher".
      another thing is to not hesitate reprogramming the same stuff over and over again, from the new standard of your knowledge.
      some time ago i had pascal and c at school and university, with very good marks, but those didn´t come by institutional education (tbh i wasn´t even there despite doing the exams). it came only by some joyful practise and natural interest.
    • Oct 28 2011 | 1:37 am
      Wow! Thanks! Again! This community is the greatest I have ever come across!
      The pen and paper clarity thing I already learned in kontakt scripting. It is really important not to get lost. i will check out those books at some time.
      My problem is, that for many issues I find a sollution, but I am missing some insight in the vast number of possible objects.
      E.g.: Today I needed to store values from 1-16 in three dimensions, so I found the table object to be helpful. Unfortunately, I couldn't find any object, that could store values in three dimensions, so I just created 16 of those tables. Things started to get messy, as I combined these and in the end it worked. However, my patch ended up so complicated, I can barely follow, what I have done ... :-) I am sure I could have achieved the same thing way easier, i just didn't know what object to look for. I guess it will get better with some routine ... I hope so! I hope I don't bore you guys to death with my newbie stuff! :-)
    • Oct 28 2011 | 7:51 am
      For your 3 dimensional table object, you could probably use a jitter matrix (jit.matrix) to store your data - many people get caught up thinking jitter is just for video, not true!