XML Feeds

.

[maxmsp] Weird bug involving OSC, ReactiVision and i don't know what

f.e personalcomputermusic at gmail.com
Mon Nov 5 11:00:26 MST 2007


Hello,

Well, it'll be a rather long and obscure mail, but if someone go to the 
end of it, i'd love to know if he/she's got any clue...

I made an external to calculate the distances of a tracked object moving 
inside perimeters. Is it in or out of the n perimeters, and what's the 
distance between each center of each zone it's in, that's what it does, 
basically.

It does it well.

I've used my mouse to simulate the object's moves, untill now. And it 
worked fine.

I've linked ReactiVision's tracking software to it (webcam tracking 
using OSC to send the position data).

http://mtg.upf.edu/reactable/?software

It works well when it's only about display (drawing the position in an 
lcd, for example). But as soon as it tries to trigger my calculation 
function, i do not receive anymore data from ReactiVision through OSC.

As data is still flowing in the Reactivision's console, i assume it's 
the OSC connection in MaxMSP that is instantaneously lost.

How could a simple function like

.........................................................................
void calc_distance(t_sdmain *x, int i)
{

t_atom *data;

distance[i] = (int) 
sqrt(((micro[0]-source[i][0])*(micro[0]-source[i][0])) 
+((micro[1]-source[i][1])*(micro[1]-source[i][1])));
							
d_scaled = 1 - ((distance[i] / xRange) * (yRange + yMin));
	
if (perimeter[i] == 0)
	dp_scaled = 0;	
else
	dp_scaled = 1 - (maxi(0, mini(pow(((distance[i] - xMin) / 	 
(perimeter[i] - 1)), 1) * yRange + yMin, 1)));
	
if ((dp_scaled>0) && (!inside)) inside = 1; // normalement dp_scaled>0
if ((dp_scaled<=0) && (inside)) inside = 0; // normalement dp_scaled<=0
				
data = x->l_data;
	
SETLONG(data, i); // source ID
SETLONG(data+1, inside); // intrusion
if (perimeter[i]>0) SETFLOAT(data+2, dp_scaled); // perim scale
else SETFLOAT(data+2, 0);
SETFLOAT(data+3, d_scaled); // general scale

outlet_list(x->t_listout, 0L, 4, data);
}
......................................................................

kill the OSC connection ?

The OSC and my external are not directly related. I only take data from 
an OSC connection and do some stuff with it in my code.

I add that when i simulate the tracking with my mouse instead of using 
the tracking software, everything works fine...

Any ideas ?

f.e

ps: oh, if you need the maxi / mini .h file to understand better, just 
ask it
-- 
f.e chanfrault | aka | personal computer music
 >>>>>>> http://www.personal-computer-music.com
 >>>>>>> |sublime music for a desperate people|


More information about the maxmsp mailing list