Good exercices on JS in MaxMSP?

Thinksamuel's icon

Anyone has good exercices to study JS. The tutorials are not sufficient for me and the examples are not that clear. I would like to have some more examples that are well explained

Luke Hall's icon

Check out this post that asked something similar. Lots of the links are references rather than tutorials and none of them are max specific. My own examples aren't online any more, the hosting expired recently and I haven't renewed it. However if you think it might help to take a look I can zip it up and send you an email.

Griotspeak's icon

as trite as it sounds, project driven learning is pretty efficient. true, you don't become well rounded immediately, but i don't think that happens with only lesson based learning either.

Thinksamuel's icon

@ Luke hall, my email is Thinksamuel@yahoo.com
Thank you very much

Christopher Dobrian's icon

Here are three example JavaScript objects for Max that I wrote for someone who is a total beginner. The tasks the objects perform are very simple, but the scripts contain lots of comments, so they should be of some help to you if you need some basic instruction.

945.JavaScriptExamples.zip
zip
olihya's icon

Hello Luke,
I need to progress in javascript.
Is it possible to send me your examples?
My email: puygranier.olivier(at)free.fr
Best regards

yurki's icon

@Christopher Dobrian
thanks, your examples help me a lot ! :)

julynessi's icon

autowatch = 1;
inlets = 2;
outlets = 2;

// Max special functions
var msg_int = function (v)
{
    post("received integer value :", v ,"n");
};

var list = function (a)
{
    post(arrayfromargs(arguments),"n");
};

// get properties of all objects
var bang = function ()
{
    this.patcher.apply( function (a)
        {
            var colProps = Object.getOwnPropertyNames(a);
            if (colProps) post(colProps,"n");
        }
        );
}

// js typed array work in Max but not in OSX jsc
function testtypedarray()
{
    // eg.
    var colBytes = new Uint8Array(32);
    var colBytes = new Uint16Array(32);
}

// Dict Object if you don't know before
function dictionary(dict_name)
{
    var d = new Dict(dict_name);
    var keys = d.getkeys();

    if (!keys)
    {
        // If no keys (or empty dictionary)
        post("no keys","n");
    }
    else if ((typeof keys) == (typeof "string"))
    {
        // If dict have only one key
        post("you have one key","n");
    }
    else if (keys instanceof Array)
    {
        // If dict have more than one keys
        post("you have more keys","n");
    }

}

Marco Accardi's icon

@Luke Hall
Hi, I'm a beginner with js. Can you please send me your own examples at marcoaccardi89@gmail.com? Thank you.