[chuck-users] Question about Gain and instantiating objects

Mike McGonagle mjmogo at gmail.com
Fri Jan 13 14:33:25 EST 2006

Hello All,

I have created an object that basically is a simple sine wave grain to
be used to create a "cloud" of sound. What I would like to do is to
instatiate MANY of these objects, each of which would "exist" for
maybe 10 milliseconds, or thereabouts. I was hoping to do this, as I
am not really sure exactly how many instances will be needed at a
given time.

So, I got the object created (in the file 'sinegrain.ck'), and I call
its function, sporking it into its own thread. When I create a single
object, everything seems to work fine, but when I do more than one,
everything goes haywire. I have attached an archive with all the files
I use, and you can run them with the following...

> chuck sinegrain sgtest1 rec-auto
> chuck sinegrain sgtest2 rec-auto
> chuck sinegrain sgtest3 rec-auto
> chuck sinegrain sgtest4 rec-auto

Each of the test files (sgtest...) creates the number of objects that
is indicated by the number in the file name. When you run this, you
will need to hit control-c to stop everything. The object will produce
a print out with the gain of each generator, and once it is finished,
it will print "done". You can hit control-c after that...

I did this in Pure Data, but I had to create it in such a way that
there were already all the generators instantiated, so if there ever
occured a moment where one more generator was needed that created, it
would "steal" a generator. This occasionally produced some clicks in
the resulting sound.

Will I need to create an "array" of my objects, creating all the
instances that I may need? Or should I be able to create an object,
call its function, and call its function by sporking it, and then
instatiate a new object using the same object reference?

I hope this makes sense, I didn't get much sleep last night, and my
brain hurts...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sinegrain.zip
Type: application/zip
Size: 2567 bytes
Desc: not available
Url : http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20060113/0dc49468/sinegrain.zip

More information about the chuck-users mailing list