feature request

Aug 23, 2007 at 12:59am

feature request

can jit.gl.graph get @matrixoutput 1 capability, please? many thanks.

j

#33370
Aug 23, 2007 at 1:44am

On Aug 22, 2007, at 5:59 PM, joshua goldberg wrote:

> can jit.gl.graph get @matrixoutput 1 capability, please? many thanks.

In the absence of such a utility, this sort of thing really isn’t
tough to build. Just use the incoming matrix value as the Y axis for
top row of vertices with either a zero Y value (unipolar display) or
a negative Y value (bipolar display) for the bottom row of vertices,
and render with the quad_grid primitive.

Here’s another JS based patch which does it more explicitly with a
sine wave that you might find useful. JS necessary below patcher
file. Have fun.

-Joshua

// js_jittersinesplit-example.pat:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 173 314 33 196617 reset;
#P toggle 173 218 15 0;
#P message 173 241 85 196617 poly_mode $1 $1;
#P toggle 499 310 15 0;
#P flonum 546 373 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 499 394 34 196617 * 40.;
#P newex 499 373 45 196617 / 1000.;
#P newex 499 331 27 196617 gate;
#N counter 1000;
#X flags 0 0;
#P newobj 499 352 70 196617 counter 1000;
#P flonum 499 416 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 424 417 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 499 443 49 196617 phase $1;
#P message 424 444 69 196617 frequency $1;
#P newex 424 475 59 196617 s splitstuff;
#P flonum 466 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 402 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 637 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 600 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 563 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 542 177 83 196617 pak brgb 0. 0. 0.;
#P window linecount 2;
#P comment 84 366 162 196617 fsaa only applicable if supported by
your graphics card;
#P window linecount 1;
#P hidden newex 25 56 105 196617 bgcolor 192 192 192;
#P user jit.fpsgui 332 263 60 196617 0;
#P toggle 79 293 15 0;
#P message 79 314 75 196617 auto_rotate $1;
#P newex 271 261 49 196617 t b erase;
#P toggle 97 218 15 0;
#P message 97 241 70 196617 displaylist $1;
#P number 316 216 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 271 215 15 0;
#P newex 271 236 55 196617 qmetro 20;
#P newex 78 270 115 196617 jit.gl.sketch spline_dest;
#P newex 79 333 115 196617 jit.gl.handle spline_dest;
#P user jit.pwindow 79 399 258 258 0 1 0 0 1 0;
#X name spline_dest;
#P window linecount 2;
#P newex 271 299 122 196617 jit.gl.render spline_dest @erase_color 1.
1. 1. 1.;
#P number 521 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 521 79 50 196617 slices $1;
#P message 466 79 45 196617 scale $1;
#P message 402 79 51 196617 offset $1;
#P newex 402 110 59 196617 s splitstuff;
#P flonum 501 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 464 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 427 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 406 177 82 196617 pak frgb 0. 0. 0.;
#P newex 108 160 59 196617 r splitstuff;
#P toggle 11 346 15 0;
#P message 11 371 43 196617 fsaa $1;
#P button 78 160 15 0;
#P newex 78 197 111 196617 js js_jittersinesplit.js;
#P window linecount 2;
#P comment 21 81 301 196617 demonstration of drawing a split sinewave
frame in jit.gl.sketch , using js to control drawing. requires
MaxMSP 4.5;
#P window linecount 1;
#P newex 406 212 59 196617 s splitstuff;
#P comment 529 316 122 196617 animate sinewave phase;
#P connect 21 0 26 0;
#P fasten 21 0 29 0 276 259 337 259;
#P fasten 21 0 44 1 276 256 521 256;
#P connect 35 0 32 3;
#P connect 34 0 32 2;
#P connect 33 0 32 1;
#P fasten 47 0 46 1 551 391 528 391;
#P connect 16 0 15 0;
#P connect 42 0 40 0;
#P connect 46 0 42 0;
#P connect 45 0 46 0;
#P connect 43 0 45 0;
#P connect 44 0 43 0;
#P connect 48 0 44 0;
#P connect 11 0 8 3;
#P connect 37 0 14 0;
#P connect 10 0 8 2;
#P connect 9 0 8 1;
#P fasten 40 0 38 0 504 468 429 468;
#P fasten 39 0 38 0 429 468 429 468;
#P connect 41 0 39 0;
#P connect 8 0 1 0;
#P fasten 32 0 1 0 547 203 411 203;
#P fasten 13 0 12 0 407 103 407 103;
#P fasten 14 0 12 0 471 103 407 103;
#P fasten 15 0 12 0 526 103 407 103;
#P connect 36 0 13 0;
#P connect 23 0 21 1;
#P connect 26 1 17 0;
#P connect 26 0 17 0;
#P hidden connect 22 0 4 0;
#P connect 22 0 21 0;
#P connect 50 0 49 0;
#P connect 25 0 24 0;
#P fasten 5 0 18 0 16 393 85 393;
#P connect 27 0 19 0;
#P fasten 51 0 19 0 178 331 84 331;
#P connect 28 0 27 0;
#P fasten 19 0 20 0 84 358 57 358 57 254 83 254;
#P connect 24 0 20 0;
#P connect 3 0 20 0;
#P connect 49 0 20 0;
#P connect 4 0 3 0;
#P connect 7 0 3 0;
#P connect 6 0 5 0;
#P window clipboard copycount 52;

// js_jittersinesplit.js:

var autowatch = 1;

var cy = new Array();

var vbrgb = [1.,0.5,0.];
var vfrgb = [0.,0.,1.];
var vslices = 200;
var vscale = 0.2;
var voffset = 0.;
var vphase = 0.;
var vfrequency = 10;

newcurve();

function bang()
{
draw();
}

function newcurve()
{
var i;
var iscale = 2*Math.PI*vfrequency/(vslices-1);
var p = vphase*2*Math.PI;

with (Math) {
for (i=0;i
cy[i] = sin(i*iscale+p);
}
}
}

function draw()
{
var i;
var iscale = 2/(vslices-1);

outlet(0,”reset”);

outlet(0,”glcolor”,vbrgb);
outlet(0,”glbegin”,”tri_strip”);
for (i=0;i
outlet(0,”glvertex”,i*iscale-1,1,0);
outlet(0,”glvertex”,i*iscale-1,cy[i]*vscale+voffset,0);
}
outlet(0,”glend”);

outlet(0,”glcolor”,vfrgb);
outlet(0,”glbegin”,”tri_strip”);
for (i=0;i
outlet(0,”glvertex”,i*iscale-1,cy[i]*vscale+voffset,0);
outlet(0,”glvertex”,i*iscale-1,-1,0);
}
outlet(0,”glend”);
}

function slices(v)
{
vslices = Math.max(v,1);
newcurve();
draw();
}

function phase(v)
{
vphase = v;
newcurve();
draw();
}

function frequency(v)
{
vfrequency = v;
newcurve();
draw();
}

function brgb(r,g,b)
{
vbrgb[0] = r;
vbrgb[1] = g;
vbrgb[2] = b;
draw();
}

function frgb(r,g,b)
{
vfrgb[0] = r;
vfrgb[1] = g;
vfrgb[2] = b;
draw();
}

function scale(v)
{
vscale = v;
draw();
}

function offset(v)
{
voffset = v;
draw();
}

#111147

You must be logged in to reply to this topic.