Two things:
readIndex() only checks to see if the index is < 0 but y1 & y2 have positive
offsets applied so they will index past the end of the buffer. Also, is the
modulation both positive and negative? If so, it could run off the start of
the buffer.
Regards,
Steven Cook.
-----Original Message-----
From: Nuno Santos
Sent: Thursday, March 19, 2015 6:28 PM
To: A discussion list for music-related DSP
Subject: Re: [music-dsp] Glitch/Alias free modulated delay
Hi,
Thanks for your replies.
What I hear is definitely related with the modulation. The artefacts are
audible every time the modulation is applied: manually or automatically
(please not that I have an interpolator for manual parameter changes to
avoid abrupt changes). I think I was already applying an Hermit
interpolation. This is my delay read function.
void IDelay::read(IAudioSample *output)
{
float t = _time+_modulation*_modulationRange;
if (t>(_size-1))
t=_size-1;
float sf;
#if 0
sf = _buffer[int(readIndex(t,0))];
#else
float const y_1= _buffer[int(readIndex(t,-1))];
float const y0 = _buffer[int(readIndex(t,0))];
float const y1 = _buffer[int(readIndex(t,1))];
float const y2 = _buffer[int(readIndex(t,2))];
float const x=readIndex(t,0)-int(readIndex(t,0));
float const c0 = y0;
float const c1 = 0.5f*(y1-y_1);
float const c2 = y_1 - 2.5f*y0 + 2.0f*y1 - 0.5f*y2;
float const c3 = 0.5f*(y2-y_1) + 1.5f*(y0-y1);
sf=((c3*x+c2)*x+c1)*x+c0;
#endif
*output = sf;
}
float IDelay::readIndex(float t, int offset)
{
float index=_writeIndex-t+offset;
if (index<0)
index+=_size;
return index;
}
Thanks,
Regards,
Nuno
On 19 Mar 2015, at 18:12, David Olofson <da...@olofson.net> wrote:
On Thu, Mar 19, 2015 at 6:15 PM, Nuno Santos <nunosan...@imaginando.pt>
wrote:
[...]
If I use interpolation for buffer access I experience less glitch and
more alias.
What type of interpolation are you using? I would think you need
something better than linear interpolation for this. I'd try Hermite.
That should be sufficient for "slow" modulation, although
theoretically, you *should* bandlimit the signal as soon as you play
it back faster than the original sample rate.
For more extreme effects (which effectively means you're sometimes
playing back audio at a substantially higher sample rate than that of
your audio stream), you may need a proper bandlimited resampler.
(Apply a brickwall filter before the interpolation, and/or oversample
the interpolator.)
--
//David Olofson - Consultant, Developer, Artist, Open Source Advocate
.--- Games, examples, libraries, scripting, sound, music, graphics ---.
| http://consulting.olofson.net http://olofsonarcade.com |
'---------------------------------------------------------------------'
--
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
--
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
--
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