Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Video Editing/Mangling

Reply
 
Thread Tools Display Modes
Old 11-13-2020, 10:28 PM   #1
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default Blitter feedback with color inversion!!! [solved]

Edit - Well I beat my head against it long enough and finally figured out enough to make it happen. The screen will probably go black when you insert it. You have to wiggle both the input AND output gain knobs to make it work.

Code:
// ashcat_lt better blitter feedback
//if the screen goes black on insert, wiggle input AND output gain
//@param in_gain_s 'input gain (db)' 0 -20 20 0 0.1
//@param fb_gain_s 'feedback gain (db)' -1 -20 20 -1 0.1
//@param angle_s 'rotate (degrees cw)' 0 -180 180 0 0.1
//@param xoffs_s 'X shift (right)' 0 -1 1 0
//@param yoffs_s 'Y shift (down)' 0 -1 1 0
//@param zoom_s 'zoom' 0 -10 10 0
//@param mode_s 'mode (normal, add, multiply, difference)' 0 0 3 1.5 1
//@param invert 'invert output (on/off)' 0 0 1 0.5 1
//@param out_gain_s 'output gain (db)' 0 -20 20 0 0.1

in_gain_s != in_gain_l ?
  (in_gain = 10 ^ ((in_gain_l = in_gain_s)/20););
fb_gain_s != fb_gain_l ?
  (fb_gain = 10 ^ ((fb_gain_l = fb_gain_s)/20););
angle_s != angle_l ?
  (angle = $pi * ((angle_l = angle_s) /180););
xoffs_s != xoffs_l ?
  (xoffs = (xoffs_l = xoffs_s)/(2););
yoffs_s != yoffs_l ?
  (yoffs = (yoffs_l = yoffs_s)/(2););
zoom_s != zoom_l ?
  (zoom = (zoom_l = zoom_s)/(2););
mode_s != mode_l ?  
  (mode_l = mode_s;
   mode = (mode_l == 2 ? 3 : mode_l == 3 ? 19 : mode_l;););
out_gain_s != out_gain_l ?
  (out_gain = 10 ^ ((out_gain_l = out_gain_s)/20););

mix_in_a = in_gain;
feedback_a = fb_gain;
output_a = out_gain;

black = gfx_img_resize(black,project_w,project_h,1);
  gfx_set(0,0,0,1,0,black);
  gfx_fillrect(0,0,project_w,project_h);
white = gfx_img_resize(white,project_w,project_h,1);
  gfx_set(1,1,1,1,0,white);
  gfx_fillrect(0,0,project_w,project_h);

mix_in = gfx_img_resize(mix_in,project_w,project_h,1);
  gfx_a = 1;
  gfx_dest = mix_in;
  gfx_mode = 0;
  gfx_blit (black);
  gfx_a = mix_in_a;
  gfx_blit (0);

feedback_in = gfx_img_resize(feedback_in,project_w,project_h,1);
  gfx_a = 1;
  gfx_dest = feedback_in;
  gfx_mode = 0;
  gfx_blit (black);
  gfx_a = mix_in_a;
  z = 10^(zoom/10);
  dw = (project_w*z)&-2;
  dh = (project_h*z)&-2;
  x = (project_w - dw + xoffs*(project_w+dw))*.5;
  y = (project_h - dh + yoffs*(project_h+dh))*.5;
  input_info(output,srcw,srch);
  sc=2.0; sc2=sc*.5 - 0.5;
  gfx_rotoblit(output,angle,(x-dw*sc2)|0,(y-dh*sc2)|0,dw*sc,dh*sc, -srcw*sc2, -srch*sc2, srcw*sc, srch*sc);

feedback = gfx_img_resize(feedback,project_w,project_h,1);
  gfx_a = 1;
  gfx_dest = feedback;
  gfx_mode = 0;
  gfx_blit (black);
  gfx_a = 1;  
  gfx_blit (mix_in);
  gfx_mode = mode;
  gfx_a = feedback_a;  
  gfx_blit (feedback_in);

output = gfx_img_resize(output,project_w,project_h,1);
  gfx_a = output_a;
  gfx_dest = output;
  gfx_mode = 0;
  invert == 1 ?
  (gfx_blit (white);
   gfx_a = -1;
   gfx_mode = 1;):
  (gfx_blit (black););
  gfx_blit (feedback);  

gfx_dest = -1;
gfx_mode = 0;
gfx_a = 1;
gfx_blit (black);
gfx_mode = 0;
gfx_a = output_a;
gfx_blit(output,0);


When you have a camera with an inverting function, and you point it at its own monitor, you get alternating inverted and non-inverted images which I have always found quite a bit more interesting than having them all the same. Can this happen with the video processor?

IDK why I can't get my head around this VP programming, but I can never make it do what I actually want. I don't know what I don't know, and I don't know if this is even possible. All I want is for the output of the blitter feedback preset to be inverted before it goes into whatever buffer is happening such that each successive "repeat" is inverted from the last. I'd like it to also have the zoom and rotate capabilities, just like stock preset does, but with this one added feature.

Help?

Last edited by ashcat_lt; 11-19-2020 at 10:30 PM.
ashcat_lt is offline   Reply With Quote
Old 11-16-2020, 11:25 AM   #2
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default

Is this a no? Nobody knows? Nobody cares? It would be even better if we could do something like the gmem send/receive trick and just put whatever other plugins in the feedback loop, but I’m not sure there’s any way to do that.

Honestly I get all kinds of wonky hit-or-miss results trying to do anything with the video processor. Maybe it’s just that I don’t understand it well enough, but it just all seems weird. Even basic unmodified presets only kind of work sometimes if I get lucky, and I can do the exact same thing twice with totally different results. I cannot figure out how anybody actually uses this for real productions. I know they do, though, and that’s even more frustrating.
ashcat_lt is offline   Reply With Quote
Old 11-17-2020, 09:24 PM   #3
ChocolateWaterhorse
Human being with feelings
 
Join Date: Jun 2020
Posts: 4
Default

i think this could be done by adjusting the script. I've been tinkering but no win.

right there with you aesthetically, as that effect is very much of the bees knees.

Last edited by ChocolateWaterhorse; 11-17-2020 at 10:31 PM.
ChocolateWaterhorse is offline   Reply With Quote
Old 11-18-2020, 09:11 AM   #4
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default

Appreciate the try. I managed to get it to sort of work with different merge modes. It’s not actually what I was asking for to begin with, but still might be cool IF it gave any kind of consistent results. But of course it doesn’t. I get completely different results from the exact same settings for no apparent reason. Sometimes changing one parameter does nothing until I change another parameter even if I then put that second parameter back where it was. Sometimes the whole thing farts out completely. Skipping around the timeline changes the output completely even though I’m testing with static images! Then there’s the weird way that the “repeats“ seem to be cut off in some way...It’s really pretty frustrating and I don’t know why I do these things to myself.

I’d kind of also like to have something more like a typical delay effect, ideally with both time and feedback controls. We have the Show Motion preset and the Matrix of Recent Frames which...I also can’t quite figure out.
ashcat_lt is offline   Reply With Quote
Old 11-19-2020, 12:47 PM   #5
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default

Well there’s still some things that are over my head, but I’m very close to a decent solution. It’s not exactly the same thing as physically pointing a camera at a screen, but it’s actually really good with proper inversion, several merge modes, variable feedback, zoom, rotate, and offset. Just gotta finish up making actual controls that work. I’ll probably get to that late tonight.
ashcat_lt is offline   Reply With Quote
Old 11-19-2020, 10:31 PM   #6
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default

Done, and pretty wild. It does a lot of different crazy crap. Give it a try and let me know what you think.
ashcat_lt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.