jit.cellblock problem "ignoring" js output

May 27, 2008 at 7:10pm

jit.cellblock problem "ignoring" js output

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?

#38094
May 28, 2008 at 4:26am

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])

#132176
May 28, 2008 at 1:00pm

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< =(folder_array.length-3))
{
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();
}

———-begin_max5_patcher———-
889.3oc0Y11apBCEG+0tj8cngWuYnO.B22cy8iwxhAgpVGPMPMa6tb+teaKh
hSkgblisroMskygy4G+oc8r2t8lQNyjuvKcP+B8.Zzn2ziLxNlYjQ0CLxIK5
k3znR6E5DKyx34Jm61Noh+hxNweREwOgVxK3HkDsZS1ZSaDpTEUnD4KPIhBd
rRV75NaSE47X4lbqCH0iJRr9SNa08zcW5bYtpT7WtYJLYra83qiTwK0depw2
UYB0yWOOJfY9F64ZZn5NnGqMJeSlHOkqrYDtwnxMp5gcadmyixr2YmeWHhRc
ry7uauwzpatqyvKm+rNsNlcaxWGogmq9mxWylIS2cIUQj5007pjyQXX+tFm8
IUCrgY8haTpAU9gVhgwXSCw8RAG8qDbqK3q44InExoyEo7yisy.Ju9.JFwyf
lIXaSHsebBODbx7Z4z4xzDdwEyJL.QE1mXaH3uQvZkPMNlmlNKUF+ztjKVl9
rHQsztljq6YoTpnr5Uv5OmjZe7ahKKiKjooGrly4AIMXKAqVVykzjjExmOBh
6QKoQF1FqYsv5ctPisD97pP6Acf232wG7E9nQtGW+QG4UFigXLAhwTHFyfXr
GDi8gX7DHFG.w3PPhDXRLPZLLHQFFjJCCRlgAoyvfDZXPJMLHoFFjVi.RqQf
sdFHsFAjVi.RqQ.o0HfzZDPZMBHsFAjViBRqQAo0nv17rgVKLz2Mjc4tfA2E
dvcgObWbR8Wsy5lKBfGEgfcAyEbhvv82EnG+te5Ze.mChho+LObc+NxHEvwq
oz.KpbC9FcjwYaTJY944vrn7EmgEDmVkG1pUEDVmq8Ji+zU.RyyeMvjKPenB
3tVyd298RSUM7HaUB8rRKjuxWZVUhLUhZ5Lygw4EiWU1NyZu7Ag.VqgTwqvv
9QM1O0Rtf+jK4BgFznjKSNYEW7tZUb4cnt5Vaqb96KbuMCLS7tG.kxMEw0Hb
6FXHx9bHgWpD4QJgdgs8WjYsaTiLcoHIgme.xxDIqk5sJ2FHssycmiM7g20S
Ga9CSnQ5RrYVoa.BtvNEaCC2b6TrMPAWmDbgCSrQuJwFSuqpm4LO1MWoa+qs
NnGt5epAkQLWos2mRFw5jRfMLzl0okE8Flfy6ZJElvHMd3eXuqkTvDq3OJgt
Xk.0ObL1222y2ruscCaOV0YsNnGcheirx16nrxLft4+.1XvX7C
———–end_max5_patcher———–

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.

#132177

You must be logged in to reply to this topic.