Auto-detect Feedback

jersmi's picture

I have been dedicated to making slightly more meaningful forays into video feedback and I have a desire to create a patch to monitor whites blasting out and auto-detect some way to tamper this. I think of the classic cycling 74 audio plugin "feedback network" (among others) which detects feedback and adjusts levels accordingly. It seems plausible, thinking of the histogram patch. I would imagine an outcome with good glitchy unexpected results. How could go about this?

dust's picture
Re: Auto-detect Feedback

using some different blend modes and mixing the accumulated feedback with an overlay or mix patch could clear up somethings. if you want to auto detect a specific hue there is a plugin you can use to do this.

matthias oostrik makes a pixel average mean plugin. basically you would want to use the average mean or overall pixel values to detect your hue then conditionally make changes based on what ever threshold or tolerance settings you want.

http://www.magdatt.nl/software.html

matthias is very cool helped me test an ipad app i made at the mapping festival. it was funny.. we both where like ahhh i don't know to use modul8. so yeah i think he does some really interesting work. http://oostrik.net/

we are working on a project this summer.

so yeah im sure there are other ways to auto-detect. not really sure what you got going on for a feedback network.

gtoledo3's picture
Re: Auto-detect Feedback

So, are you imagining a look that would get just on the verge of feedback within a certain tolerance to handle things like different source images being different brigtnesses? Doesn't the cycling patch you refer to basically reign auto audio feedback in the same way an anti feedback unit in an audio playback system would?

psonice's picture
Re: Auto-detect Feedback

Simple and glitchy solution: write your own GLSL feedback patch, doing additive or whatever blending to give you feedback, then use the mod command so anything too bright becomes dark (but keeps a non-zero value). It should look something like feedback + solarise filter.

jersmi's picture
Re: Auto-detect Feedback

All good stuff. Thanks, gents. Of course discovering new ways for how the image is recombined with the original is the heart of the matter. I use composite modes with the color matrix in the feedback chain quite often.

dust, thanks a lot for the tip on the plugin. that's the kind of direction i expected to take this, just wondering about the most elegant way if any. that sounds like a good place to start. and cool that you did some work with him.

and gt, yes, i'm not sure on the details of how an anti-feedback system works in an audio playback system, but re: c74's feedback network i think the answer would be yes, the way i'd imagine it i'd feed whatever image is coming out the accumulator (for ex.) into a filter / shader placed within the feedback line. The image would be analyzed for luminosity (right?), then luminosity would be reduced back just enough to teeter on chaos. I think the feedback network uses five bandpass filters at different cutoff freq (q is probably set?), then when amplitude goes above threshold value, gain is reduced (smoothed, limited) to a manageable range.

i like psonice's idea for the GLSL shader; this is a good way to learn, I guess. i imagine something with a slightly more sensitive range. of course i'm looking for quirks and interesting surprises.

i like the feedback stuff right now. 2D lives!

psonice's picture
Re: Auto-detect Feedback

Yeah, can't beat 2D for sheer fun! I really love feedback too. In fact this discussion plus the fact that I have a super annoying iphone UI bug to fix led me to waste an hour playing with glsl + feedback to chill out.

The result isn't entirely what I was expecting, but I like it. And it does manage to avoid getting washed out.. although it also avoids any kind of sane colour palette too :)

*** NOT suitable if you're epileptic ;) ***

PreviewAttachmentSize
unlimited diamonds.qtz16.95 KB

jersmi's picture
Re: Auto-detect Feedback

Hey, that's cool, psonice! I'm playing around with the math but don't have anything relevant to share yet. I like how the GLSL grid params can be manipulated in place of the Image Transform patch I'm used to using. Promising for a new approach.

Still not quite the feedback auto-detect I was thinking about, but that could be another journey.

Question: would it be possible (practical, wise, etc.) to make a GLSL shader patch with blend modes? I had the silly idea that I could pile them all into one shader and switch between them for the feedback texture. Like from here, maybe?

http://www.nathanm.com/photoshop-blending-math/

If so, how?

psonice's picture
Re: Auto-detect Feedback

Yeah, manipulating the grid = huge fun. This is really 'most simple case', just using it for zoom. You can rotate the grid too.. including in 3 dimensions. Set the zoom to 0, and try rotating around x or y for example..

Then if you want some really cool effects, increase the grid resolution. Now move the vertices in the vertex shader. You can vary the feedback effect in different parts of the screen like this :)

For the blending effects, yeah it's certainly possible to implement them in a shader (at least all the ones I've seen). I guess it's possible to switch between them by having something like:

uniform int select;
uniform sampler2D image, feedback;
 
vec4 colourBlend(){
   return texture2D(image, gl_TexCoord[0].xy) * texture2D(feedback, gl_TexCoord[0].xy); // Not a real colour blend!
}
 
vec4 addMoreBlendModesHere(){
   ...
}
 
void main() {
   vec4 pixel;
   if (select = 0) return colourBlend();
   if (select = 1) return lightenBlend();
   ... insert more here ...
   return vec4(0.0); // if all else fails return nothing
}

Disclaimer: written from memory, totally untested. Could be optimised plenty. Performance may suck heavily on older cards (I think until recently something like this would result in EVERY blend mode being calculated for every pixel, but it should be ok on recent cards - can anyone confirm if that's correct and which cards will be ok with it?)

psonice's picture
Re: Auto-detect Feedback

...and here's a quick example of using the vertex shader to distort the grid and get different feedback effects. I've just used a simple sin distortion more or less, giving it a rippling, twisting look. Adding stuff like vortices is fairly simple too.

PreviewAttachmentSize
feedback with vertex transform.qtz15.98 KB

jersmi's picture
Re: Auto-detect Feedback

thanks a ton, psonice. that is very helpful.