electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
<on air> Antimon Antimon's Half Year Report
Please visit the chat
 Forum index » DIY Hardware and Software » ChucK programming language
Is there a more efficient way of implementing OSC than...?
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [2 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Fri Feb 22, 2008 4:04 pm    Post subject: Is there a more efficient way of implementing OSC than...? Reply with quote  Mark this post and the followings unread

Setting up a separate shred for each and every variable that is to be received by ChucK?

For example can this code be written more concisely as one shred?

Code:


fun void OSCReceiveCutPosition()

{

   OscRecv MaxMSPReceiveCutPosition;

   6449 => MaxMSPReceiveCutPosition.port;

   MaxMSPReceiveCutPosition.listen();

   MaxMSPReceiveCutPosition.event("/CutPosition, f") @=> OscEvent MaxMSPCutPosition;

   

   while(true)

   {

      MaxMSPCutPosition => now;

          while ( MaxMSPCutPosition.nextMsg() != 0 )

          {

         MaxMSPCutPosition.getFloat() => OSCCutPosition;

         OSCCutPositionUpdated.signal();

         //<<<"Current Max/MSP value", OSCCutPosition>>>;      

      }

   }

}



fun void OSCReceiveCutLength()

{

   OscRecv MaxMSPReceiveCutLength;

   6449 => MaxMSPReceiveCutLength.port;

   MaxMSPReceiveCutLength.listen();

   MaxMSPReceiveCutLength.event("/CutLength, f") @=> OscEvent MaxMSPCutLength;

   

   while(true)

   {

      MaxMSPCutLength => now;

          while ( MaxMSPCutLength.nextMsg() != 0 )

          {

         MaxMSPCutLength.getFloat() => OSCCutLength;

         //OSCCutPositionUpdated.signal();

         //<<<"Current Max/MSP value", OSCCutPosition>>>;      

      }

   }

}



fun void OSCReceiveNumberOfStutters()

{

   OscRecv MaxMSPReceiveNumberOfStutters;

   6449 => MaxMSPReceiveNumberOfStutters.port;

   MaxMSPReceiveNumberOfStutters.listen();

   MaxMSPReceiveNumberOfStutters.event("/NumberOfStutters, f") @=> OscEvent MaxMSPNumberOfStutters;

   

   while(true)

   {

      MaxMSPNumberOfStutters => now;

          while ( MaxMSPNumberOfStutters.nextMsg() != 0 )

          {

         MaxMSPNumberOfStutters.getFloat() => OSCNumberOfStutters;      

      }

   }

}



fun void OSCReceiveBufferFile()

{

   OscRecv MaxMSPReceiveBufferFile;

   6449 => MaxMSPReceiveBufferFile.port;

   MaxMSPReceiveBufferFile.listen();

   MaxMSPReceiveBufferFile.event("/BufferFile, s") @=> OscEvent MaxMSPBufferFile;

   

   while(true)

   {

      MaxMSPBufferFile => now;

          while ( MaxMSPBufferFile.nextMsg() != 0 )

          {

         MaxMSPBufferFile.getString() => OSCBuffer;   

      }

   }

}



Thanks,

Rhys

P.S. Most of the variables mentioned above are part of a bigger programme, and as such this code wont work by itself. I just thought I'd copy n paste the OSC part as an example.
Back to top
View user's profile Send private message
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Sat Feb 23, 2008 1:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

If I were to wait for each message to arrive what order would they arrive in, if they are all sent at once?

In other words, how do I sync what is going on in ChucK to OSC.

I have the data sent to ChucK via OSC and then run ChucK once the data has been updated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [2 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use