I made this to try out sending strings to the text sources.
it works, maybe it is useful for someone to learn from or even use on their new year gigs?
https://www.dropbox.com/s/c61rrceid9vr1 ... n.zip?dl=1
Code: Select all
/*
This sketch sends a countdown to Resolume 6 via OSC.
You need a text souce on layer 1 clip 1.
you need the processing libraries oscP5 and netP5 to be correctly installed.
You might wish to moddify the sketch for your own needs.
Happy New Year - Tom Bassford - tom@tombassford.org :)
*/
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
String s1;
void setup() {
size(400, 400);
frameRate(25);
oscP5 = new OscP5(this, 8000);
myRemoteLocation = new NetAddress("127.0.0.1", 7000);
PFont font = createFont("arial", 20);
textFont(font);
}
void draw() {
background(0);
fill(200);
textSize(18);
text("For Resolume 6", 5, 20);
text("Put text generator source on layer 1 clip 1", 5, 50);
text("Turn on OSC listen on port 7000", 5, 80);
if (year()==2018) {
s1 = "HAPPY NEW YEAR"; // show happy new year
sendOSCf("/composition/layers/1/clips/1/video/source/params/size", 0.1); //sets text size so messgae fits onscreen
} else if (hour()==23 && minute()==59) {
s1 = nf(59-second(), 2); // show just seconds
sendOSCf("/composition/layers/1/clips/1/video/source/params/size", 0.4);//sets text size so numbers are nice and big
} else if (hour()==23) {
s1 = nf(59-minute(), 2)+":"+nf(59-second(), 2); // show mins and seconds
sendOSCf("/composition/layers/1/clips/1/video/source/params/size", 0.4); // sets text size
} else {
s1 = nf(23-hour(), 2)+":" +nf(59-minute(), 2)+":"+nf(59-second(), 2); // show hours mins and seconds
sendOSCf("/composition/layers/1/clips/1/video/source/params/size", 0.25); // sets text size
}
sendOSCs("/composition/layers/1/clips/1/video/source/params/text", s1); // updates text to show time or message
sendOSCs("/composition/layers/1/clips/1/name", "NYE t- "+s1); // sets clip name in the grid
println(s1);
println(year());
}
void sendOSCs(String OSCAdr, String OSCStr) {
OscMessage myMessage = new OscMessage(OSCAdr);
myMessage.add(OSCStr); /* add a string to the osc message */
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
void sendOSCi(String OSCAdr, int OSCi) {
OscMessage myMessage = new OscMessage(OSCAdr);
myMessage.add(OSCi); /* add a int to the osc message */
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
void sendOSCf(String OSCAdr, float OSCf) {
OscMessage myMessage = new OscMessage(OSCAdr);
myMessage.add(OSCf); /* add a float to the osc message */
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
Code: Select all
/*
Updated for 2019 :)
This sketch sends a countdown to Resolume 6 via OSC.
You need a text block souce on layer 1 clip 1.
you need the processing libraries oscP5 and netP5 to be correctly installed.
You might wish to moddify the sketch for your own needs.
Happy New Year - Tom Bassford - tom@tombassford.org :)
*/
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
String s1;
void setup() {
size(400, 400);
frameRate(25);
oscP5 = new OscP5(this, 8000);
myRemoteLocation = new NetAddress("127.0.0.1", 7000);
PFont font = createFont("arial", 20);
textFont(font);
}
void draw() {
background(0);
fill(200);
textSize(18);
text("For Resolume 6", 5, 20);
text("Put 'Text Block' generator source on layer 1 clip 1", 5, 50);
text("Turn on OSC listen on port 7000", 5, 80);
if (year()==2019) {
s1 = "HAPPY\nNEW\nYEAR!!"; // show happy new year
sendOSCf("/composition/layers/1/clips/1/video/source/blocktextgenerator/scale", 0.1); //sets text size so messgae fits onscreen
} else if (hour()==23 && minute()==59) {
s1 = nf(59-second(), 2); // show just seconds
sendOSCf("/composition/layers/1/clips/1/video/source/blocktextgenerator/scale", 0.4);//sets text size so numbers are nice and big
} else if (hour()==23) {
s1 = nf(59-minute(), 2)+":"+nf(59-second(), 2); // show mins and seconds
sendOSCf("/composition/layers/1/clips/1/video/source/blocktextgenerator/scale", 0.4); // sets text size
} else if (31-day()>0){
s1 = nf(31-day(), 2)+" Days \n"+nf(23-hour(), 2)+":" +nf(59-minute(), 2)+":"+nf(59-second(), 2); // show hours mins and seconds
sendOSCf("/composition/layers/1/clips/1/video/source/blocktextgenerator/scale", 0.25); // sets text size
} else {
s1 = nf(23-hour(), 2)+":" +nf(59-minute(), 2)+":"+nf(59-second(), 2); // show hours mins and seconds
sendOSCf("/composition/layers/1/clips/1/video/source/blocktextgenerator/scale", 0.25); // sets text size
}
sendOSCs("/composition/layers/1/clips/1/video/source/blocktextgenerator/text", s1); // updates text to show time or message
sendOSCs("/composition/layers/1/clips/1/name", "NYE t- "+s1); // sets clip name in the grid
println(s1);
println(year());
}
void sendOSCs(String OSCAdr, String OSCStr) {
OscMessage myMessage = new OscMessage(OSCAdr);
myMessage.add(OSCStr); /* add a string to the osc message */
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
void sendOSCi(String OSCAdr, int OSCi) {
OscMessage myMessage = new OscMessage(OSCAdr);
myMessage.add(OSCi); /* add a int to the osc message */
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
void sendOSCf(String OSCAdr, float OSCf) {
OscMessage myMessage = new OscMessage(OSCAdr);
myMessage.add(OSCf); /* add a float to the osc message */
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
There are some NYE countdown timers on juicebar and gumroad