loading matrix file from js


    Mar 22 2023 | 9:39 am
    maxpat 7.14 KB
    Every time I try to load matrix files in js, I get an error "jit.matrix: can't find file ..." although I have no problem loading the same file directly via read message. I've attached a patcher and a js file for you to test. Just put the matrix file attached somewhere outside of Max path or patcher path (if there is a file with the same name in Max path, Max loads it instead of the one I'm asking for), open it via the "opendialog" object and trigger the 2 messages below to compare the 2 cases. I think this is a bug and already reported it to Cycling '74 support, but I'd like to know if I'm missing something or if there is a workaround.
    PS : I've added a txt extension to the matrix file to be able to upload it to the forum but it's a binary matrix file.

    • Federico-AmazingMaxStuff's icon
      May 03 2023 | 4:17 pm
      Answered on Discord, JS file should be written like this: autowatch = 1; var myMat = new JitterMatrix(); function loadMatrix(path) { myMat.read(path); outlet(0, "jit_matrix", myMat.name); } function notifydeleted() { myMat.freepeer(); }