Mike, Just some thoughts. When you kill the "last shred" that was playing, the audio signal drops to 0 (or to the first sample of the next WAV file), which may cause clicks. Also, reading an entire file (or part of it) between two samples may not be feasible, which will not only cause a click, but the realtime timing will also be lost (ChucK will wait for the entire file to be read in.) I'd use an Envelope for the first problem and I'd try changing chunk size for the second. (Or maybe pre-read the next file to be played, if it can be determined beforehand.) I hope I could help a little Szilveszter (Hillaby) mike clemow escribió:
This is a shot-in-the-dark...
At the last minute, the person who was responsible for doing the sound with a Kyma system, couldn't get it to trigger sounds with MIDI (for some reason or another) and I'm stepping up and doing the whole show with pre-recorded material in ChucK. (I know, I know -- I'm crazy.)
It's 9:25am here on the East Coast of the U.S. We're onstage at 2pm and 8pm. I have a script that receives OSC messages from a Java program. The messages contain the string name of a file to play. It's a simple stereo file (I'm already working with a very kludgy way of playing stereo files--loading it twice into two buffers). But every time I spawn a new thread, the file loads from disk and there's an audible click, or drop in audio.
Now, I know that one way around this is to pre-load all the files into SndBuf objects and then trigger them to play using Events. The only trouble is that there are 73 files for this piece and some of them are pretty large. I'm afraid of eating all my RAM / bringing everything to a grinding halt.
I'm posting my entire script at the end of the email. If anyone has any thoughts, please send them along. Otherwise, we'll just deal with the way things are.
Best, Mike