From 434fbf9af35f82485e19cc6b85dd71f9e6f736e2 Mon Sep 17 00:00:00 2001 From: Nova deViator Date: Thu, 10 Sep 2015 22:00:52 +0200 Subject: [PATCH] some fixes. added osc.pde midiosc.scd --- pde/IF3Si/IF3Si.pde | 6 +++--- pde/IF3Si/functions.pde | 28 +++++++++++++++------------- pde/IF3Si/osc.pde | 24 ++++++++++++++++++++++++ scd/midiosc.scd | 26 ++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 pde/IF3Si/osc.pde create mode 100644 scd/midiosc.scd diff --git a/pde/IF3Si/IF3Si.pde b/pde/IF3Si/IF3Si.pde index 0ad9225..fa9b4af 100644 --- a/pde/IF3Si/IF3Si.pde +++ b/pde/IF3Si/IF3Si.pde @@ -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); } diff --git a/pde/IF3Si/functions.pde b/pde/IF3Si/functions.pde index 36ff523..794427f 100644 --- a/pde/IF3Si/functions.pde +++ b/pde/IF3Si/functions.pde @@ -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"); + } } } diff --git a/pde/IF3Si/osc.pde b/pde/IF3Si/osc.pde new file mode 100644 index 0000000..500d0d7 --- /dev/null +++ b/pde/IF3Si/osc.pde @@ -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); } + + +} + + diff --git a/scd/midiosc.scd b/scd/midiosc.scd new file mode 100644 index 0000000..ede90b1 --- /dev/null +++ b/scd/midiosc.scd @@ -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);