Forums > Jitter

new object i'd like for the holidays

December 27, 2007 | 12:42 pm

Hi all,

I’ve been really getting into using jitter matrices (matrixes? never
sure about the proper plural for those) as large-scale arrays for
data storage and retrieval. I was a bit hesitant at first, because
we need to send them messages like "getcell X X X" and then parse out
data of the form "cell X X X val X X X X", which may change depending
on the matrix dims/type (and I try to avoid regexp whenever possible,
just to stay sane). But I have to say, this is a really nice way of
storing and retrieving and manipulating large amounts of data. Not
that it can’t be improved…

What bothers me still are the messages I need to send. If a matrix
is a virtual object, referencing some hazy collection of memory
blocks somewhere in my mysterious computer, why can’t the cells be
treated this way to? Why can’t there be an object like
[jit.matrixcell myMatrix X X X] that refers to a single cell of a
matrix, and when banged, spits out the contents of that cell, or when
a list comes in, set the cell it refers to to the list contents? It
could have a few messages like "cell X X X" to update the cell it
referenced, and "refer MATRIX_NAME" to change the matrix it pointed
to, and spit out errors if that matrix didn’t exist. Really simple,
no parsing necessary, unless it also had a right outlet from which
you could get all the usual matrix info stuffs, like dims, type,
name, etc.

I’d do this, but a quick look at the jitter code is like peeking
inside a manhole cover in NYC. Lots of wires, pitfall, wet and angry
alligators… best not to muck about there unless you have some time
on your hands, and steel boots.

So, is this a practical idea?

Happy Holidays!

-Evan


December 27, 2007 | 2:54 pm

what about jit.submatrix -> jit.iter?

wes

#P toggle 15 154 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 15 175 63 196617 qmetro 100;
#P newex 84 292 41 196617 jit.iter;
#P newex 84 322 32 196617 print;
#P toggle 84 73 15 0;
#P newex 84 94 57 196617 qmetro 30;
#P user jit.pwindow 363 194 82 62 0 1 0 0 1 0;
#P newex 84 150 175 196617 jit.slide @slide_up 5. @slide_down 5;
#P newex 84 118 122 196617 jit.noise 3 float32 40 40;
#P newex 84 235 171 196617 jit.submatrix @offset 5 4 @dim 1 1;
#P newex 84 201 134 196617 jit.matrix datasink @thru 0;
#P connect 3 0 0 0;
#P fasten 3 0 4 0 89 181 369 181;
#P connect 9 0 0 0;
#P connect 1 0 8 0;
#P connect 0 0 1 0;
#P connect 10 0 9 0;
#P connect 8 0 7 0;
#P connect 5 0 2 0;
#P connect 6 0 5 0;
#P connect 2 0 3 0;
#P window clipboard copycount 11;


December 27, 2007 | 5:03 pm

hi wes

i’ve seen you use this technique before, it’s a generally a good
technique and I actually started out using it on a few projects, BUT
I have found examples where this breaks badly under high stress.
Unfortunately, I can’t find any of them right now, as luck would have
it. I will dig some more. I do remember that if you’re constantly
changing the jit.matrix at the top, the jit.submatrix may not update
fast enough or in sync with your changes, whereas if you use getcell/
setcell you have a much better chance of getting the correct (for
your purposes) data. Dang, I wish I could find that patch so I can
illustrate this happening. It was not a bug but a timing issue that
needed to be taken into account.

Also, I don’t like jit.iter. Too easy to make it do horrible things
to your computer. That, and I just find it conceptually opaque, by
which I mean try explaining it properly to someone else. It does too
much in a single object, for general purposes – an object that could
get you a single cell, where you have exact control over which cell
it points to (so you can iterate through it yourself) is generally
much more useful to me than having to remember what jit.iter’s
outlets do and which I can ignore. Just my 2 cents (and I do use
jit.iter a lot these days).

Now that you mention it, since jit.iter already does this, and its
close cousin jit.spill has source code available in the Jitter dev
kit, maybe I can (eventually) roll my own object.

Cheers
Evan

On Dec 27, 2007, at 2:54 PM, Wesley Smith wrote:

> what about jit.submatrix -> jit.iter?
>
> wes
>
> #P toggle 15 154 15 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 15 175 63 196617 qmetro 100;
> #P newex 84 292 41 196617 jit.iter;
> #P newex 84 322 32 196617 print;
> #P toggle 84 73 15 0;
> #P newex 84 94 57 196617 qmetro 30;
> #P user jit.pwindow 363 194 82 62 0 1 0 0 1 0;
> #P newex 84 150 175 196617 jit.slide @slide_up 5. @slide_down 5;
> #P newex 84 118 122 196617 jit.noise 3 float32 40 40;
> #P newex 84 235 171 196617 jit.submatrix @offset 5 4 @dim 1 1;
> #P newex 84 201 134 196617 jit.matrix datasink @thru 0;
> #P connect 3 0 0 0;
> #P fasten 3 0 4 0 89 181 369 181;
> #P connect 9 0 0 0;
> #P connect 1 0 8 0;
> #P connect 0 0 1 0;
> #P connect 10 0 9 0;
> #P connect 8 0 7 0;
> #P connect 5 0 2 0;
> #P connect 6 0 5 0;
> #P connect 2 0 3 0;
> #P window clipboard copycount 11;


December 27, 2007 | 6:23 pm

Not to deter you from making whatever object suits your needs in C,
but the following sounds like it would be relatively simple to make
as an abstraction using patcherargs. As for cell X X X val X X X X,
to get the value will always be zl slice dimcount+2, where dimcount
can be found using zl len on the output of the getdim message, or
even simpler, zl ecils planecount.

-Joshua

On Dec 27, 2007, at 4:42 AM, evan.raskob [lists] wrote:

> Hi all,
>
> I’ve been really getting into using jitter matrices (matrixes?
> never sure about the proper plural for those) as large-scale arrays
> for data storage and retrieval. I was a bit hesitant at first,
> because we need to send them messages like "getcell X X X" and then
> parse out data of the form "cell X X X val X X X X", which may
> change depending on the matrix dims/type (and I try to avoid regexp
> whenever possible, just to stay sane). But I have to say, this is
> a really nice way of storing and retrieving and manipulating large
> amounts of data. Not that it can’t be improved…
>
> What bothers me still are the messages I need to send. If a matrix
> is a virtual object, referencing some hazy collection of memory
> blocks somewhere in my mysterious computer, why can’t the cells be
> treated this way to? Why can’t there be an object like
> [jit.matrixcell myMatrix X X X] that refers to a single cell of a
> matrix, and when banged, spits out the contents of that cell, or
> when a list comes in, set the cell it refers to to the list
> contents? It could have a few messages like "cell X X X" to update
> the cell it referenced, and "refer MATRIX_NAME" to change the
> matrix it pointed to, and spit out errors if that matrix didn’t
> exist. Really simple, no parsing necessary, unless it also had a
> right outlet from which you could get all the usual matrix info
> stuffs, like dims, type, name, etc.
>
> I’d do this, but a quick look at the jitter code is like peeking
> inside a manhole cover in NYC. Lots of wires, pitfall, wet and
> angry alligators… best not to muck about there unless you have
> some time on your hands, and steel boots.
>
> So, is this a practical idea?
>
>
> Happy Holidays!
>
> -Evan


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