to use only 1 shred you can send your messages to a base-adress, and pack the
sub-adresses into an argument. not nice, but works.. this way you still can not use adress patterns.
but share 1 shred for many message receivers (with the same signature of course..)
short example:
// the receiver:
OscRecv rec;
6449 => rec.port;
rec.listen();
rec.event("/BaseAdress,si") @=> OscEvent BaseEvent;
while ( true )
{
BaseEvent => now;
while( BaseEvent.nextMsg() != 0 )
{
BaseEvent.getString() => string adress;
BaseEvent.getInt() => int value;
if(adress == "SubAdress1")
{
<<<"reveived on SubAdress1:", value>>>;
}
else if(adress == "SubAdress2/SubSub")
{
<<<"reveived on SubAdress2/SubSub:", value>>>;
}
}
}
// the sender:
while( true )
{
sender.startMsg( "/BaseAdress", "si" );
sender.addString("SubAdress1");
sender.addInt(1);
2::second => now;
sender.startMsg( "/BaseAdress", "si" );
sender.addString("SubAdress2/SubSub");
sender.addInt(2);
2::second => now;
}
I found an old thread on this mailing list which deals with a similar
problem:
https://lists.cs.princeton.edu/pipermail/chuck-users/2005-October/000100.html
Afaics, all those problems can be solved once it is possible to wait for
more than one event. I already saw it on some Todo-list somewhere, so,
hm.... when is the next release comming? ;-)
Cheers,
--lu
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users