moving things around, sync..

master
Nova deViator 2015-09-10 21:41:57 +02:00
parent b1324a1e3e
commit 0109fcf48f
6 changed files with 67 additions and 88 deletions

View File

@ -54,6 +54,17 @@ PGraphics sphere;
int tilesOverlap; int tilesOverlap;
// testPicture
boolean testPictureToggle = false;
PFont testFont;
// fps
PFont fpsFont;
// testPattern
boolean testPatternToggle = false;
void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
float sizefactor = 1; // define the size of the screen, 1 = 1080p float sizefactor = 1; // define the size of the screen, 1 = 1080p
@ -73,7 +84,8 @@ void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// start oscP5, listening for incoming messages at port 12000 // start oscP5, listening for incoming messages at port 12000
println("~~~ starting oscP5 ..."); println("~~~ starting oscP5 ...");
oscP5 = new OscP5(this,12000); oscP5 = new OscP5(this,12000);
oscP5.plug(this,"ctlin","/ctlin"); // to be converted for PD OSC input oscP5.plug(this,"ctlin","/ctlin"); // osc from Renoise/Midi (via SC) -> function 'ctlin'
oscP5.plug(this,"scosc","/sc"); // osc from SuperCollider -> function 'scosc'
// get all textures into an image pool // get all textures into an image pool
println("\n\n~~~ loading textures into image pool ...\n"); println("\n\n~~~ loading textures into image pool ...\n");
@ -109,33 +121,18 @@ void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
initializeSphere(ptsW, ptsH); // number of vertices around the width and height initializeSphere(ptsW, ptsH); // number of vertices around the width and height
sphere = createGraphics(width, height, P3D); sphere = createGraphics(width, height, P3D);
} // for testPicture
String[] fontList = PFont.list();
printArray(fontList);
testFont = createFont("Oliver's Barney", 50);
// fps
// process OSC messages fpsFont = createFont("Ubuntu Mono", 12);
public void ctlin(int cc, int val) { // - - - - - - - - - - - - - - - - - - - - - - -
// debug
println("## OSC: /ctlin cc:" + cc + " value:" + val);
if (cc == 2) { tilesOverlap = val; }
/* // triggers are on controller number 0
if (cc == 0) {
}
if (cc == 2) { flySpeedXfactor = (val - 64); } // speed (&direction) on X axis [-1 - 1] FIXit!
if (cc == 3) { flySpeedYfactor = (val - 64); } // speed (&direction) on Y axis [-1 - 1] FIXit!
*/
} }
void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// clean screen ````````````````````````````````````````````````````| // clean screen ````````````````````````````````````````````````````|
@ -184,7 +181,7 @@ void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// test pattern```````````````````````````````````````````````````| // test pattern```````````````````````````````````````````````````|
testPattern(boolean(0), // on/off testPattern(testPatternToggle, // boolean(0), // on/off
2, 0, // img bank & ID 2, 0, // img bank & ID
255, // image alpha 255, // image alpha
10, // number of horizontal 'lanes' 10, // number of horizontal 'lanes'
@ -197,7 +194,7 @@ void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// debug `````````````````````````````````````````````````````````| // debug `````````````````````````````````````````````````````````|
// draw test picture // draw test picture
testPicture(boolean(0)); testPicture(testPictureToggle);
// frames per second // frames per second
displayFps(true); displayFps(true);

View File

@ -202,6 +202,7 @@ void testPicture(boolean render) {
line(0, height/2, width, height/2); line(0, height/2, width, height/2);
fill(0); fill(0);
textFont(testFont);
textSize(50); textSize(50);
textAlign(CENTER,CENTER); textAlign(CENTER,CENTER);
@ -355,7 +356,7 @@ void drawSpheres( boolean render
*/ */
} }
}
// TEST PATTERN - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // TEST PATTERN - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -506,7 +507,10 @@ 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, height-30, 80, 30, 4);
fill(200); text(int(frameRate)+"fps", width-40, height-10, 5);} fill(200);
textFont(fpsFont);
textSize(12);
text(int(frameRate)+"fps", width-40, height-10, 5);}
} }
void autoSnap(boolean render) { // ------------------------------------- void autoSnap(boolean render) { // -------------------------------------

Binary file not shown.

View File

@ -34,60 +34,10 @@ postln("\n\n
Server.default.waitForBoot { Server.default.waitForBoot {
// midi init & stuff:
(
var p5osc;
var midiFunc;
//MIDIIn.connectAll;
p5osc = NetAddr.new("zarquon", 12000);
midiFunc = MIDIFunc.cc({
arg val1, val2;
postln("sending: /ctlin " + val2 + " " + val1);
// we need to send /ctlin CCnum CCvalue
p5osc.sendMsg("/ctlin", val2, val1);
}, (0..127)); // match all cc (from 1..127)
)
midiFunc.free; // cleanup
p5osc.disconnectAll
MIDIIn.findPort;
MIDIClient.init(1,0);
MIDIClient.sources;
MIDIIn.connect("Renoise MIDI Output", "out0");
// where are we? // where are we?
var dir = PathName(thisProcess.nowExecutingPath).pathOnly; var dir = PathName(thisProcess.nowExecutingPath).pathOnly;
// this might go to separate file at some point... ---------------------| // this might go to separate file at some point... ---------------------|
// will load samples for granular synthesis // will load samples for granular synthesis
// var dir = PathName(thisProcess.nowExecutingPath).pathOnly; // // var dir = PathName(thisProcess.nowExecutingPath).pathOnly; //
@ -102,19 +52,25 @@ MIDIIn.connect("Renoise MIDI Output", "out0");
postln(""); postln("");
// ---------------------------------------------------------------------| // ---------------------------------------------------------------------|
// osc connection to zarquon (local?)
~zarquOsc = NetAddr.new("zarquon", 12000);
// what are the files? // what are the files?
~files = List[ ~files = List[
"sdefs.scd", // SynthDef definitions "sdefs.scd", // SynthDef definitions
"snd_lines.scd", // converting Si spectra lines to sound "snd_lines.scd", // converting Si spectra lines to sound
"gui_core.scd", // basic general GUI setup "midiosc.scd", // midi & osc functions
"gui_chaos.scd", // chaos tab "gui_core.scd", // basic general GUI setup
"gui_granul.scd", // "gui_chaos.scd", // chaos tab
"gui_granul.scd", // granulators
"gui_main.scd" "gui_main.scd"
]; ];
// for each file in list, load/execute it // for each file in list, load/execute it
~files.do({|item, i| this.executeFile(dir +/+ item) }); ~files.do({|item, i| this.executeFile(dir +/+ item) });
} }
) )

View File

@ -58,7 +58,7 @@ w.layout.margins = 2;
~pager.layout.margins = 1; ~pager.layout.margins = 1;
// CREATE TABS --------------------------------------------------------------- // CREATE TABS ---------------------------------------------------------------
~tabs = List["chaos", "granul", "players", "processing", "main"]; ~tabs = List["main", "chaos", "granul", "players", "processing"];
~tab_btns = List(); ~tab_btns = List();
~tab_views = List(); ~tab_views = List();
~tab_names = Dictionary.new; ~tab_names = Dictionary.new;

View File

@ -15,7 +15,7 @@
nil, nil,
VLayout( HLayout(
nil, nil,
Button() Button()
@ -40,7 +40,29 @@
}) })
.minHeight_(70).minWidth_(70), .minHeight_(70).minWidth_(70),
Button().minHeight_(70).minWidth_(70)
.states_([ ["Test pattern"], ["Test pattern", Color.gray(0.2), Color.grey(0.8)] ])
.mouseDownAction_({ | state |
switch(state.value,
0, { postln("~~~ test pattern on!");
~zarquOsc.sendMsg("/sc", "testPatternToggle", 1); },
1, { postln("~~~ test pattern off!");
~zarquOsc.sendMsg("/sc", "testPatternToggle", 0); }
);
}),
nil), Button().minHeight_(70).minWidth_(70)
nil); .states_([ ["Test picture"], ["Test picture", Color.gray(0.2), Color.grey(0.8)] ])
.mouseDownAction_({ | state |
switch(state.value,
0, { postln("~~~ test picture on!");
~zarquOsc.sendMsg("/sc", "testPictureToggle", 1); },
1, { postln("~~~ test pattern off!");
~zarquOsc.sendMsg("/sc", "testPictureToggle", 0); }
);
}),
nil
),
nil
);