[Stk] Hello, and a bug?
Gary Scavone
gary@ccrma.Stanford.EDU
Fri, 30 Jan 2004 19:37:16 -0800 (PST)
Hi Richard,
Thanks for the bug fix. I was made aware of it just a few months ago
and hadn't gotten around to fixing it. I'm still planning to make a
new release in the next month (mostly small bug fixes). I have more
grand plans but they'll have to wait until the summer.
--gary
On Fri, 23 Jan 2004, Richard Dobson wrote:
>>Hello,
>>
>>I have just joined the list. By way of introduction, I am a core developer for
>>the UK-based Composers Desktop Project (CDP). I have been enjoying the STK
>>remotely, so to speak, via it's derivations in Csound, with which I have been
>>involved for many years.
>>
>>I am currently one of a number of co-authors contributing to a book on C and C++
>>programming for musicians, under the editorship of Richard Boulanger. We have
>>some advanced chapters (by Michael Gogins) which feature the use of the STK in
>>the context of creating VST plugins, and in so doing seem to have identified a
>>bug in WaveLoop. The presenting issue is that this was being used (loading a
>>sine wave) to provide modulation of a simple interpolating variable delay line,
>>and we were getting a lot of distortion. This proved to be because the guard
>>point at the end of the sine table (to use the Csound terminology) was not being
>>set appropriately, it duplicated the final table point (in WvIn), whereas for an
>>oscillator we need it to be copy of the first point. My current solution is to
>>add some code to the WaveLoop constructor, copied from ReadData():
>>
>>WaveLoop :: WaveLoop( const char *fileName, bool raw )
>> : WvIn( fileName, raw ), phaseOffset(0.0)
>>{
>> // If at end of file, copy first sample frame for interpolation.
>> if (chunkPointer+bufferSize == fileSize ) {
>> for (unsigned int j=0; j<channels; j++)
>> data[bufferSize*channels+j] = data[j];
>> }
>>}
>>
>>With this change we get lovely clean modulation. I assume that for audio-rate
>>oscillators, the error is unnoticeable. Would this change be likely to break
>>anything else? Other possibly better solutions are clearly possible.
>>
>>(I note that for very short tables such as this, chunking is 0, so readData
>>never gets called inside tickFrame().)
>>
>>Regards to all,
>>
>>Richard Dobson
>>
>>
>>
>>
>>
>>
>>
>>_______________________________________________
>>Stk mailing list
>>Stk@ccrma.stanford.edu
>>http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>>
--
-------------------------------------------------
Gary Scavone
Center for Computer Research in Music & Acoustics
Stanford University
gary@ccrma.stanford.edu
http://www-ccrma.stanford.edu/~gary/
-------------------------------------------------