import oscP5.*; import netP5.*; OscP5 oscP5; NetAddress theMonome; NetAddress toReaktor; int boxSpacing = 8; //space between grid boxes int numRows = 8; //number of rows AND columns int gridSize = 400; int offSetX = 50; int offSetY = 50; //array for the on/off states of the LEDs int[][] mGrid = new int [numRows][numRows]; //set the name of the monome String boxName = "/box"; void setup() { oscP5 = new OscP5(this,8000); theMonome = new NetAddress("127.0.0.1",8080); toReaktor = new NetAddress("127.0.0.1",10000); size(500,500); frameRate(20); stroke(255); clearGrid(); rectMode(CENTER); strokeWeight(4); strokeJoin(BEVEL); background(70); drawGrid(); } void draw(){ } /* incoming osc message are forwarded to the oscEvent method. */ void oscEvent(OscMessage theOscMessage) { int x = theOscMessage.get(0).intValue(); int y = theOscMessage.get(1).intValue(); int on = theOscMessage.get(2).intValue(); drawOneBox(x,y); /* print osc message values */ //println(x + " " + y + " " + on); if (on == 1){ ledToggle(x,y); } sendReaktor(x,y); } void drawGrid(){ //grid assumed to be square so there is no width & height params int grid = gridSize/numRows; int half = grid/2; for (int i=0; i