[chuck-users] sndbuf cleanups?

Ge Wang gewang at CS.Princeton.EDU
Sat Jun 23 07:33:55 EDT 2007


Hi James,

Extending on Kassen's comments.  Yes, this is due to the lack of  
fully functional garbage collection in ChucK - the new SndBuf's  
aren't being deallocated.  The workaround as Kassen noted is to reuse  
SndBuf's and other UGen's when possible.

Garbage is a major development target this summer.  Again, stay tuned  
and thanks for the excellent input.

Best,
Ge!

On Jun 18, 2007, at 6:13 AM, Kassen wrote:

> James Hughes <jamezilla at gmail.com> wrote:
>
>
>> I've got a chuck app that runs great for about thirty minutes and  
>> then
>> starts acting flaky.
>
> <snip>
>
> Here's the relevant bit of code that takes the
>> OSC message and loads up the clip:
>>
>> oe.getInt() => int player;
>> oe.getString() => string snd;
>>
>> // allocate a new sound buffer
>> new SndBuf @=> newClip[player];
>>
>> // stick the new sound in the new sound buffer
>> snd => newClip[player].read;
>>
>> Anyone have any idea what's going on? Should I be destroying these
>> SndBufs more explicitly rather than just dropping their references?
>
> Well, why are you allocating a new one at all? It seems to me that you
> are now working like a DJ who is ordering in a new turntable every
> time he puts on a new record. Why not comment that "new SndBuf...."
> line out alltogether and just use the old player with a new file?
>
> I realise every guess at what might be causing this will cost you 30
> minutes of testing but I think commenting that line out might be the
> fix. Alternately you disconect (unchuck) the old SndBuf from the dac
> but I think this is it.
>
> Yours,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list