jit.cellblock problem "ignoring" js output


    May 27 2008 | 7:10 pm
    I have a js script sending color changing messages to a jit.cellblock. It works... sometimes. The jit.cellblock hears some of them and changes color, but ignores others. If I connect a print object to the js output, it *always* outputs the proper message, even when jit.cellblock ignores it. What could be causing this to happen?

    • May 28 2008 | 4:26 am
      It sounds like it could be a stray character that doesn't show in print but jit.cellblock doesn't like. Have you tried the output as a message? (right inlet of message or [Prepend Set])
    • May 28 2008 | 1:00 pm
      Thank you for responding! I tried going js -> message box -> jit.cellblock and clicking the message box. When I do that it works every time.
      Here is my patcher/js. I think it may be Windows-only because of the way it handles browsing.
      save as file_browser.js
      autowatch = 1;
      outlets = 4;
      var prev_folder = "";
      //max.os = operating system
      function back_folder()
      {
      if(prev_folder.charAt(prev_folder.length-2)!=":")
      {
      if(prev_folder.charAt(prev_folder.length-1)!="/")
      prev_folder += "/";
      var folder_array = prev_folder.split("/");
      var n = 0;
      var jump_to = "";
      while(n {
      jump_to += folder_array[n] + "/";
      n++;
      }
      jump_folder(jump_to);
      }
      }
      function go_file(to_file)
      {
      if(prev_folder.charAt(prev_folder.length-1)!="/")
      prev_folder += "/";
      outlet(2, prev_folder + to_file);
      }
      function jump_folder(to_folder)
      {
      var fold_count = 1;
      var file_count = 0;
      var n = 0;
      var f = new Folder(to_folder);
      outlet(0, "clear", "all");
      outlet(0, "set", 0, 0, "...");
      outlet(1, "clear", "all");
      outlet(1, "rows", 0);
      f.reset();
      while(!f.end)
      {
      var cur_file = new File(f.pathname + f.filename);
      if(f.filetype=="fold")
      {
      outlet(0, "set", 0, fold_count, f.filename);
      fold_count++;
      }
      else
      {
      if(f.extension==".wav")
      {
      outlet(1, "set", 0, file_count, f.filename);
      outlet(1, "cell", 0, file_count, "frgb", 255, 0, 0);
      file_count++;
      }
      else if(f.extension==".jxf")
      {
      outlet(1, "set", 0, file_count, f.filename);
      outlet(1, "cell", 0, file_count, "frgb", 0, 0, 255);
      file_count++;
      }
      }
      cur_file.close();
      f.next();
      }
      prev_folder = to_folder;
      f.close();
      outlet(0, "rows", fold_count);
      outlet(1, "rows", file_count);
      }
      function go_folder(to_folder)
      {
      var fold_count = 1;
      var file_count = 0;
      if(to_folder!="...")
      {
      if(prev_folder.charAt(prev_folder.length-1)!="/")
      jump_folder(prev_folder + "/" + to_folder);
      else
      jump_folder(prev_folder + to_folder);
      }
      else
      back_folder();
      }
      It's a file browser for showing .jxf and .wav files. It always lists the files correctly, but only gets the colors right when the button at the top of the patcher is used to jump to a folder.