Feedback examples

Hi there -

I’m interested in experimenting a bit with feedback in Processing. Is Processing good for video feedback?
I haven’t seen any examples and it’s been tough to figure out how to approach it. I’m curious if I’m missing a resource that people here might know about.

Thanks!

1 Like

Can you explain a little bit more, what you are trying to achieve?

There is a Video Library, and you can of course try pointing the recording camera at your screen to generate feedback.

If you like to record your own sketch and generate feedback from that, you could get the pixels and place them as new image on top. Experiment with the scaling, position and BlendMode to create more interesting effect. Here is an example for this:

// From https://processing.org/reference/libraries/video/Capture.html
import processing.video.*;

Capture cam;

void setup() {
  size(480, 480);

  String[] cameras = Capture.list();
  
  if (cameras.length == 0) {
    println("There are no cameras available for capture.");
    exit();
  } else {
    println("Available cameras:");
    for (int i = 0; i < cameras.length; i++) {
      println(cameras[i]);
    }
    
    // The camera can be initialized directly using an 
    // element from the array returned by list():
    cam = new Capture(this, cameras[0]);
    cam.start();     
  }   
}

void draw() {

  // Get the current display of the sketch
  PImage c = get();

  // Capture camera frame
  if (cam.available() == true) {
    cam.read();
  }

  // Display the camera frame
  image(cam, 0, 0);

  // Display a smaller previous frame
  image(c, 20, 20, width - 40, height - 40);
}

2

1 Like

Hi Phillip-

Thank you for the example…I think I’m looking for a similar effect, except without having to use an external camera. Is there a way to do that?

Hello,

https://en.wikipedia.org/wiki/Feedback

Feedback occurs when outputs of a system are routed back as inputs as part of a chain of cause-and-effect that forms a circuit or loop.

This is a p5.js example:

You can use it with the p5.js editor:
https://editor.p5js.org/

image

This can be done in Processing as well.

:)

As others already mentioned, get would be the easiest way both in Processing and in p5.js.

If you want to dig deeper, shader ping-pong is the way to go - Raph made some nice examples in the past (not sure if it’s P4 compatible)