We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi guys, so I have this bit of coding I'm working with which I'm doing for a research. Test run went ok...ish.
Here is a bit of code I'm using to record a reaction of participants being played a sound. However, when I run it few times, images of users are getting mixed and I had to move them to separate folders one by one, which takes way too much of my time. Here is the question.
Can a new folder be created on mouse release, so when the new mouse press is happening, images are saving to a new folder, so basically each users footage would be saved into a separate folder on my disc. Any ideas? Here is a bit of code I'm using to run the application:
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
import processing.sound.*;
import processing.video.*;
Minim minim;
AudioPlayer one; //variable name
Capture cam;
void setup(){
//println(Capture.list());
size(640,360);
cam = new Capture(this,640,360,30);
minim = new Minim(this);
one =minim.loadFile("german.wav");
}
void draw(){
//background(0);
if (cam.available()) {
cam.read();
if (mousePressed == true);
saveFrame();
}
image(cam,0,0);
}
void mousePressed(){
//if (mousePressed == true);
one.loop();
cam.start();
// saveFrame();
}
void mouseReleased()
{
if (mousePressed || true);
one.close();
one =minim.loadFile("german.wav");
//cam.close()
cam.stop();
}
Answers
for make dir see
https://forum.processing.org/two/discussion/14595/simple-file-operations#latest
you could make a dir name from date + time stamp or user name
question is whether a user can return after a few days and continue (and use his old folder) or if we just make a new folder each time
users are not expected to come back
so, when the user starts (state 1) you or he needs to press a button "Start" then the dir is made and he starts (state 2)
when he finished he clicks a button "Done." and we get to state 1 again.
or so