We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Dear, I am trying to built an audio-recording program which is activated from a remote location. If this is the command line to start the program from keyboard how can I change it using OscEvent?
void keyReleased()
{
if ( key == 'r' )
{
newFile();
recorder.beginRecord();
//timer
pressed=true;
}
if (key == 'f'){
//end record
recorder.endRecord();
//save
name++; //change the file name, everytime +1
recorder.save();
println("Done saving.");
println(name);//check the name
}
}
Answers
I have tried a solution but but it ends up giving me an error and I can't seem to figure out why...
here is the code:
"it ends up giving me an error and I can't seem to figure out why..."
Neither us, since we cannot see the error message...
Side note:
String dataIn3=""+ theOscMessage1.arguments()[2];
in Processing, this can be written:
String dataIn3 = str(theOscMessage1.arguments()[2]);
I am sorry for not being enough clear. It is one of my first experience with processing. I am trying to have an audio recording program controlled by the OscEvent. In this way any turn of a parallel experiment can have its own registration.
Now I have solved the problem that I had with the messaging format
int turn = theOscMessage1.get(0).intValue();
But I don't have a clear how to let the program reevaluate the newFile() and startAgain() any time the message "turn" is received. I tried to change the code in the following way, is it very stupid my error?
to be more clear. Each time a task is completed the "master" start this function
hi, I cannot resolve your problem but inside your code from the 6 nov. I can see some errors : line 63 & line 67 : you create two time the turn local variable : instead create one global variable (upper void setup() ) - like this you could test it inside void draw() for example.
then still in the same code, your personnal function void newFile() & void startAgain() will only start one time because you invoke them only at void setup().
if you'd like to start some function depending the value of turn, you have to compare it inside void draw() (which is read in loop while the sketch is on).
here an example : two functions are started depending the variable turn, which can be change with OSC message.
nb : here the two functions will be read in loop while turn is equal to 1 or 2...
thanks, I was able to change the code with your hints.
Now it's working.
I post the code here: