Forums > Jitter

cv.jit saving presets/parameters zones?

Dec 06 2010 | 9:07 pm

I have used especially Pelletier’s patch uploaded where you draw in one of the windows to produce active zones for triggers etc in the webcam window.
I added a cellblock which works well.

I have set up a preset box and have tried to store the zone information but am having no luck – connecting to cv.jit.blobs and jit.matrix.zones

I also tried to open an image to use for zones but did not have luck there either. I am new so forgive if this is basic.

I would like to set up zones of activation for my webcam and be able to save these as presets or parameters(and /or load an image to use for zones)

I tried a parameter file also but did not have success there either.

Thanks for any advice on this.

— Pasted Max Patch, click to expand. —
Dec 06 2010 | 10:29 pm

you’ll need to use some sort of intermediate storage for the zones, even just number boxes. cellblock won’t work with preset as it’s way too complex of an object. plenty of other options, just get your values and scale as needed, store in number boxes, use preset on those to re-populate them back in. avoid stack overflows, you’ll probably need a "set $1" on each to do things, depending on how you set it up.

pattr will also work for these, but preset is quicker to set up. if you don’t need interpolation between stored slots, use preset.

come to think of it, if your values are already as matrices (which sounds like you’re putting them into jit.cellblock), you can store them in jit.matrixset too. tons easier especially if you have a lot of values to store.

Dec 06 2010 | 11:07 pm

thanks very much for your suggestions.
Somehow I had not thought of storing the zones
as matrices. I will look into the jit.matrixset
and other suggestions as well.

I appreciate it!

Dec 07 2010 | 11:50 pm

I got it working after some tweaking.The subpatches were throwing me. I have the matrixset now getting fed from the [p draw zones] which has turned the image into a 1 plane matrix gray from what I gather. I feed the matrixset back into the [jit.matrix zones] , bang it and it loads beautifully. Thanks very much.

I wish there were a way to just store and load the matrices without the file dialogue box routine. I’m thinking the best option there would be to make separate patches with different zones loaded already if I can swing that.

Do you think that would be best? I’m looking at something for possible live performance.

Thanks again for your assistance. I was happy to get it reading and writing the zones!

Dec 08 2010 | 5:12 am

great to hear you got it working! the matrixset is well-suited for this.

If you want "sets of sets of matrices" :) then a different saved matrixset for each would be good. Though you can make them huge if you want, so you could access indices 0-99, 100-199, etc., all in one big one.

I personally wouldn’t use separate patches unless you want them running simultaneously, or if you want ones with different controls. To avoid the dialog box routine you should just be able to give the "read" and "write" messages the filename as the argument, no need for .matrixset extension. So while developing, save your banks, then you can loadbang them in with "read my_set_5" if there’s "my_set_5.matrixset" in the patch folder.

For more trickiness with saving and loading, like consecutive filenames, [sprintf] is your friend, as it could replace the "5" in the example above with a generated number.

Dec 08 2010 | 11:56 pm

Great ideas. I had used the readfile object in PD with a soundfile but had not thought of it with the matrixset. Very cool idea.

This is great as I think just a couple matrixset files would be nice to have for variety of response. I plan to have movement in the zones trigger sound work first and perhaps try to map a room with the webcam. I also want to tie in a midi foot pedal to trigger the load matrix sequences for a potential live event. We’ll see how it goes!

Thanks again for your very helpful comments and suggestions !

Dec 09 2010 | 1:02 am

very cool, hope it works out! the MIDI foot pedal should be simple to use with [ctlin]. maybe it could cycle through the matrixset indices, etc…

For a recent project which needed quick reading of image files from a folder, was creating short but noticeable pauses in the overall action when changing to the next file. jit.matrixset makes switching virtually instantaneous, which was great to see (and is the reason it exists it seems :)

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

Forums > Jitter