[chuck-users] stupid n00bie question: Part II

AlgoMantra algomantra at gmail.com
Wed Oct 17 09:55:38 EDT 2007


The easiest way to go about this is to make sure both shreds come from  the
same .ck file. If they do they share the name space of that file so any
event or variable defined in there should be open to both. The exception is
things defined inside of functions (and in this case all but one of those
shreds will be sporked functions). Something defined inside of a function
will only be accessible to that function.

Well, I am basically putting the lines of code that track the frequency in
the same .ck file
where other lines of code send OSC messages to Python. I am still finding it
hard to
understand what you mean by multiple "shred"(s) in the same .ck file. ???

When I throw a .ck file into the VM, it starts a shred. Are you saying that
throwing
one ck file into the VM can start many shreds?


-------    -.-
1/f   )))  --.
-------    ...
http://www.algomantra.com



On 10/10/07, Kassen <signal.automatique at gmail.com> wrote:
>
>
>
> On 10/10/07, AlgoMantra <algomantra at gmail.com> wrote:
> >
> > Okay, I beg your pardon in advance again......
>
>
>
> Why? That's what the list is for!
> :¬)
>
>
> 1. Are the MAUI modules available only for miniAudicle, and not Audicle?
> > That
> > would mean that one can only do this on Mac. I'm a dodo using XP.
>
>
> Yeah, at least so far.
>
>
> 2. Can two ChucK shreds throw data at each other in the same VM, like two
> > Python sockets?
> > So I could read Microphone data in RMS off one shred and throw it
> > towards a Python
> > GUI using another shred which is using OSC? Can two shreds talk?
>
>
>
> Yes, you can. The easiest way to go about this is to make sure both shredscome from  the same .ck file. If they do they share the name space of that
> file so any event or variable defined in there should be open to both. The
> exception is things defined inside of functions (and in this case all but
> one of those shreds will be sporked functions). Something defined inside
> of a function will only be accessible to that function.
>
> If the above is all you need I'd keep it in a single file and use a event,
> the first shred would analyze the sound and broadcast the event whenever
> something interesting happens, the second would wait for the event and send
> the OSC. The sections in the manual and the /examples/ dir on events contain
> everything you'll need.
>
> It gets slightly harder if the two shreds come from different files, if
> that is the case the trick is to make a public class containing a static
> event and have both shreds use a instance of that. This is a bit of a
> work-around but it does work. The one thing to mind is that non-primitive
> static objects in public classes have a issue with instantiation, to get
> around this you need to define the class, then define a event outside of it
> and asign this to it. Fortunately you only need to do that once and it'll be
> fine, there has been quite a bit of discussion about this on the list that
> you might want to look up (mainly on static arrays). If that's the route you
> take and you run into trouble get back to it and I or somebody else will
> talk you through it.
>
>
> Hope that helps,
> Kas.
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20071017/1afc03f6/attachment.htm 


More information about the chuck-users mailing list