JavaScript -> Crash. You too? Why? Max Equivalent?

    Nov 11 2006 | 5:44 pm
    Hello all-
    I modified the granularized.pat demo patch that comes with Max in [MaxMSP]/examples/sampling/granular. I used javascript to make a data structure that lets me hold down multiple keys and choose randomly among them to get closer to the sound of a chord with grains. It sounds nice when it works!
    (I've attached it below, check it out - and one problem - you'll probably need to remove the original from your search path before you open this! You'll know it's the right one because you can select multiple keys on the keyboard.)
    A maxing friend of mine was modifying my version of this patch on his laptop (1st generation Macbook Pro), and it only crashed once for him. On my computer (newest Macbook pro), it crashes quite soon after I open it. OS X beach-balls, and the audio continues. I have to force quit.
    I'm wondering: - does it crash for you? - do you think something other than JS is making it crash (the original version of the patch doesn't crash for me, which makes me assume the JS did it)?
    And the big question: How would you implement the javascript functionality with Max objects?
    Thanks, Kevin

    • Nov 12 2006 | 6:25 pm
      No ideas?
      Any commentary on the general reliability of javascript in max?
    • Nov 12 2006 | 6:44 pm
      On 12 nov. 06, at 19:25, Kevin Cox wrote:
      > No ideas? > > Any commentary on the general reliability of javascript in max?
      You need to give more informations if you expect a precise answer.
      - What version of Max do you use? Since 4.62, I don't have any JS crash related to garbage colector I had before. - Do you have a crash log? To be sure your crash is related to JS or not. - An important thing about JS variables is that they are globals if you don't declare them with the "var" keyword. You might encounter problem with that if you have others js objects.
      Best, ej
    • Nov 12 2006 | 8:07 pm
      Thanks, Jordan.
      I'm using 4.62. I just reinstalled with a minimum set of externals. I have a gig monday and really want to use this.
      Unfortunately, no crash log is written when it crashes this way.
      I'll have to check out the variable scope stuff... I'm going to fiddle a bit more (haven't had a chance to really try it out since I reinstalled) and I'll post my results in a few minutes.