[CM] sound-loop-info / mus_sound_loop_info

Bill Schottstaedt bil@ccrma.Stanford.EDU
Fri, 25 May 2007 06:48:45 -0700

> newloc = (int)(samp - (gen->file_buffer_size * .5)); 

Thanks for the interesting suggestion. The original plan was that 
readin would handle that kind of operation, setting the "dir" field --
this is the same, I think, as using the mus-increment function
with the file->frame generator, as you mention.  I'd rather not
make the change you suggest because it means that every sample
is read twice ("read" here can include data type conversions, etc).
Does mus-increment fix the problem?

> Also, just curious why is the file descriptor opened/closed every 
> time the buffer is refilled? Wouldn't this be a performance hit? 

I didn't see any difference in my timing tests, and the current way
avoids any OS limits on open files, and is cleaner if something
goes wrong -- if a computation is interrupted (say you hit a bug
during instrument development), you don't have to worry about
dangling files, and at least some portion of your output is probably