Updated for 2019 because well it's a new year, it's a new dawn, it's a new day and i'm feeling like Resolume changed the OSC addresses...
download 2018/19 version from
https://drive.google.com/file/d/1PGZZJb ... sp=sharing
Nerds will see how rubbish my code is below....
Hopefully this helps someone somewhere, if you are trying to learn processing then it might be some use, as an exercise try adding a line of code which will trigger layer 2 clip 1 when it is new year - then you can have it play a cheesy fireworks clip at the same time as displaying the Happy New Year text
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);
}
The eagle eyed among you will see there is a small bug with displaying the days countdown during the hour of 11pm, but whatever you can fix it if you like, or don't bother. Who the hell wants a countdown timer on screen before its the 31st anyway?