some fixes. added osc.pde midiosc.scd
							parent
							
								
									0109fcf48f
								
							
						
					
					
						commit
						434fbf9af3
					
				| 
						 | 
					@ -122,12 +122,12 @@ void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
				
			||||||
  sphere = createGraphics(width, height, P3D);
 | 
					  sphere = createGraphics(width, height, P3D);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // for testPicture
 | 
					  // for testPicture
 | 
				
			||||||
  String[] fontList = PFont.list();
 | 
					  //String[] fontList = PFont.list();
 | 
				
			||||||
  printArray(fontList);
 | 
					  //printArray(fontList);
 | 
				
			||||||
  testFont = createFont("Oliver's Barney", 50);
 | 
					  testFont = createFont("Oliver's Barney", 50);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // fps
 | 
					  // fps
 | 
				
			||||||
  fpsFont = createFont("Ubuntu Mono", 12);
 | 
					  fpsFont = createFont("Ubuntu Mono", 16);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -506,14 +506,15 @@ void screenClean(color c) { // -----------------------------------------
 | 
				
			||||||
void displayFps(boolean render) { // -----------------------------------
 | 
					void displayFps(boolean render) { // -----------------------------------
 | 
				
			||||||
  if (render){
 | 
					  if (render){
 | 
				
			||||||
    // Display Fps
 | 
					    // Display Fps
 | 
				
			||||||
    fill(0); noStroke(); rect(width-80, height-30, 80, 30, 4);
 | 
					    //fill(0); noStroke(); rect(width-80, 10, 80, 30, 4);
 | 
				
			||||||
    fill(200);
 | 
					    fill(255);
 | 
				
			||||||
    textFont(fpsFont);
 | 
					    textFont(fpsFont);
 | 
				
			||||||
    textSize(12);
 | 
					    textSize(16);
 | 
				
			||||||
    text(int(frameRate)+"fps", width-40, height-10, 5);}
 | 
					    text(int(frameRate)+"fps", width-60, 20, 5);}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void autoSnap(boolean render) { // -------------------------------------
 | 
					void autoSnap(boolean render) { // -------------------------------------
 | 
				
			||||||
 | 
					  if (render) {
 | 
				
			||||||
    // auto-save snapshots
 | 
					    // auto-save snapshots
 | 
				
			||||||
    if (frameCount == 1000) {
 | 
					    if (frameCount == 1000) {
 | 
				
			||||||
      saveFrame("../snapshots/"
 | 
					      saveFrame("../snapshots/"
 | 
				
			||||||
| 
						 | 
					@ -525,3 +526,4 @@ void autoSnap(boolean render) { // -------------------------------------
 | 
				
			||||||
                + "_.png");
 | 
					                + "_.png");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,24 @@
 | 
				
			||||||
 | 
					public void ctlin(int cc, int val) { // - - - - - - - - - - - - - - - - - - - - - - - 
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  // debug
 | 
				
			||||||
 | 
					  println("### OSC: /ctlin cc:" + cc + " value:" + val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (cc == 2) { tilesOverlap = val;  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // if (cc == 2) { flySpeedXfactor = (val - 64); } // FIXit!
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public void scosc(String mount, int val) { // - - - - - - - - - - - - - - - - - - - - - - - 
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  // debug
 | 
				
			||||||
 | 
					  println("### OSC: /sc /mount: " + mount + " value: " + val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (mount.equals("testPatternToggle")) { testPatternToggle = boolean(val); }
 | 
				
			||||||
 | 
					  if (mount.equals("testPictureToggle")) { testPictureToggle = boolean(val); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,26 @@
 | 
				
			||||||
 | 
					//~p5osc = NetAddr.new("zarquon", 12000);
 | 
				
			||||||
 | 
					// midi init
 | 
				
			||||||
 | 
					//MIDIIn.connectAll;
 | 
				
			||||||
 | 
					//MIDIClient.init(1,1);
 | 
				
			||||||
 | 
					//MIDIClient.sources;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// try to connect midi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var midiFunc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIDIIn.connect("Renoise MIDI Output", "SuperCollider: in0");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					midiFunc = MIDIFunc.cc({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						arg val1, val2;
 | 
				
			||||||
 | 
						postln(">>> sending: /ctlin " + val2 + " " + val1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// we need to send /ctlin CCnum CCvalue
 | 
				
			||||||
 | 
						~zarquOsc.sendMsg("/ctlin", val2, val1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}, (0..127)); // match all cc (from 1..127)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// testing testing
 | 
				
			||||||
 | 
					~zarquOsc.sendMsg("/sc", "testingmount", 10);
 | 
				
			||||||
		Loading…
	
		Reference in New Issue