[chuck-users] questions on osc, events and multi-shredding

tazumi tazumi at gmail.com
Thu Mar 29 11:52:20 EDT 2007


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;
}







2007/3/27, Lukas Degener <degenerl at cs.uni-bonn.de>:
>
> 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 at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>



-- 
tazumi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20070329/a82b63a0/attachment.htm 


More information about the chuck-users mailing list