Filling jit.matrixset from signal data/snapshot~

Oct 30, 2009 at 5:45pm

Filling jit.matrixset from signal data/snapshot~

I’m having a play at making an av sampler/looper and I’ve found a few patches around the place and put them together.

It works pretty much but its a bit buggy.

I’ve got a phasor~ which is driving the audio buffer and I am taking snapshots of this (25 hz) and doing a bit of division to get the outputmatrix/index count.

Problem is it sometimes skips an index (see Max window in patch below).

Or maybe this isnt the problem – maybe the problem is that there is not always a grabbed frame available when its time to write the matric.

Whichever I seem to get a few dropped frames.

Edit—on closer inspection (by slowing down the phasor on playback) it looks as if jit.matrixset is writing to an index which is never specified by the index message variable. How is this possible? Hmm

Can anyone show me the error of my inexperienced ways?

Thanks. Here’s the patch:

– Pasted Max Patch, click to expand. –
#46222
Oct 30, 2009 at 7:13pm

It was just an ordering problem.

Video was getting to the matrixset before I set the index and so the last known index value was coming into play.

Comment or optimisation tips always welcome though!

#166453
Nov 3, 2009 at 4:04pm

Finding my way in the dark here but just in case anyone ever happens on this thread:

I think that setting interpolation to true for the jit.matrixset stops the flickering which I think is due to the snapshot~ occasionally missing/duplicating an index.

EDIT Nope. Completely wrong about that. Back to the drawing board.

#166454
Nov 3, 2009 at 11:49pm

Hi, can u please tell what was exactly the problem in your patcher because i have the same problem..??
thanks

#166455
Nov 4, 2009 at 9:25am

Well actually I had 2 problems – 1 resolved one not:

The first one that when recording from webcam into a jit.matrixset buffer I would end up with oddframes at the wrong index.
This turned out to be because the frame was arriving at jit.matrixset before I had updated the index.

The second problem is that I seem to end up with blank (dropped?) frames withing the matrixset. I am driving the index from a phasor~ and snapshot~. I’ve tried messing with the frame rate, using metro and qmetro, altering the snapshot frequecy but cant seem to sort it out.

I am using the internal isight though – perhaps that is the problem?

#166456
Nov 4, 2009 at 4:54pm

In this simple patch is possible for you to tell me why i cant see anything? i need the jit.matrixset because i want to add a delay..

– Pasted Max Patch, click to expand. –
#166457
Nov 4, 2009 at 6:51pm
Vasilis wrote on Wed, 04 November 2009 08:54
In this simple patch is possible for you to tell me why i cant see anything? i need the jit.matrixset because i want to add a delay..

you need to tell jit.matrixset an index to which to write the incoming matrix. then you need to retrieve the matrix with the outputmatrix message. have a look at the helpfile. it’s all right there.

#166458
Nov 4, 2009 at 10:11pm

How about me! I’ve searched the forums, read the manual and everything!

Is there any way of ensuring that all the indices get filled from the grabber?

No matter what I do I keep getting dropped frames which means gaps in the matrix and flickering on playback.

#166459
Nov 8, 2009 at 2:45pm
MIB wrote on Wed, 04 November 2009 11:51
you need to tell jit.matrixset an index to which to write the incoming matrix. then you need to retrieve the matrix with the outputmatrix message. have a look at the helpfile. it’s all right there.

Except that it’s not! The outputmatrix parameter is not documented in the reference, though it is in the help patch.

#166460
Nov 9, 2009 at 6:09pm
gavspav wrote on Wed, 04 November 2009 15:11
How about me! I’ve searched the forums, read the manual and everything!

Is there any way of ensuring that all the indices get filled from the grabber?

No matter what I do I keep getting dropped frames which means gaps in the matrix and flickering on playback.

didn’t really study your patch thoroughly, but you’re probably having issues because you are driving your snapshot~ and your qt.grab from different timers.

just set @unique 1 on your qt.grab, and use [t l b] to synchronously send the matrix and bang the snapshot~

#166461
Nov 10, 2009 at 2:25pm

Thanks for your response – I think you’re right about the separate timers. Just using the tbl has helped alot.

I am trying to fill the matrix at regular intervals in time, as opposed to when the webcam grabs frames so perhaps I need to store the last grabbed frame and send that to the matrix every time my snapshot is triggered.

#166462
Nov 10, 2009 at 5:09pm

i would say just bang your snapshot~, qt.grab, and fill the matrixset all from the same metro at whatever timing you wish.

#166463

You must be logged in to reply to this topic.