No dia 20/03/2015, às 18:51, Marco Lo Monaco<marco.lomon...@teletu.it>  
escreveu:


How often do you update the LFO? Every buffersize (32/64 samples)?


On 3/20/15 3:37 PM, Nuno Santos wrote:
Every sample



okay, Nuno, can you check to see that your code (which i am refactoring a little):

    float y_1= _buffer[int(readIndex(t,-1))];
    float y0 = _buffer[int(readIndex(t,0))];
    float y1 = _buffer[int(readIndex(t,1))];
    float y2 = _buffer[int(readIndex(t,2))];
    float x = readIndex(t,0)-int(readIndex(t,0));

    float sf = ( ( (0.5f*(y2-y_1)+1.5f*(y0-y1))*x + 
(y_1-2.5f*y0+2.0f*y1-0.5f*y2) )*x + 0.5f*(y1-y_1) )*x + y0;


is equivalent to:


    float y_1= _buffer[int(readIndex(t,-1))];
    float y0 = _buffer[int(readIndex(t,0))];
    float y1 = _buffer[int(readIndex(t,1))];
    float y2 = _buffer[int(readIndex(t,2))];
    float x = readIndex(t,0)-int(readIndex(t,0));
    float x2 = x*x;
    float x3 = x2*x;

    float sf = 0.5f*(   (              -x2 +      x3)*y2
                      + (      x + 4.0f*x2 - 3.0f*x3)*y1
                      + (2.0f    - 5.0f*x2 + 3.0f*x3)*y0
                      + (     -x + 2.0f*x2 -      x3)*y_1
                    );

???


i realize that you're using "Horner's method" of polynomial evaluation, which is fine. it's just hard to see the equivalence.


because if it is not, my first guess would be that your Hermite interpolation is not done correctly.

or maybe one (or both) of us got x turned around and it should be replaced by (1.0f - x). which is the most recent sample in real time? y2 or y_1?

--

r b-j                  r...@audioimagination.com

"Imagination is more important than knowledge."



--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Reply via email to