some fixes. added osc.pde midiosc.scd

master
Nova deViator 2015-09-10 22:00:52 +02:00
parent 0109fcf48f
commit 434fbf9af3
4 changed files with 68 additions and 16 deletions

View File

@ -122,12 +122,12 @@ void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sphere = createGraphics(width, height, P3D);
// for testPicture
String[] fontList = PFont.list();
printArray(fontList);
//String[] fontList = PFont.list();
//printArray(fontList);
testFont = createFont("Oliver's Barney", 50);
// fps
fpsFont = createFont("Ubuntu Mono", 12);
fpsFont = createFont("Ubuntu Mono", 16);
}

View File

@ -506,22 +506,24 @@ void screenClean(color c) { // -----------------------------------------
void displayFps(boolean render) { // -----------------------------------
if (render){
// Display Fps
fill(0); noStroke(); rect(width-80, height-30, 80, 30, 4);
fill(200);
//fill(0); noStroke(); rect(width-80, 10, 80, 30, 4);
fill(255);
textFont(fpsFont);
textSize(12);
text(int(frameRate)+"fps", width-40, height-10, 5);}
textSize(16);
text(int(frameRate)+"fps", width-60, 20, 5);}
}
void autoSnap(boolean render) { // -------------------------------------
// auto-save snapshots
if (frameCount == 1000) {
saveFrame("../snapshots/"
+ year() + nf(month(),2)
+ nf(day(),2)
+ nf(hour(),2)
+ nf(minute(),2)
+ nf(second(),2)
+ "_.png");
if (render) {
// auto-save snapshots
if (frameCount == 1000) {
saveFrame("../snapshots/"
+ year() + nf(month(),2)
+ nf(day(),2)
+ nf(hour(),2)
+ nf(minute(),2)
+ nf(second(),2)
+ "_.png");
}
}
}

24
pde/IF3Si/osc.pde Normal file
View File

@ -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); }
}

26
scd/midiosc.scd Normal file
View File

@ -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);