Minim & Video Question
in
Core Library Questions
•
1 year ago
Dear All,
Right now im working on a project, where i want to use an audiosignal to trigger a video and i have to admit, that even though i am somewhat new to processing i find myself building a cathedral. So: HELP! PLEASE!
A repeating Audiosignal triggers several functions:
a) It should save a frame (A) of an attached camera.
b) Everytime a new frame (B) is saved the old one should be drawn. ("Visible on the screen")
Whenever Frame A is drawn, Frame B becomes Frame A and a new Frame B is saved.
c) In between those two frames should be a blackscreen. ("Which should also be triggered by a second audiosignal {best case scenario} or by time")
Sketch:
FrameA > FrameB > Blackscreen > FrameA > Blackscreen > FrameB > Blackscreen > FrameA > Blackscreen > …
I managed to get the Blackscreen working, but still a big Questionmark remains floating above my head, when it comes to Frame A+B.
I hope someone can spare the time to look into my mess :)
Kind regards,
###
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import processing.video.*;
Capture myCapture;
int numPixels;
Minim minim;
AudioInput in;
void setup ()
{
size (400, 400);
// println(Capture.list()); //Ruft eine Liste mit allen Videodevices auf (@Konsole)
minim = new Minim(this);
minim.debugOn();
in = minim.getLineIn(Minim.STEREO, 512);
myCapture = new Capture (this, 400, 400, "USB Video Class Video");
//regelt die fps; variable="cam"; syntax="cam.frameRate();
//myCapture.frameRate(30);
numPixels = myCapture.width * myCapture.height;
loadPixels(); }
void captureEvent(Capture myCapture) {
myCapture.read(); }
void draw () {
image(myCapture, 0, 0);
if (myCapture.available()) {
myCapture.read();
myCapture.loadPixels();
for (int i = 0; i < numPixels; i++); }
for(int i = 0; i < in.bufferSize() - 1; i++)
{ fill(0);
rect(0, in.left.get(0), 400, in.left.get(i+1)*400); }
}
void stop()
{ in.close();
minim.stop();
super.stop();
} //schließt minim klasse.!!!!!!!!! (--> immer schließen)
###
Right now im working on a project, where i want to use an audiosignal to trigger a video and i have to admit, that even though i am somewhat new to processing i find myself building a cathedral. So: HELP! PLEASE!
A repeating Audiosignal triggers several functions:
a) It should save a frame (A) of an attached camera.
b) Everytime a new frame (B) is saved the old one should be drawn. ("Visible on the screen")
Whenever Frame A is drawn, Frame B becomes Frame A and a new Frame B is saved.
c) In between those two frames should be a blackscreen. ("Which should also be triggered by a second audiosignal {best case scenario} or by time")
Sketch:
FrameA > FrameB > Blackscreen > FrameA > Blackscreen > FrameB > Blackscreen > FrameA > Blackscreen > …
I managed to get the Blackscreen working, but still a big Questionmark remains floating above my head, when it comes to Frame A+B.
I hope someone can spare the time to look into my mess :)
Kind regards,
###
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import processing.video.*;
Capture myCapture;
int numPixels;
Minim minim;
AudioInput in;
void setup ()
{
size (400, 400);
// println(Capture.list()); //Ruft eine Liste mit allen Videodevices auf (@Konsole)
minim = new Minim(this);
minim.debugOn();
in = minim.getLineIn(Minim.STEREO, 512);
myCapture = new Capture (this, 400, 400, "USB Video Class Video");
//regelt die fps; variable="cam"; syntax="cam.frameRate();
//myCapture.frameRate(30);
numPixels = myCapture.width * myCapture.height;
loadPixels(); }
void captureEvent(Capture myCapture) {
myCapture.read(); }
void draw () {
image(myCapture, 0, 0);
if (myCapture.available()) {
myCapture.read();
myCapture.loadPixels();
for (int i = 0; i < numPixels; i++); }
for(int i = 0; i < in.bufferSize() - 1; i++)
{ fill(0);
rect(0, in.left.get(0), 400, in.left.get(i+1)*400); }
}
void stop()
{ in.close();
minim.stop();
super.stop();
} //schließt minim klasse.!!!!!!!!! (--> immer schließen)
###
1