[chuck-users] retrieving shred id when calling chuck from command line

Szabolcs Horvát szhorvat at gmail.com
Sun Mar 10 19:06:32 EDT 2013


Hello,

I am a chuck novice, so please be gentle :-)  (actually just started
learning today)

I would like to call chuck from another program and add/remove shreds,
as well as control some parameters.  Adding shreds is easy, just chuck
+ shed.ck, but to remove them I need the shred id.  So the first
question is, how can I retrieve the shred id when adding new shreds?

I know that the listener process prints the shred id, but to parse the
output of the listener, weed out errors, and catch the shred id only
is very messy.  Is there a better way?  How does miniAudicle do this
(since it has to do practically the same thing)?


The other question is about how to control all shreds with global
parameters.  I found a way, but since I'm new to ChucK, I'm looking
for some reassurance that this is the correct and the simplest way.

I created a class like this:

public class MyState {
    static int freq;
}

500 => MyState.freq;

Then I read/set the parameter MyState.freq from various shreds.

Is this the correct way?

Thank you for any help in advance,
Szabolcs


More information about the chuck-users mailing list