Implementing an Abstract_GESTUIO Class

Working on my Gestus project. Today we have managed to implement a new class, called Abstract_GESTUIO class, as well as to solve the problem found on the GESTUIO_Object class and GESTUIO_Blob class we had before.

Introduction: All blobs or objects are sent as OSC messages from either ReacTIVision or Community Core Vision, using the TUIO Protocol. SuperCollider receives these messages through an OSCresponder. We collect the data passed by the OSC message to the OSCresponder function into an array called data in the functions argument definition, as follows: | ... data |.

Problem: When collecting arguments into an array using the “…” (three dots) syntax the array passed to the function is an immutable object. This means that we cannot change this data object subsequently. But our code needed to modify our data received. We solve the problem by modifying the code so as not to use the | … | syntax.

In practice, this caused some of the synth sounds that were played (each time we had one of the following events objectBorn = a new object is born, objectDied = a object has died and objectMoved = a object has moved ) to never stop.

Here is the correct code:

makeResponder {

OSCresponder(nil, ‘/tuio/2Dobj’, { | time, resp, msg |
this.respondToOSC(msg[1], msg[2..])
});       
}

and,

}
respondToOSC { | messageType, data |
this.perform(messageType.asSymbol, data);

}

Finally, we have worked in more depth organising our Class in order to avoid code complexity and disorientation in the future. We have created an Abstract class called Abstract_GESTUIO and two concrete classes GESTUIO_2Dobj and GESTUIO_2Dcur subclasses of the abstract class.

Abstract_GESTUIO:

  • GESTUIO_2Dobj
  • GESTUIO_2Dcur

Next step: managing to have both instances of the GESTUIO_2Dobj and GESTUIO_2Dcur run at the same time. Therefore we can have both fiducial and blob detection simultaneously. For achieving this we need to implement the class method *default, which at the moment is defined as shown below:

*default {
if (default.isNil) { default = this.new };
^default;   
}

Cygnus Thu, 11 March 2010, 18:07PM