Forums > Jitter

Scrolling multiple images

October 12, 2010 | 7:47 am

Can you please suggest how one could modify the patch shown below (from here: http://www.cycling74.com/forums/topic.php?id=1148) to work with arbitrarily long sequences of individual images loaded from a sub folder where the patch resides? And – alternatively – with several 4-part images in a sequence.

thank you

– Pasted Max Patch, click to expand. –

October 12, 2010 | 9:31 am

Without getting into the mechanics of the patch (I don’t have time at the minute), here’s a simple mechanism to dynamically load images that are numbered in sequence, but you’ll have to work out how you are going to time the loading operations.

– Pasted Max Patch, click to expand. –

October 12, 2010 | 12:32 pm

Thank you. This is useful to see. I figured out how to read images into umenu, I think. But I am not very clear what the patch above does and how one would go about organizing cycles. Maybe naming the files a001, a002; b001, b002 and then reading them into separate lists? Then looping through one list before switching to another and – finally – returning to the beginning? Nor sure what mechanism in MAX would be suitable.

Sorry about the simple questions.


October 12, 2010 | 2:04 pm

This patch works in the GL world, it reads an image file to gl.texture which in turn gets mapped onto a gl.sketch object which is scrolled with the position message and rendered to a window by jit.gl render. It appears there’s a gl.videoplane for a qt.movie object which will enable you to play movies on top of all this, but you can delete that section if you don’t need it.

Hook a print up to the position message going into gl.sketch and you’ll see the scrolling value for each image. I would suggest a new image gets loaded every time an image scrolls out of view. So use a ‘match’ ‘select’ or ‘=’ object or something similar to recognise a value and use that as a trigger to load a new image (with the mechanism I already gave you). I haven’t looked at this extensively, but its something to start with…


October 13, 2010 | 11:19 am

Thank you for the suggestions. Here is my attempt at this.

Some progress but I am still rather stuck.

I would like:

1. To load 4 image files as textures from a chosen folder. So far, I am managing to load one into all 4 textures and am not sure how to pick first 4 to load in order. I thought with a Gate maybe…?

2. I have added a bit that observes the position value for one of the images and generates a bang. Again, not very clear of how to use this information, especially given the confusion in point 1.

3. Even if 1 and 2 above would work, I imagine some way of preloading would be necessary to avoid jerkiness. Or how this is does in the patch is to cycles through multiple images?

Thank you again,

Anna

– Pasted Max Patch, click to expand. –

October 13, 2010 | 3:12 pm

OK,

1. Your friend here is modulo [%], is this what you want?

– Pasted Max Patch, click to expand. –

2. can be used to feed above patch

3. Well, the image that is loading should be off screen if you are timing things correctly. I should imagine it would be alright unless you are loading exceptionally large images and it might slow the whole patch down.


October 14, 2010 | 4:42 am

Thank you once again for your help. It is more or less working now. See below. I have some further questions if I may.

1. It is jerky when images are loaded. Can something be done? I.e., can I preload them into memory on patch start or some such?

2. I am not sure what dimensions I need to be changing to make it match different screen sizes.

3. Alpha blending does not seem to be having an affect.

4. I am not sure how to apply further effects to this setup given it is a gl render.

5. And finally, perhaps more challenging, how would i go about using images of the same height but of arbitrary lengths with this setup.

Thanks again.

EDIT: Hmm… In fact the images do not change off-screen as I thought they were. This is because I do not really understand the coordinates and motion math done in the patch. If someone could cast a light on it – would be super.

– Pasted Max Patch, click to expand. –

`


October 14, 2010 | 11:44 am

Just to add that I figured out how and where to use blending and also how to use the second layer. So, this work.

However, the other questions remain. Especially, the fact that I cannot make the new images load off screen. The place where they load seems to fluctuate…

Here is the latest version:

– Pasted Max Patch, click to expand. –

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