Skip to content

Instantly share code, notes, and snippets.

@echophon
Created November 21, 2017 04:52
Show Gist options
  • Save echophon/7e9925f565ab35a43cbec1fbf7b290aa to your computer and use it in GitHub Desktop.
Save echophon/7e9925f565ab35a43cbec1fbf7b290aa to your computer and use it in GitHub Desktop.
import oscP5.*;
OscP5 oscP5;
int bass2, bd, sn = 0;
void setup() {
size(400,400);
oscP5 = new OscP5(this,4000);
oscP5.plug(this,"tidal","/tidal"); //register method to listen to the message
}
public void tidal(int _bass2, int _bd, int _sn) {
bass2 = _bass2;
bd = _bd;
sn = _sn;
}
void draw() {
fill(0,10);
rect(0,0,width,height);
fill(255,0,0);
textSize(50);
if (bd == 1) {text("bd", random(0,width-50), random(50,height-50)); }
if (sn == 1) {text("sn", random(0,width-50), random(50,height-50));}
if (bass2 == 1) { text("bass2", random(0,width-100), random(50,height-50));}
// reset to off after done drawing
bass2 = 0;
bd = 0;
sn = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment