Forums > Jitter

picture show questions

March 14, 2006 | 11:54 am

Hi everybody!

I just bought Jitter the other day, so my questions will probably be really stupid. Sorry!

I have a folder full (42) of small JPEG’s that I want to show in a 7*6 grid. I’ve been experimenting with JS and jit.matrix.
I can’t get my head around displaying them without stretching on the proper x,y coordinates.
I guess I should use dstdimstart & dstdimend, but I don’t understand how to set these variables in JS, e.g something like mymatrix.dstdimstart = [0,0];

Help would be much appreciated.



March 14, 2006 | 3:10 pm

While javascript is all well and good, the humble
object might serve you well here by means of common messages.
As always, those tutorial things will be of some use.

March 14, 2006 | 3:16 pm

I actually think that Zip is on the right track for what he wants to do.
I’m not sure how using would be in any way better,
faster or easier to use for this particular task.

If you want to use JS, I believe that the syntax you’ve specified is
correct. Don’t forget to set mymatrix.usedstdim = 1; before writing into it.


March 14, 2006 | 5:00 pm

Like so:

var outmatrix = new JitterMatrix(4,"char",320,240);

function bang()

function jit_matrix(matrixname)
outmatrix.usedstdim = 1;
outmatrix.dstdimstart = [100, 100];
outmatrix.dstdimend = [200, 200];

March 14, 2006 | 5:04 pm

Thanks, guys!

I was experimenting with JS for easy nested loops. All my ideas so far were rip-o-matics from the examples/tutorials…

I will have a look at

Jitter is deep, I’m afraid I’m doing stuff more convoluted than necessary.
Being new to JS doesn’t help either.



March 21, 2006 | 2:16 pm

This what I have now in a JS object:

// inlets and outlets
inlets = 1;
outlets = 1;

var mymatrix = new JitterMatrix(4, "char", 7*65, 6*43);
var qtmatrix = new JitterMatrix(4, "char", 7*65, 6*43);
var f;

function loadbang()

mymatrix.usedstdim = 1;

f = new Folder("G5:/Users/zipboterbloem/Documents/Gemeentemuseum/Simpele Versie/fotootjes");
for (var j=0; j < 6; j++) {
for (var i=0; i < 7; i++) {
mymatrix.dstdimstart = [i*65, j*43];
mymatrix.dstdimend = [i*65 + 65, j*43+43];


outlet(0, "jit_matrix",;

What it is supposed to do:
On startup, load 42 small pix in a matrix, and show it to the unsuspecting public.
What it does: nothing on load, just the black. jit.pwindow

I have 2 questions:
1. the loadbang() is supposed to trigger on patcher load. I don’t see any pix though, I just get a file slector(?). Even when I select one of my pix, nothing happens.
2. When I send the message loadbang by hand, I get a file selector. Why?
There’s a complete path to the folder with pix I’m trying to read. After I select a picture file, there’s a pause of a few seconds, and then my pix are shown like they should.
What am I doing wrong?
TIA for any insights…


Viewing 6 posts - 1 through 6 (of 6 total)

Forums > Jitter