[chuck] Some Problems

Ge Wang gewang at CS.Princeton.EDU
Wed May 11 10:01:00 EDT 2005


> 1) I got error:
> *** Fatal error : sizeof (off_t) != sizeof (sf_count_t)
> *** This means that libsndfile was not configured correctly.
> with examples which uses sndbuf for opening wav-files

This is a problem under Linux (and occasionally OS X) that we hope to 
address with autoconf (Thanks again to Stacken).  For now, there is a 

1. If you don't have libsndfile installed on your system, download 
the library from:


and compile and install it (instructions included in download).

2. Uncomment 3 lines in the ChucK makefile you are using (makefile.alsa, 
makefile.oss, or makefile.jack) at this point:

# by default, ChucK uses a pre-configured libsndfile...
# uncomment the next 3 lines to use libsndfile on your system
#LIBS+= -lsndfile

This will direct ChucK to use the libsndfile that is installed on your 

Sorry for this massive hack!

> 2) With many programs from
> http://wiki.cs.princeton.edu/index.php/ChucK_Programs
> I got errors like
> [hihat.ck]:line(38): cannot cast to type 'int' from 'dur'...

I got the same error on hihat.ck.  This is due to a recent change in the 
sndbuf API (sorry) where length is a 'dur' and no longer a 'int'.  I think 
the way to fix this is by dividing the duration by the appropriate unit 
(samp, the duration of a sample in this case).  (Gary, please let me 
know if my changes are incorrect.)

   (int)(open.length/1::samp) => int tlen;

   // a few lines below
   (int)(closed.length/1::samp) => int tmplen;

sndbuf is also a minor disaster area that needs cleaning up.

Please let us know if you run into more problems.

Happy ChucKing!


More information about the chuck mailing list