Forums > Gen

jit.gen sample question


Oct 18 2016 | 4:06 pm

I am trying to replace the third cell in a 3 cell matrix with another cell, but seem to be getting weird behavior. could someone explain what’s going on inside the jit.gen patch here? Do I have to send the gen sample object an xy pair?

Thanks

— Pasted Max Patch, click to expand. —
Oct 18 2016 | 4:07 pm

oh man, I’m sending the param message to the wrong object. That fixed it -_____-

Oct 18 2016 | 6:42 pm

I’m still having trouble with this. I’m getting values up to a certain point between cells and then a jump past the exact value of the cell. What’s the best way scrub all the way through, including the actual cell values? I’m working on updating this piece to have the beginning and end of a gl.mesh sort of unfold rather than step. https://vimeo.com/145430840

— Pasted Max Patch, click to expand. —
Oct 19 2016 | 12:01 am

there is interpolation when using the sampe operator, interpolation between adjacent cells, the "nearest" operator should prevent this interpolation, but it doesn’t seme to solve the problem when it ried to replace sample by nearest in your patch… will try again later !

Oct 19 2016 | 10:36 am

Ah, thanks for the object tip vichug! this patch does what I want.

— Pasted Max Patch, click to expand. —
Oct 19 2016 | 5:42 pm

I was about to mention the difference between pixel and texel coords but I see what you’re doing. Interpolating a single cell value in Gen pretty slick. Usually it’s all or nothing. Do you know if it’s possible to do the same with cells other than boundary cells? I don’t think it’s possible in one pass. Either way, thanks for the patch.

Oct 19 2016 | 6:04 pm

It should be possible to zero in on any particular cells. Haven’t messed around much more with this besides starting to integrate that patch into the previous piece though.

You just have to modify the >= part of the patch to be && <= as well using those values for the a to b interpolation. It’s one pass, but there’s probably a way to get the interp value internalized in the gen patch.

Oct 19 2016 | 6:34 pm

It’s tricky to target single cells because of the lack of arrays in Gen. I can target a single pixel and display it with a click (ex. color picker) but I can’t target another unique cell with that value prior to output without influencing more cells. I think the reason your approach works is because you are using 1 as your second lerp value versus interpolating two unique cells. Not sure.

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

Forums > Gen