Load sketches based on presentation time
in
Programming Questions
•
1 year ago
This is repeated question from old forum..
How could be achieve presentation of multiples sketches, one by one ?
Basically n totaly independent compositions, each displaying different things, each one using different libraries and different rendering engines.
Is processing able to load sketches dynamically based on some rule? What I need is for the compositions to change every n minutes and/or when speciffic data trigger some actions (OSC messages). Of course, I could merge all the code in one file, but then it will become messy. I'd simply like to keep every sketch independent, so they would be more easily to manage etc etc.
The pseudoscript could be:
// a "mastersketch" to load and display other sketches
// global - define paths to sketches, maybe set up some rules for each
void setup()
{
// setup
}
void draw()
{
// Loading and drawing other sketches, based on some rules
// based on time, a fast implementation ;) loads 3 sketches, each one shown for 20 seconds
if (second() >= 0 && second() < 20) {
loadsketch[1];
}
else if (second() >= 20 && second() < 40) {
loadsketch[2];
}
else {
loadsketch[3];
}
}
How could be achieve presentation of multiples sketches, one by one ?
Basically n totaly independent compositions, each displaying different things, each one using different libraries and different rendering engines.
Is processing able to load sketches dynamically based on some rule? What I need is for the compositions to change every n minutes and/or when speciffic data trigger some actions (OSC messages). Of course, I could merge all the code in one file, but then it will become messy. I'd simply like to keep every sketch independent, so they would be more easily to manage etc etc.
The pseudoscript could be:
// a "mastersketch" to load and display other sketches
// global - define paths to sketches, maybe set up some rules for each
void setup()
{
// setup
}
void draw()
{
// Loading and drawing other sketches, based on some rules
// based on time, a fast implementation ;) loads 3 sketches, each one shown for 20 seconds
if (second() >= 0 && second() < 20) {
loadsketch[1];
}
else if (second() >= 20 && second() < 40) {
loadsketch[2];
}
else {
loadsketch[3];
}
}
1